PLVLCMediaAreaView.m
- (PLVPPTView *)pptView{
if (!_pptView && self.channelType != PLVChannelTypeAlone) {
_pptView = [[PLVPPTView alloc] init];
_pptView.delegate = self;
_pptView.backgroudImageView.image = [self getImageWithName:@"plvlc_media_ppt_placeholder"];
}
return _pptView;
}
PLVLCMediaAreaView.m
- (void)setupModule{
/// 注意:懒加载过程中(即Getter),已增加判断,若场景不匹配,将创建失败并返回nil
if (self.videoType == PLVChannelVideoType_Live) { // 视频类型为 直播
/// 直播 模块
/// ...
/// PPT模块
[self.floatView displayExternalView:self.pptView]; /// 无直播时的默认状态,是‘PPT画面’位于副屏(悬浮小窗)
}else if (self.videoType == PLVChannelVideoType_Playback){ // 视频类型为 直播回放
/// 直播回放 模块
/// ...
/// PPT模块
[self.floatView displayExternalView:self.pptView]; /// 默认状态,是‘PPT画面’位于副屏(悬浮小窗)
[self.floatView showFloatView:YES userOperat:NO];
[self.pptView pptStart:[PLVRoomDataManager sharedManager].roomData.vid];
}
}
/// 播放器 ‘SEI信息’ 发生改变
- (void)playerPresenter:(PLVPlayerPresenter *)playerPresenter seiDidChange:(long)timeStamp newTimeStamp:(long)newTimeStamp{
[self.pptView setSEIDataWithNewTimestamp:newTimeStamp];
}
PLVLCMediaAreaView.m
- (unsigned int)plvPPTViewGetPPTRefreshDelayTime:(PLVPPTView *)pptView{
return self.inRTCRoom ? 0 : 5000;
}
/// PPT视图 PPT位置需切换
- (void)plvPPTView:(PLVPPTView *)pptView changePPTPosition:(BOOL)pptToMain{
if (self.videoType == PLVChannelVideoType_Live){ // 视频类型为 直播
/// 仅在 非观看RTC场景下 执行 (观看RTC场景下,由 PLVLCLinkMicAreaView 自行处理)
if (self.inRTCRoom == NO) {
if (pptToMain != self.pptOnMainSite) {
[self.floatView triggerViewExchangeEvent];
}
}
} else if (self.videoType == PLVChannelVideoType_Playback) { // 视频类型为 直播回放
if (pptToMain != self.pptOnMainSite) {
[self.floatView triggerViewExchangeEvent];
}
}
}
/// [回放场景] PPT视图 需要获取视频播放器的当前播放时间点
- (NSTimeInterval)plvPPTViewGetPlayerCurrentTime:(PLVPPTView *)pptView{
return self.playerPresenter.currentPlaybackTime * 1000;
}