WhitePlayerEvent.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // WhitePlayerEvent.h
  3. // WhiteSDK
  4. //
  5. // Created by yleaf on 2019/3/1.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #import "WhitePlayerState.h"
  9. #import "WhitePlayerConsts.h"
  10. #import "WhiteEvent.h"
  11. NS_ASSUME_NONNULL_BEGIN
  12. /** 白板回放的回调。 */
  13. @protocol WhitePlayerEventDelegate <NSObject>
  14. @optional
  15. /** 播放状态切换回调。
  16. @param phase 白板回放的播放状态。详见 [WhitePlayer](WhitePlayer)。
  17. */
  18. - (void)phaseChanged:(WhitePlayerPhase)phase;
  19. /** 首帧加载回调。 */
  20. - (void)loadFirstFrame;
  21. - (void)sliceChanged:(NSString *)slice;
  22. /** 回放状态发生变化的回调,只会包含实际发生改变的属性。
  23. @param modifyState 白板回放已经改变的的状态。详见 [WhitePlayerState](WhitePlayerState)。 */
  24. - (void)playerStateChanged:(WhitePlayerState *)modifyState;
  25. /** 出错导致回放暂停的回调。
  26. @param error 错误信息。 */
  27. - (void)stoppedWithError:(NSError *)error;
  28. /** 回放进度发生变化回调。
  29. @param time 回放进度(s)。*/
  30. - (void)scheduleTimeChanged:(NSTimeInterval)time;
  31. /** 添加帧出错的回调。
  32. @param error 错误信息。 */
  33. - (void)errorWhenAppendFrame:(NSError *)error;
  34. /** 渲染时出错的回调。
  35. @param error 错误信息。 */
  36. - (void)errorWhenRender:(NSError *)error;
  37. /**
  38. 白板自定义事件回调。
  39. @param event 白板自定义事件。详见 [WhiteEvent](WhiteEvent)。
  40. */
  41. - (void)fireMagixEvent:(WhiteEvent *)event;
  42. /**
  43. 高频自定义事件一次性回调。
  44. @param events 高频自定义事件。详见 [WhiteEvent](WhiteEvent)。
  45. */
  46. - (void)fireHighFrequencyEvent:(NSArray<WhiteEvent *>*)events;
  47. @end
  48. /**
  49. 白板回放的事件回调。
  50. */
  51. @interface WhitePlayerEvent : NSObject
  52. @property (nonatomic, weak, nullable) id<WhitePlayerEventDelegate> delegate;
  53. @end
  54. NS_ASSUME_NONNULL_END