|
@@ -51,9 +51,6 @@ import com.swago.room.lianmai.LianMaiVm
|
|
import com.swago.room.pk.IPKListener
|
|
import com.swago.room.pk.IPKListener
|
|
import com.swago.room.pk.PKStateManager
|
|
import com.swago.room.pk.PKStateManager
|
|
import com.swago.room.pk.PkVm
|
|
import com.swago.room.pk.PkVm
|
|
-import com.swago.room.service.AgoraForegroundService
|
|
|
|
-import com.swago.room.service.AgoraForegroundService.ACTION_START_FOREGROUND_SERVICE
|
|
|
|
-import com.swago.room.service.AgoraForegroundService.ACTION_STOP_FOREGROUND_SERVICE
|
|
|
|
import com.swago.room.vm.MsgVm
|
|
import com.swago.room.vm.MsgVm
|
|
import com.swago.room.vm.RoomOtherVm
|
|
import com.swago.room.vm.RoomOtherVm
|
|
import com.swago.room.vm.RoomVm
|
|
import com.swago.room.vm.RoomVm
|
|
@@ -76,8 +73,6 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
|
|
private val pkVm by viewModels<PkVm>()
|
|
private val pkVm by viewModels<PkVm>()
|
|
private val lianMaiVm by viewModels<LianMaiVm>()
|
|
private val lianMaiVm by viewModels<LianMaiVm>()
|
|
|
|
|
|
- private var agoraService: Intent? = null
|
|
|
|
-
|
|
|
|
private val fragments = arrayListOf(NoContentFragment(), AnchorRoomFragment())
|
|
private val fragments = arrayListOf(NoContentFragment(), AnchorRoomFragment())
|
|
|
|
|
|
private val adapter = SwagoAdapter(fragments, supportFragmentManager)
|
|
private val adapter = SwagoAdapter(fragments, supportFragmentManager)
|
|
@@ -109,7 +104,6 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
|
|
AudioRoomManager.addListener(this)
|
|
AudioRoomManager.addListener(this)
|
|
initPeerAnchorLayoutParams()
|
|
initPeerAnchorLayoutParams()
|
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
|
- agoraService = Intent(this, AgoraForegroundService::class.java)
|
|
|
|
AgoraManager.initializeEngine(this, this)
|
|
AgoraManager.initializeEngine(this, this)
|
|
AgoraManager.setVideoConfiguration()
|
|
AgoraManager.setVideoConfiguration()
|
|
AgoraManager.setVideoAudio(pullVideo = true, pullAudio = true, pushVideo = true, pushAudio = true)
|
|
AgoraManager.setVideoAudio(pullVideo = true, pullAudio = true, pushVideo = true, pushAudio = true)
|
|
@@ -376,25 +370,16 @@ class AnchorRoomActivity : AbsAnchorActivity<ActivityAnchorRoomBinding, IRoomInf
|
|
|
|
|
|
override fun onResume() {
|
|
override fun onResume() {
|
|
super.onResume()
|
|
super.onResume()
|
|
- agoraService?.let {
|
|
|
|
- it.action = ACTION_STOP_FOREGROUND_SERVICE
|
|
|
|
- startService(it)
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
override fun onPause() {
|
|
override fun onPause() {
|
|
super.onPause()
|
|
super.onPause()
|
|
- agoraService?.let {
|
|
|
|
- it.action = ACTION_START_FOREGROUND_SERVICE
|
|
|
|
- startService(it)
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
override fun onDestroy() {
|
|
override fun onDestroy() {
|
|
anchorCloseDialog = null
|
|
anchorCloseDialog = null
|
|
PKStateManager.removePKListener(this)
|
|
PKStateManager.removePKListener(this)
|
|
AudioRoomManager.removeListener(this)
|
|
AudioRoomManager.removeListener(this)
|
|
- agoraService?.let { stopService(it) }
|
|
|
|
super.onDestroy()
|
|
super.onDestroy()
|
|
}
|
|
}
|
|
|
|
|