package com.yidianling.course.router

import android.app.Activity
import com.yidianling.course.courseNew.CourseTopicActivity
import com.yidianling.router.course.ICourseRouter
import com.yidianling.ydlcommon.player.YDLMusicHelper

/**
 * Created by hgw on 2018/5/3.
 */
class CourseRouterImp : ICourseRouter{

    override fun closePlayer() {
        if (YDLMusicHelper.isCoursePlaying()) {
            YDLMusicHelper.stop()
        }
    }

    override fun isPlaying(): Boolean {
        return YDLMusicHelper.isPlaying()
    }

    override fun play(){
        YDLMusicHelper.replay()
    }

    override fun pause(){
        YDLMusicHelper.pause()
    }

    override fun startCoursePlayPage(activity: Activity, from: Int) {
        YDLMusicHelper.startCoursePlayActivity(activity,from)
    }

    override fun courseTopic(activity: Activity, id: String){
        return CourseTopicActivity.start(activity, id)
    }
}