|
|
@@ -16,6 +16,7 @@ import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
import com.yingyangfly.baselib.utils.GsonUtil
|
|
|
import com.yingyangfly.baselib.utils.LiveEventBusUtil
|
|
|
import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
+import com.yingyangfly.baselib.utils.User
|
|
|
|
|
|
/**
|
|
|
* 直播详情
|
|
|
@@ -45,24 +46,28 @@ class LiveDetailsActivity : BaseMVVMActivity<ActivityLiveDetailsBinding, LiveDet
|
|
|
tvLiveTime.text = "直播时间:" + record?.getLiveTime()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
"2" -> {
|
|
|
binding {
|
|
|
tvStatus.text = "直播中"
|
|
|
tvLiveTime.text = "直播时间:" + record?.getLiveTime()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
"3" -> {
|
|
|
binding {
|
|
|
tvStatus.text = "直播中断"
|
|
|
tvLiveTime.text = "直播时间:" + record?.getLiveTime()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
"4" -> {
|
|
|
binding {
|
|
|
tvStatus.text = "直播取消"
|
|
|
tvLiveTime.text = "直播时间:" + record?.getLiveTime()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
binding.tvLiveTime.text = "直播时间:" + record?.getLiveTime()
|
|
|
if (TextUtils.isEmpty(record?.liveVideo)) {
|
|
|
@@ -85,7 +90,7 @@ class LiveDetailsActivity : BaseMVVMActivity<ActivityLiveDetailsBinding, LiveDet
|
|
|
}
|
|
|
|
|
|
override fun initData() {
|
|
|
-
|
|
|
+ reportLog("进入直播详情页面")
|
|
|
}
|
|
|
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
@@ -96,6 +101,7 @@ class LiveDetailsActivity : BaseMVVMActivity<ActivityLiveDetailsBinding, LiveDet
|
|
|
v.startAnimation(getScaleAnimation())
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_UP -> {
|
|
|
v.startAnimation(getEndAnimation())
|
|
|
if (v.id == R.id.layoutHome) {
|
|
|
@@ -117,15 +123,19 @@ class LiveDetailsActivity : BaseMVVMActivity<ActivityLiveDetailsBinding, LiveDet
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
"2" -> {
|
|
|
initPermission()
|
|
|
}
|
|
|
+
|
|
|
"3" -> {
|
|
|
"您好,本次直播已中断,请您刷新列表重试,感谢您的参与!".toast()
|
|
|
}
|
|
|
+
|
|
|
"4" -> {
|
|
|
"您好,本次直播已取消,您可以预约观看其他直播,感谢您的参与!".toast()
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
if (TextUtils.isEmpty(record?.liveVideo)) {
|
|
|
"您好,本次直播已经结束,您可以选择观看直播回放,也可以预约观看其他直播。感谢您的参与!".toast()
|
|
|
@@ -137,6 +147,7 @@ class LiveDetailsActivity : BaseMVVMActivity<ActivityLiveDetailsBinding, LiveDet
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_CANCEL -> {
|
|
|
if (v.id == R.id.layoutHome || v.id == R.id.tvStatus) {
|
|
|
v.startAnimation(getEndAnimation())
|
|
|
@@ -152,11 +163,9 @@ class LiveDetailsActivity : BaseMVVMActivity<ActivityLiveDetailsBinding, LiveDet
|
|
|
private fun videoPlayer() {
|
|
|
if (record != null) {
|
|
|
ARouter.getInstance().build(RouterUrlCommon.videoPlayer)
|
|
|
- .withString("url", record?.liveVideo)
|
|
|
- .withString("title", record?.liveName)
|
|
|
+ .withString("url", record?.liveVideo).withString("title", record?.liveName)
|
|
|
.withTransition(
|
|
|
- R.anim.leftin,
|
|
|
- R.anim.leftout
|
|
|
+ R.anim.leftin, R.anim.leftout
|
|
|
).navigation(mContext)
|
|
|
}
|
|
|
}
|
|
|
@@ -193,11 +202,25 @@ class LiveDetailsActivity : BaseMVVMActivity<ActivityLiveDetailsBinding, LiveDet
|
|
|
private fun getUserSign() {
|
|
|
if (record != null && record?.streamInfo != null) {
|
|
|
ARouter.getInstance().build(RouterUrlCommon.liveBroadcast)
|
|
|
- .withString("url", record?.streamInfo?.webrtcPull)
|
|
|
- .withString("liveId", record?.id)
|
|
|
- .withString("title", record?.liveName)
|
|
|
- .withTransition(R.anim.leftin, R.anim.leftout)
|
|
|
+ .withString("url", record?.streamInfo?.webrtcPull).withString("liveId", record?.id)
|
|
|
+ .withString("title", record?.liveName).withTransition(R.anim.leftin, R.anim.leftout)
|
|
|
.navigation(mContext)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 阿里云日志上报
|
|
|
+ */
|
|
|
+ private fun reportLog(msg: String) {
|
|
|
+ runOnUiThread {
|
|
|
+ val log = com.aliyun.sls.android.producer.Log()
|
|
|
+ log.putContent(
|
|
|
+ "直播回放页面日志", msg
|
|
|
+ )
|
|
|
+ log.putContent("患者id", User.getUserId())
|
|
|
+ log.putContent("患者姓名", User.getName())
|
|
|
+ sendLog(log)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|