|
|
@@ -6,9 +6,7 @@ import android.text.TextUtils
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import com.alibaba.android.arouter.facade.annotation.Route
|
|
|
-import com.tencent.liteav.demo.superplayer.SuperPlayerModel
|
|
|
import com.yingyangfly.baselib.bean.Record
|
|
|
-import com.yingyangfly.baselib.config.AccountConfig
|
|
|
import com.yingyangfly.baselib.ext.getEndAnimation
|
|
|
import com.yingyangfly.baselib.ext.getScaleAnimation
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
@@ -25,10 +23,10 @@ class GameIntroductionActivity :
|
|
|
BaseMVVMActivity<ActivityGameIntroductionBinding, GameIntroductionViewModel>(),
|
|
|
View.OnTouchListener {
|
|
|
|
|
|
- private var url: String = ""
|
|
|
+ private var id: String = ""
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
- url = intent.getStringExtra("url") ?: ""
|
|
|
+ id = intent.getStringExtra("url") ?: ""
|
|
|
super.onCreate(savedInstanceState)
|
|
|
}
|
|
|
|
|
|
@@ -51,8 +49,8 @@ class GameIntroductionActivity :
|
|
|
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
- if (TextUtils.isEmpty(url).not()) {
|
|
|
- viewModel.getGameDetail(url, fail = {
|
|
|
+ if (TextUtils.isEmpty(id).not()) {
|
|
|
+ viewModel.getGameDetail(id, fail = {
|
|
|
|
|
|
}, success = {
|
|
|
if (it != null) {
|
|
|
@@ -60,11 +58,23 @@ class GameIntroductionActivity :
|
|
|
if (TextUtils.isEmpty(it.gameVideoUrl).not()) {
|
|
|
initPalyer(it)
|
|
|
}
|
|
|
+ getGameDetailByCode(it.gameCode, it.playClass)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取游戏信息
|
|
|
+ */
|
|
|
+ private fun getGameDetailByCode(gameCode: String, playClass: String) {
|
|
|
+ viewModel.getGameDetailByCode(gameCode, playClass, fail = {
|
|
|
+
|
|
|
+ }, success = {
|
|
|
+
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 初始化播放器
|
|
|
*/
|
|
|
@@ -85,7 +95,7 @@ class GameIntroductionActivity :
|
|
|
if (v.id == R.id.homeImage) {
|
|
|
JumpUtil.jumpActivity(RouterUrlCommon.home, mContext)
|
|
|
} else if (v.id == R.id.btnStartGame) {
|
|
|
-
|
|
|
+ JumpUtil.jumpActivityWithUrl(RouterUrlCommon.playGame, id, mContext)
|
|
|
}
|
|
|
}
|
|
|
MotionEvent.ACTION_CANCEL -> {
|