package com.ydl.confide.router

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v4.app.DialogFragment
import com.ydl.confide.home.ConfideHomeActivity
import com.yidianling.router.phoneCall.IPhoneCallRouter

class PhoneCallImp : IPhoneCallRouter {
    override fun phoneCallFragment(head: String, callId: String): DialogFragment {
        //废弃
        return DialogFragment()
    }

    override fun phoneCallIntent(activity: Activity): Intent {
        //废弃
        val intent = Intent(activity, ConfideHomeActivity::class.java)
        return intent
    }

    override fun openConfideHome(context: Context) {
        val intent = Intent(context, ConfideHomeActivity::class.java)
        if (context !is Activity){
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
        }
        context.startActivity(intent)
    }

    override fun closePlayer() {
//        if (MyPlayer.isStart()) {
//            MyPlayer.getInstance().releaseMedia()
//        }
    }
}