Browse Source

1.修改直播不能播放问题

王鹏鹏 2 years ago
parent
commit
75be2a18b4

+ 6 - 8
app/src/main/java/com/yingyangfly/MyApplication.kt

@@ -4,8 +4,8 @@ import android.content.Context
 import android.util.Log
 import androidx.multidex.MultiDex
 import cn.jpush.android.api.JPushInterface
-import com.tencent.live2.V2TXLiveDef.V2TXLiveLogConfig
-import com.tencent.live2.V2TXLivePremier
+import com.tencent.rtmp.TXLiveBase
+import com.tencent.rtmp.TXLiveBaseListener
 import com.yingyangfly.baselib.BaseApplication
 
 class MyApplication : BaseApplication() {
@@ -20,14 +20,12 @@ class MyApplication : BaseApplication() {
         super.onCreate()
         JPushInterface.setDebugMode(true)
         JPushInterface.init(this)
-        val liveLogConfig = V2TXLiveLogConfig()
-        liveLogConfig.enableConsole = true
-        V2TXLivePremier.setLogConfig(liveLogConfig)
-        V2TXLivePremier.setLicence(this, BuildConfig.TENCENT_LICENCEURL, BuildConfig.TENCENT_LICENCEKEY)
-        V2TXLivePremier.setObserver(object : V2TXLivePremier.V2TXLivePremierObserver() {
-            override fun onLicenceLoaded(result: Int, reason: String?) {
+        TXLiveBase.getInstance().setLicence(this, BuildConfig.TENCENT_LICENCEURL, BuildConfig.TENCENT_LICENCEKEY)
+        TXLiveBase.setListener(object : TXLiveBaseListener() {
+            override fun onLicenceLoaded(result: Int, reason: String) {
                 Log.i("wpp", "onLicenceLoaded: result:$result, reason:$reason")
             }
         })
+
     }
 }

+ 0 - 1
baselib/src/main/java/com/yingyangfly/baselib/voice/PlayVoice.kt

@@ -140,7 +140,6 @@ class PlayVoice {
         }
         if (str.isNotEmpty()) {
             val result: Int = mSpeechSynthesizer!!.speak(str)
-            Log.e("wpp", "合成并播放 按钮已经点击")
             checkResult(result, "speak")
         }
     }

+ 1 - 1
config.gradle

@@ -115,7 +115,7 @@ ext {
             "jpush"                  : 'cn.jiguang.sdk:jpush:5.0.0',
             "gson"                   : 'com.google.code.gson:gson:2.8.5',
             "leakcanary"             : 'com.squareup.leakcanary:leakcanary-android:2.10',
-            "liteavSdk"              : 'com.tencent.liteav:LiteAVSDK_Smart:latest.release'
+            "liteavSdk"              : 'com.tencent.liteav:LiteAVSDK_Player:latest.release'
 
     ]
 }

+ 1 - 2
livebroadcast/src/main/java/com/yingyang/livebroadcast/activity/detail/LiveBroadcastActivity.kt

@@ -86,9 +86,8 @@ class LiveBroadcastActivity :
                 )
             }
         })
-        Log.e("wpp", url)
+
         val result = mLivePlayer?.startLivePlay(url)
-        Log.e("wpp", "----------->$result")
         if (result == 0) {
             mPlayFlag = true
         }

+ 0 - 1
webview/src/main/java/com/yingyangfly/webview/AndroidToJs.kt

@@ -16,7 +16,6 @@ class AndroidToJs(val context: Activity) : Any() {
     // 被JS调用的方法必须加入@JavascriptInterface注解
     @JavascriptInterface
     fun callbackHandle(msg: String?) {
-        Log.e("wpp", "------------------------------777")
         "js回调给原生的参数:$msg".logi()
 //        if (msg?.contains("403") == true) {
 //

+ 0 - 1
webview/src/main/java/com/yingyangfly/webview/BridgeWebActivity.kt

@@ -31,7 +31,6 @@ class BridgeWebActivity : BaseActivity<ActivityBridgeWebBinding>() {
     }
 
     override fun initViews() {
-        Log.e("wpp", url)
         initWebView()
     }
 

+ 2 - 2
workbenches/src/main/java/com/yingyang/workbenches/leisurebrain/LeisureBrainActivity.kt

@@ -18,13 +18,13 @@ class LeisureBrainActivity :
     private var url = ""
 
     override fun initViews() {
-
+        url = "http://60.205.201.7/123.mp4"
     }
 
     override fun initListener() {
         binding.btnPlay.setOnClickListener {
             if (url.isNotEmpty()) {
-
+                JumpUtil.jumpActivityWithUrl(RouterUrlCommon.liveBroadcast, url)
             }
         }