فهرست منبع

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

王鹏鹏 2 سال پیش
والد
کامیت
1440670acf
1فایلهای تغییر یافته به همراه7 افزوده شده و 6 حذف شده
  1. 7 6
      livebroadcast/src/main/java/com/yingyang/livebroadcast/activity/video/VideoPlayerActivity.kt

+ 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()