5_3-手机开播场景-PPT白板
1 功能概述
PPT&白板模块包括白板、PPT展示、画笔标注等功能。PPT&白板展示界面被封装在类 PLVLSDocumentAreaView 中。
2 使用演示
使用PPT&白板模块需在 PLVLSStreamerViewController 中添加 PLVLSStatusAreaView 控件:
self.documentAreaView = [[PLVLSDocumentAreaView alloc] init];
self.documentAreaView.delegate = self;
[self.view addSubview:self.documentAreaView];同时 PLVLSStreamerViewController 需遵循协议 PLVLSDocumentAreaViewDelegate,并实现以下回调:
#pragma mark - PLVSDocumentAreaView Delegate
- (void)documentAreaView:(PLVLSDocumentAreaView *)documentAreaView openBrush:(BOOL)isOpen {
// isOpen - YES:打开画笔隐藏聊天区域
// isOpen - NO:打开画笔显示聊天区域
}
- (void)documentAreaView:(PLVLSDocumentAreaView *)documentAreaView changeFullScreen:(BOOL)isFullScreen {
self.fullscreen = isFullScreen; // 布尔值 fullscreen 表示当前页面是否处于 ppt 全屏状态
if (fullscreen) {
[self.view insertSubview:self.documentAreaView aboveSubview:self.statusAreaView];
} else { // 全屏时将 documentAreaView 控件插入到子视图的最顶部
[self.view insertSubview:self.documentAreaView atIndex:0];
}
}并在 -viewWillLayoutSubviews 方法中,对 PLVLSStatusAreaView 进行布局:
3 实现介绍
PPT&白板视图 PLVLSStatusAreaView 主要由以下控件组成,其中最重要的,就是负责白板&PPT展示的 PLVStreamerPPTView 类:
3.1 PLVStreamerPPTView
PLVStreamerPPTView 位于 PolyvLiveCommonModule 文件夹下,UI 方面由一个 WKWebView 的实例对象组成,依赖 SDK 的 PLVWebViewBridge 类进行原生与 H5 的通信,实现各种交互功能。
PLVStreamerPPTView 对外提供以下只读属性,获取PPT&白板视图的状态属性:
提供以下方法,用于实现原生与 H5 的通信:
提供以下方法,用于完成白板、文档的切换与翻页等功能:
定义了协议 PLVStreamerPPTViewDelegate,提供以下回调,用于页面 UI 的更新:
Last updated
Was this helpful?