@@ -122,17 +122,16 @@ void onVodPlaybackProcess(anyrtc::IArLivePlayer *player, int allDuration, int cu
122122
123123 void onStatisticsUpdate (anyrtc::IArLivePlayer *player, anyrtc::ArLivePlayerStatistics statistics) override {
124124 // / 直播播放器统计数据回调
125+ ARLivePlayerStatistics *playerStatistics = [[ARLivePlayerStatistics alloc ] init ];
126+ playerStatistics.width = statistics.width ;
127+ playerStatistics.height = statistics.height ;
128+ playerStatistics.fps = statistics.fps ;
129+ playerStatistics.videoBitrate = statistics.videoBitrate ;
130+ playerStatistics.audioBitrate = statistics.audioBitrate ;
131+
125132 void (^functionBlock)() = ^(){
126133 if (!isDestroy ()) {
127134 if ([play_delegate_ respondsToSelector: @selector (onStatisticsUpdate:statistics: )]) {
128- ARLivePlayerStatistics *playerStatistics = [[ARLivePlayerStatistics alloc ] init ];
129- playerStatistics.appCpu = statistics.appCpu ;
130- playerStatistics.systemCpu = statistics.systemCpu ;
131- playerStatistics.width = statistics.width ;
132- playerStatistics.height = statistics.height ;
133- playerStatistics.fps = statistics.fps ;
134- playerStatistics.videoBitrate = statistics.videoBitrate ;
135- playerStatistics.audioBitrate = statistics.audioBitrate ;
136135 [play_delegate_ onStatisticsUpdate: playerKit_ statistics: playerStatistics];
137136 }
138137 }
@@ -161,10 +160,10 @@ void onRenderVideoFrame(anyrtc::IArLivePlayer *player, const anyrtc::ArLiveVideo
161160
162161 void onReceiveSeiMessage (anyrtc::IArLivePlayer *player, int payloadType, const uint8_t *data, uint32_t dataSize) override {
163162 // / 收到 SEI 消息的回调,发送端通过 {@link ArLivePusher} 中的 `sendSeiMessage` 来发送 SEI 消息
163+ NSData *seiData = [NSData dataWithBytes: data length: dataSize];
164164 void (^functionBlock)() = ^(){
165165 if (!isDestroy ()) {
166166 if ([play_delegate_ respondsToSelector: @selector (onReceiveSeiMessage:payloadType:data: )]) {
167- NSData *seiData = [NSData dataWithBytes: data length: dataSize];
168167 [play_delegate_ onReceiveSeiMessage: playerKit_ payloadType: payloadType data: seiData];
169168 }
170169 }
@@ -303,16 +302,25 @@ - (int)isPlaying {
303302
304303- (int )seekTo : (int )seekTimeS {
305304 // / 跳转进度
305+ if (_livePlayer) {
306+ return _livePlayer->seekTo (seekTimeS);
307+ }
306308 return -1 ;
307309}
308310
309311- (int )setSpeed : (CGFloat)speed {
310312 // / 倍速播放
313+ if (_livePlayer) {
314+ return _livePlayer->setSpeed (speed);
315+ }
311316 return -1 ;
312317}
313318
314319- (int )replay {
315320 // / 重新开始播放。一般用于点播场景
321+ if (_livePlayer) {
322+ _livePlayer->rePlay ();
323+ }
316324 return -1 ;
317325}
318326
0 commit comments