Bladeren bron

1.修改康复课堂视频打不开bug

王鹏鹏 2 jaren geleden
bovenliggende
commit
1440670acf

+ 7 - 6
livebroadcast/src/main/java/com/yingyang/livebroadcast/activity/video/VideoPlayerActivity.kt

@@ -23,13 +23,14 @@ class VideoPlayerActivity : BaseActivity<ActivityVideoPlayerBinding>(), View.OnT
     private var title = ""
     private var url = ""
 
-    override fun onCreate(savedInstanceState: Bundle?) {
-        url = intent.getStringExtra("url") ?: ""
-        title = intent.getStringExtra("title") ?: ""
-        super.onCreate(savedInstanceState)
-    }
-
     override fun initViews() {
+        val videoUrl = intent.getStringExtra("url") ?: ""
+        title = intent.getStringExtra("title") ?: ""
+        url = if (videoUrl.startsWith("")) {
+            videoUrl.replace("http://60.205.201.7/", "https://www.yingyangfly.com/")
+        } else {
+            videoUrl
+        }
         binding {
             tvTitle.text = title
             val model = SuperPlayerModel()