tongmengxiao 5 сар өмнө
parent
commit
b051d4a7f5

+ 7 - 0
baseswago/src/main/java/com/swago/baseswago/inter/RoomApi.kt

@@ -721,5 +721,12 @@ interface RoomApi {
     @POST("/v4/rtc/yuying/bg/list")
     suspend fun getAudioBg(@Field("broadcast_type")broadcast_type:Int):AudioBgModel
 
+    /**
+     * 系统关播上报
+     */
+    @FormUrlEncoded
+    @POST("v1/rtc/system/upload/broadcast")
+    suspend fun uploadBroadcast(@Field("room_id")room_id:String):Any
+
 
 }

+ 3 - 1
room/src/main/java/com/swago/room/anchor/AnchorRoomActivity.kt

@@ -102,6 +102,7 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
 
     private lateinit var countDownTimer: CountDownTimer
     private var startFaceShowTimer = true
+    private var liveNoFaceTime:Long = 600000
 
     override fun initLiveData() {
         PKStateManager.resetData()
@@ -340,11 +341,12 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
             binding.cbPassword.text = if (isChecked)  "Password ·NO" else "Password ·OFF"
             checkPassword = isChecked
         }
-        countDownTimer = object : CountDownTimer(10000, 10000) {
+        countDownTimer = object : CountDownTimer(liveNoFaceTime, liveNoFaceTime) {
             override fun onTick(millisUntilFinished: Long) {
             }
 
             override fun onFinish() {
+                roomVm.uploadBroadcast()
                 SwagoRoomManager.closeRoom()
             }
 

+ 9 - 0
room/src/main/java/com/swago/room/vm/RoomVm.kt

@@ -354,6 +354,15 @@ class RoomVm(application: Application) : AbsRoomVm(application) {
         }
     }
 
+    fun uploadBroadcast(){
+        requestData2(false) {
+            requestData{
+                SwagoRoomManager.iRoomInfo?.let {
+                    ApiManager.roomApi.uploadBroadcast(it.getRoomId())
+                }
+            }
+        }
+    }
 
     /**
      * 主播