|
@@ -17,6 +17,7 @@ import 'package:fis_measure/interfaces/process/workspace/application.dart';
|
|
|
import 'package:fis_measure/interfaces/process/player/play_controller.dart';
|
|
|
import 'package:fis_measure/interfaces/process/config/style_config.dart';
|
|
|
import 'package:fis_common/event/event_type.dart';
|
|
|
+import 'package:fis_ui/index.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
import 'package:vid/us/vid_us_image.dart';
|
|
|
|
|
@@ -33,6 +34,7 @@ class MeasureController implements IMeasureController {
|
|
|
int _recursive = 0;
|
|
|
|
|
|
final bool enableLoopPlayback;
|
|
|
+ final ValueCallback<bool>? onLoopPlaybackEnableChanged;
|
|
|
|
|
|
late final MeasureImagesFetchFunc _imagesFetchFunc;
|
|
|
final measureData = Get.find<MeasureDataController>();
|
|
@@ -42,6 +44,7 @@ class MeasureController implements IMeasureController {
|
|
|
String code, {
|
|
|
required MeasureImagesFetchFunc imagesFetchFunc,
|
|
|
this.enableLoopPlayback = false,
|
|
|
+ this.onLoopPlaybackEnableChanged,
|
|
|
}) {
|
|
|
_examInfo = ExamInfo(code);
|
|
|
_imagesFetchFunc = imagesFetchFunc;
|
|
@@ -115,7 +118,9 @@ class MeasureController implements IMeasureController {
|
|
|
Get.delete<IPlayerController>();
|
|
|
_windowSetState(index);
|
|
|
_playerController = Get.put<IPlayerController>(
|
|
|
- VidPlayerController(url)..enableLoop = enableLoopPlayback,
|
|
|
+ VidPlayerController(url)
|
|
|
+ ..enableLoop = enableLoopPlayback
|
|
|
+ ..enableLoopChanged.addListener(_onEnableLoopPlaybackChanged),
|
|
|
);
|
|
|
playerController.firstFrameLoaded.addListener(_onFirstFrameLoaded);
|
|
|
playerController.frameUpdated.addListener(_onFrameUpdated);
|
|
@@ -123,6 +128,10 @@ class MeasureController implements IMeasureController {
|
|
|
_tryLoadPlayer();
|
|
|
}
|
|
|
|
|
|
+ void _onEnableLoopPlaybackChanged(Object _, bool e) {
|
|
|
+ onLoopPlaybackEnableChanged?.call(e);
|
|
|
+ }
|
|
|
+
|
|
|
void _tryLoadPlayer() async {
|
|
|
int tryCount = 0;
|
|
|
const limitCount = 5;
|