@@ -99,6 +99,9 @@ fileprivate enum KTVSongMode: Int {
99
99
private var isPublishAudio : Bool = false
100
100
private var preludeDuration : Int64 = 0
101
101
private lazy var apiDelegateHandler = KTVApiRTCDelegateHandler ( with: self )
102
+
103
+ private var totalSize : Int = 0
104
+
102
105
deinit {
103
106
mcc? . register ( nil )
104
107
agoraPrint ( " deinit KTVApiImpl " )
@@ -164,7 +167,7 @@ fileprivate enum KTVSongMode: Int {
164
167
// engine.setParameters("{\"rtc.remote_path_scheduling_strategy\": 0}")
165
168
engine. setParameters ( " { \" rtc.path_scheduling_strategy \" : 0} " )
166
169
// engine.setParameters("{\"rtc.enableMultipath\": true}")
167
-
170
+ engine . setParameters ( " { \" rtc.log_external_input \" :true} " )
168
171
}
169
172
170
173
func renewInnerDataStreamId( ) {
@@ -429,15 +432,15 @@ extension KTVApiImpl {
429
432
#if DEBUG
430
433
print ( message)
431
434
#else
432
- apiConfig? . engine? . writeLog ( . info, content: message)
435
+ apiConfig? . engine? . writeLog ( . info, content: " ktv_info: \( message) " )
433
436
#endif
434
437
}
435
438
436
439
private func agoraPrintError( _ message: String ) {
437
440
#if DEBUG
438
441
print ( message)
439
442
#else
440
- apiConfig? . engine? . writeLog ( . error, content: message)
443
+ apiConfig? . engine? . writeLog ( . error, content: " ktv_err: \( message) " )
441
444
#endif
442
445
}
443
446
}
@@ -755,7 +758,7 @@ extension KTVApiImpl {
755
758
}
756
759
} else {
757
760
loadMusicListeners. setObject ( onMusicLoadStateListener, forKey: " \( self . songCode) " as NSString )
758
- onMusicLoadStateListener. onMusicLoadProgress ( songCode: self . songCode, percent: 0 , status: . preloading, msg: " " , lyricUrl: " " )
761
+ // onMusicLoadStateListener.onMusicLoadProgress(songCode: self.songCode, percent: 0, status: .preloading, msg: "", lyricUrl: "")
759
762
// TODO: 只有未缓存时才显示进度条
760
763
if mcc? . isPreloaded ( songCode: songCode) != 0 {
761
764
onMusicLoadStateListener. onMusicLoadProgress ( songCode: self . songCode, percent: 0 , status: . preloading, msg: " " , lyricUrl: " " )
@@ -1277,11 +1280,14 @@ extension KTVApiImpl {
1277
1280
1278
1281
private func sendStreamMessageWithDict( _ dict: [ String : Any ] , success: ( ( _ success: Bool ) -> Void ) ? ) {
1279
1282
let messageData = compactDictionaryToData ( dict as [ String : Any ] )
1283
+ let sizeInBits = ( messageData ?? Data ( ) ) . count * 8
1284
+ totalSize += sizeInBits
1280
1285
let code = apiConfig? . engine? . sendStreamMessage ( dataStreamId, data: messageData ?? Data ( ) )
1281
1286
if code == 0 && success != nil { success!( true ) }
1282
1287
if code != 0 {
1283
1288
agoraPrint ( " sendStreamMessage fail: \( String ( describing: code) ) " )
1284
1289
}
1290
+ print ( " totalSize: \( totalSize) " )
1285
1291
}
1286
1292
1287
1293
private func syncPlayState( _ state: AgoraMediaPlayerState ) {
0 commit comments