/// PLVECWatchRoomViewController.m
@property (nonatomic, strong) PLVInteractView *interactView; // 互动
- (void)setupModule{
PLVRoomData *roomData = [PLVRoomDataManager sharedManager].roomData;
if (roomData.videoType == PLVChannelVideoType_Live) {
/// 直播
/// 注册互动通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationForOpenBulletin:) name:PLVLEChatroomOpenBulletinNotification object:nil];
} else if (roomData.videoType == PLVChannelVideoType_Playback){
/// 回放
}
}
- (void)setupUI{
if (roomData.videoType == PLVChannelVideoType_Live) {
/// 直播
/// 互动
[self.view addSubview:self.interactView];
/// 互动配置
self.interactView.frame = self.view.bounds;
self.interactView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.interactView loadOnlineInteract];
} else if (roomData.videoType == PLVChannelVideoType_Playback){
/// 回放
}
}
- (PLVInteractView *)interactView{
PLVChannelVideoType videoType = [PLVRoomDataManager sharedManager].roomData.videoType;
if (!_interactView && videoType == PLVChannelVideoType_Live) {
_interactView = [[PLVInteractView alloc] init];
_interactView.frame = self.view.bounds;
_interactView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[_interactView loadOnlineInteract];
}
return _interactView;
}
- (void)notificationForOpenBulletin:(NSNotification *)notif {
[self.interactView openLastBulletin];
}