@@ -6,12 +6,13 @@ import io.agora.mediaplayer.Constants
6
6
import io.agora.mediaplayer.Constants.MediaPlayerState
7
7
import io.agora.mediaplayer.IMediaPlayer
8
8
import io.agora.mediaplayer.IMediaPlayerObserver
9
+ import io.agora.mediaplayer.data.CacheStatistics
10
+ import io.agora.mediaplayer.data.PlayerPlaybackStats
9
11
import io.agora.mediaplayer.data.PlayerUpdatedInfo
10
12
import io.agora.mediaplayer.data.SrcInfo
11
13
import io.agora.musiccontentcenter.*
12
14
import io.agora.rtc2.*
13
15
import io.agora.rtc2.Constants.*
14
- import io.agora.rtc2.internal.Logging
15
16
import org.json.JSONException
16
17
import org.json.JSONObject
17
18
import java.util.concurrent.*
@@ -23,7 +24,7 @@ class KTVGiantChorusApiImpl(
23
24
companion object {
24
25
private val scheduledThreadPool: ScheduledExecutorService = Executors .newScheduledThreadPool(5 )
25
26
private const val tag = " KTV_API_LOG_GIANT"
26
- private const val version = " 4.3 .0"
27
+ private const val version = " 5.0 .0"
27
28
private const val lyricSyncVersion = 2
28
29
}
29
30
@@ -335,20 +336,15 @@ class KTVGiantChorusApiImpl(
335
336
override fun enableMulitpathing (enable : Boolean ) {
336
337
apiReporter.reportFuncEvent(" enableMulitpathing" , mapOf (" enable" to enable), mapOf ())
337
338
this .enableMultipathing = enable
338
- // mRtcEngine.setParameters("{\"rtc.enableMultipath\": $enable}")
339
- // if (enable) {
340
- // mRtcEngine.setParameters("{\"rtc.enable_tds_request_on_join\": true}")
341
- // mRtcEngine.setParameters("{\"rtc.remote_path_scheduling_strategy\": 0}")
342
- // mRtcEngine.setParameters("{\"rtc.path_scheduling_strategy\": 0}")
343
- // }
344
339
345
- if (singerRole == KTVSingRole .LeadSinger || singerRole == KTVSingRole .CoSinger ) {
346
- subChorusConnection?.let {
347
- mRtcEngine.updateChannelMediaOptionsEx(ChannelMediaOptions ().apply {
348
- parameters = " {\" rtc.enableMultipath\" : $enable , \" rtc.path_scheduling_strategy\" : 0, \" rtc.remote_path_scheduling_strategy\" : 0}"
349
- }, subChorusConnection)
350
- }
351
- }
340
+ // TODO 4.3.1 not ready
341
+ // if (singerRole == KTVSingRole.LeadSinger || singerRole == KTVSingRole.CoSinger) {
342
+ // subChorusConnection?.let {
343
+ // mRtcEngine.updateChannelMediaOptionsEx(ChannelMediaOptions().apply {
344
+ // parameters = "{\"rtc.enableMultipath\": $enable, \"rtc.path_scheduling_strategy\": 0, \"rtc.remote_path_scheduling_strategy\": 0}"
345
+ // }, subChorusConnection)
346
+ // }
347
+ // }
352
348
}
353
349
354
350
override fun renewToken (rtmToken : String , chorusChannelRtcToken : String ) {
@@ -761,7 +757,7 @@ class KTVGiantChorusApiImpl(
761
757
singChannelMediaOptions.autoSubscribeAudio = true
762
758
singChannelMediaOptions.publishMicrophoneTrack = true
763
759
singChannelMediaOptions.clientRoleType = CLIENT_ROLE_BROADCASTER
764
- singChannelMediaOptions.parameters = " {\" che.audio.max_mixed_participants\" : 8}"
760
+ // singChannelMediaOptions.parameters = "{\"che.audio.max_mixed_participants\": 8}" // TODO 4.3.1 not ready
765
761
if (newRole == KTVSingRole .LeadSinger ) {
766
762
// 主唱不参加TopN
767
763
singChannelMediaOptions.isAudioFilterable = false
@@ -1008,12 +1004,12 @@ class KTVGiantChorusApiImpl(
1008
1004
1009
1005
private fun syncPlayState (
1010
1006
state : Constants .MediaPlayerState ,
1011
- error : Constants .MediaPlayerError
1007
+ error : Constants .MediaPlayerReason
1012
1008
) {
1013
1009
val msg: MutableMap <String ?, Any ?> = HashMap ()
1014
1010
msg[" cmd" ] = " PlayerState"
1015
1011
msg[" state" ] = Constants .MediaPlayerState .getValue(state)
1016
- msg[" error" ] = Constants .MediaPlayerError .getValue(error)
1012
+ msg[" error" ] = Constants .MediaPlayerReason .getValue(error)
1017
1013
val jsonMsg = JSONObject (msg)
1018
1014
sendStreamMessageWithJsonObject(jsonMsg) {}
1019
1015
}
@@ -1354,7 +1350,7 @@ class KTVGiantChorusApiImpl(
1354
1350
}
1355
1351
ktvApiEventHandlerList.forEach { it.onMusicPlayerStateChanged(
1356
1352
MediaPlayerState .getStateByValue(state),
1357
- Constants .MediaPlayerError .getErrorByValue(error),
1353
+ Constants .MediaPlayerReason .getErrorByValue(error),
1358
1354
false
1359
1355
) }
1360
1356
} else if (jsonMsg.getString(" cmd" ) == " setVoicePitch" ) {
@@ -1468,11 +1464,11 @@ class KTVGiantChorusApiImpl(
1468
1464
private var duration: Long = 0
1469
1465
override fun onPlayerStateChanged (
1470
1466
state : Constants .MediaPlayerState ? ,
1471
- error : Constants .MediaPlayerError ?
1467
+ reason : Constants .MediaPlayerReason ?
1472
1468
) {
1473
1469
val mediaPlayerState = state ? : return
1474
- val mediaPlayerError = error ? : return
1475
- ktvApiLog(" onPlayerStateChanged called, state: $mediaPlayerState , error: $error " )
1470
+ val mediaPlayerError = reason ? : return
1471
+ ktvApiLog(" onPlayerStateChanged called, state: $mediaPlayerState , error: $mediaPlayerError " )
1476
1472
this .mediaPlayerState = mediaPlayerState
1477
1473
when (mediaPlayerState) {
1478
1474
MediaPlayerState .PLAYER_STATE_OPEN_COMPLETED -> {
@@ -1557,5 +1553,9 @@ class KTVGiantChorusApiImpl(
1557
1553
1558
1554
override fun onPlayerInfoUpdated (info : PlayerUpdatedInfo ? ) {}
1559
1555
1556
+ override fun onPlayerCacheStats (stats : CacheStatistics ? ) {}
1557
+
1558
+ override fun onPlayerPlaybackStats (stats : PlayerPlaybackStats ? ) {}
1559
+
1560
1560
override fun onAudioVolumeIndication (volume : Int ) {}
1561
1561
}
0 commit comments