|
|
@@ -40,7 +40,6 @@ class GameIntroductionActivity :
|
|
|
View.OnTouchListener {
|
|
|
|
|
|
private var desn = ""
|
|
|
- private var videoUrl = ""
|
|
|
private var isEnterGame = false
|
|
|
private var gameCode: String = ""
|
|
|
private var playClass: String = ""
|
|
|
@@ -57,7 +56,6 @@ class GameIntroductionActivity :
|
|
|
desn = intent.getStringExtra("desn") ?: ""
|
|
|
gameCode = intent.getStringExtra("gameCode") ?: ""
|
|
|
playClass = intent.getStringExtra("playClass") ?: ""
|
|
|
- videoUrl = intent.getStringExtra("videoUrl") ?: ""
|
|
|
gameInbetweenImage = intent.getStringExtra("gameInbetweenImage") ?: ""
|
|
|
gameBackgroundImage = intent.getStringExtra("gameBackgroundImage") ?: ""
|
|
|
super.onCreate(savedInstanceState)
|
|
|
@@ -65,13 +63,11 @@ class GameIntroductionActivity :
|
|
|
|
|
|
override fun initViews() {
|
|
|
voicePlayer = VoicePlayer.getInstance(mContext)
|
|
|
- if (TextUtils.isEmpty(gameInbetweenImage).not()) {
|
|
|
- val options: RequestOptions = RequestOptions()
|
|
|
- .placeholder(R.drawable.bg_game_settlement)
|
|
|
- .error(R.drawable.bg_game_settlement)
|
|
|
- .diskCacheStrategy(DiskCacheStrategy.ALL)
|
|
|
- Glide.with(mContext).load(gameInbetweenImage).apply(options).into(binding.imageBg)
|
|
|
- }
|
|
|
+ val options: RequestOptions = RequestOptions()
|
|
|
+ .placeholder(R.drawable.bg_game_settlement)
|
|
|
+ .error(R.drawable.bg_game_settlement)
|
|
|
+ .diskCacheStrategy(DiskCacheStrategy.ALL)
|
|
|
+ Glide.with(mContext).load(gameInbetweenImage).apply(options).into(binding.imageBg)
|
|
|
}
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
@@ -83,13 +79,6 @@ class GameIntroductionActivity :
|
|
|
}
|
|
|
|
|
|
override fun initData() {
|
|
|
- binding {
|
|
|
- val model = SuperPlayerModel()
|
|
|
- model.appId = AccountConfig.TENCENT_APPID // 配置 AppId
|
|
|
- model.url = videoUrl // 配置您的播放视频 url
|
|
|
- binding.playTxCloudView.showOrHideBackBtn(false)
|
|
|
- binding.playTxCloudView.playWithModelNeedLicence(model)
|
|
|
- }
|
|
|
initLiveData()
|
|
|
}
|
|
|
|
|
|
@@ -133,6 +122,9 @@ class GameIntroductionActivity :
|
|
|
if (it != null) {
|
|
|
gameBean = it
|
|
|
binding.data = it
|
|
|
+ if (TextUtils.isEmpty(it.gameVideoUrl).not()) {
|
|
|
+ loadVideo(it.gameVideoUrl)
|
|
|
+ }
|
|
|
when (it.gameDifficulty) {
|
|
|
"A" -> {
|
|
|
binding {
|
|
|
@@ -282,4 +274,17 @@ class GameIntroductionActivity :
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 加载游戏视频
|
|
|
+ */
|
|
|
+ private fun loadVideo(url: String) {
|
|
|
+ binding {
|
|
|
+ val model = SuperPlayerModel()
|
|
|
+ model.appId = AccountConfig.TENCENT_APPID // 配置 AppId
|
|
|
+ model.url = url // 配置您的播放视频 url
|
|
|
+ binding.playTxCloudView.showOrHideBackBtn(false)
|
|
|
+ binding.playTxCloudView.playWithModelNeedLicence(model)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|