PLVWebViewBridgeProtocol

Objective-C

@protocol PLVWebViewBridgeProtocol <NSObject>

@optional

#pragma mark 观看场景回调

/// webView 上PPT视图准备完毕时调用
- (void)jsbridge_PPTHadPrepare;

/// [回放场景] PPT视图 需要获取视频播放器的当前播放时间点
/// @return NSTimeInterval 当前播放时间点
- (NSTimeInterval)jsbridge_getCurrentPlaybackTime;

/// [回放场景] PPT视图 讲师发起PPT位置切换
/// @note 回放中,将复现讲师对PPT的位置操作。收到此回调时,外部应根据 status 值相应切换PPT视图位置
/// @param status PPT是否需要切换至主窗口 (YES-PPT需要切至主窗口 NO-PPT需要切至小窗,视频需要切至主窗口)
- (void)jsbridge_changePPTPosition:(BOOL)status;

/// [回放场景] webView 上的文档翻页时调用
/// @note 观众本地翻页或讲师远端翻页都会执行此方法
- (void)jsbridge_pageStatusChangeWithAutoId:(NSUInteger)autoId pageNumber:(NSUInteger)pageNumber totalPage:(NSUInteger)totalPage pptStep:(NSUInteger)step maxNextNumber:(NSUInteger)maxNextNumber;

#pragma mark 推流场景回调

/// webView 需要发送消息给 socket 时调用
- (void)jsbridge_sendSocketEventWithJson:(id)jsonObject;

/// webView 上的文档切换时调用
- (void)jsbridge_documentChangeWithAutoId:(NSUInteger)autoId imageUrls:(NSArray *)imageUrls fileName:(NSString * _Nullable)fileName;

/// webView 上的文档翻页时调用
- (void)jsbridge_pageStatusChangeWithAutoId:(NSUInteger)autoId pageNumber:(NSUInteger)pageNumber totalPage:(NSUInteger)totalPage pptStep:(NSUInteger)step;

/// webView 上准备输入文字时调用
- (void)jsbridge_documentInputWithText:(NSString *)inputText textColor:(NSString *)textColor;

/// webView 上白板预览图更新时调用
- (void)jsbridge_updateWhiteboardImageData:(NSData *)imageData pageNumber:(NSUInteger)pageNumber;

/// webView 上白板或者PPT缩放时调用
/// @param zoomRatio 缩放的比例 (100 表示 100%,200 表示 200%)
- (void)jsbridge_updateWhiteboardPPTZoomRatio:(NSInteger)zoomRatio;

@end

Swift

protocol PLVWebViewBridgeProtocol : NSObjectProtocol

Undocumented

观看场景回调

  • webView 上PPT视图准备完毕时调用

    Declaration

    Objective-C

    - (void)jsbridge_PPTHadPrepare;

    Swift

    optional func jsbridge_PPTHadPrepare()
  • [回放场景] PPT视图 需要获取视频播放器的当前播放时间点

    Declaration

    Objective-C

    - (NSTimeInterval)jsbridge_getCurrentPlaybackTime;

    Swift

    optional func jsbridge_getCurrentPlaybackTime() -> TimeInterval

    Return Value

    NSTimeInterval 当前播放时间点

  • [回放场景] PPT视图 讲师发起PPT位置切换

    Note

    回放中,将复现讲师对PPT的位置操作。收到此回调时,外部应根据 status 值相应切换PPT视图位置

    Declaration

    Objective-C

    - (void)jsbridge_changePPTPosition:(BOOL)status;

    Swift

    optional func jsbridge_changePPTPosition(_ status: Bool)

    Parameters

    status

    PPT是否需要切换至主窗口 (YES-PPT需要切至主窗口 NO-PPT需要切至小窗,视频需要切至主窗口)

  • [回放场景] webView 上的文档翻页时调用

    Note

    观众本地翻页或讲师远端翻页都会执行此方法

    Declaration

    Objective-C

    - (void)jsbridge_pageStatusChangeWithAutoId:(NSUInteger)autoId
                                     pageNumber:(NSUInteger)pageNumber
                                      totalPage:(NSUInteger)totalPage
                                        pptStep:(NSUInteger)step
                                  maxNextNumber:(NSUInteger)maxNextNumber;

    Swift

    optional func jsbridge_pageStatusChange(withAutoId autoId: UInt, pageNumber: UInt, totalPage: UInt, pptStep step: UInt, maxNextNumber: UInt)

推流场景回调

  • webView 需要发送消息给 socket 时调用

    Declaration

    Objective-C

    - (void)jsbridge_sendSocketEventWithJson:(nonnull id)jsonObject;

    Swift

    optional func jsbridge_sendSocketEvent(withJson jsonObject: Any)
  • webView 上的文档切换时调用

    Declaration

    Objective-C

    - (void)jsbridge_documentChangeWithAutoId:(NSUInteger)autoId
                                    imageUrls:(nonnull NSArray *)imageUrls
                                     fileName:(NSString *_Nullable)fileName;

    Swift

    optional func jsbridge_documentChange(withAutoId autoId: UInt, imageUrls: [Any], fileName: String?)
  • webView 上的文档翻页时调用

    Declaration

    Objective-C

    - (void)jsbridge_pageStatusChangeWithAutoId:(NSUInteger)autoId
                                     pageNumber:(NSUInteger)pageNumber
                                      totalPage:(NSUInteger)totalPage
                                        pptStep:(NSUInteger)step;

    Swift

    optional func jsbridge_pageStatusChange(withAutoId autoId: UInt, pageNumber: UInt, totalPage: UInt, pptStep step: UInt)
  • webView 上准备输入文字时调用

    Declaration

    Objective-C

    - (void)jsbridge_documentInputWithText:(nonnull NSString *)inputText
                                 textColor:(nonnull NSString *)textColor;

    Swift

    optional func jsbridge_documentInput(withText inputText: String, textColor: String)
  • webView 上白板预览图更新时调用

    Declaration

    Objective-C

    - (void)jsbridge_updateWhiteboardImageData:(nonnull NSData *)imageData
                                    pageNumber:(NSUInteger)pageNumber;

    Swift

    optional func jsbridge_updateWhiteboardImageData(_ imageData: Data, pageNumber: UInt)
  • webView 上白板或者PPT缩放时调用

    Declaration

    Objective-C

    - (void)jsbridge_updateWhiteboardPPTZoomRatio:(NSInteger)zoomRatio;

    Swift

    optional func jsbridge_updateWhiteboardPPTZoomRatio(_ zoomRatio: Int)

    Parameters

    zoomRatio

    缩放的比例 (100 表示 100%,200 表示 200%)