play_controller.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import 'package:fis_common/event/event_type.dart';
  2. import 'package:fis_measure/view/player/enums.dart';
  3. import 'package:fis_measure/view/player/events.dart';
  4. import 'package:fis_vid/data_channel/channel.dart';
  5. import 'package:vid/us/vid_us_image.dart';
  6. /// 播放器控制器
  7. abstract class IPlayerController {
  8. /// 状态
  9. VidPlayStatus get status;
  10. /// 当前帧的信息
  11. VidUsImage? get currentFrame;
  12. /// 是否已释放
  13. bool get disposed;
  14. /// 数据通道
  15. VidDataChannel get dataChannel;
  16. /// 链接
  17. String get url;
  18. bool get hasView;
  19. /// 加载资源
  20. Future<bool> load();
  21. /// 定位到指定帧
  22. Future<bool> locateTo(int index);
  23. /// 播放
  24. void play();
  25. /// 暂停
  26. void pause();
  27. /// 释放资源
  28. void dispose();
  29. /// 事件处理
  30. late final FEventHandler<VidPlayerEvent> eventHandler;
  31. /// 帧更新事件
  32. late final FEventHandler<VidUsImage> frameUpdated;
  33. /// 首帧事件处理
  34. late final FEventHandler<VidUsImage> firstFrameLoaded;
  35. /// 单帧加载状态变更事件
  36. late final FEventHandler<bool> frameLoadStateChanged;
  37. /// 发生错误事件
  38. late final FEventHandler<String?> errorOccured;
  39. }