提交 d8f8b1cd authored 作者: kongdywang's avatar kongdywang

fix superPlayer slider click invalid issue

上级 369da8b2
......@@ -107,14 +107,27 @@ class VideoSliderState extends State<VideoSlider> {
}
},
onHorizontalDragCancel: () {
if (widget.canDrag!) {
if (widget.canDrag! && isDraging) {
isDraging = false;
widget.onDragEnd?.call(widget.controller.progress);
}
},
onTapDown: (TapDownDetails details) {
if (widget.canDrag!) {
onVerticalDragCancel: () {
if (widget.canDrag! && isDraging) {
isDraging = false;
widget.onDragEnd?.call(widget.controller.progress);
}
},
onTapUp: (TapUpDetails details) {
if (widget.canDrag! && !isDraging) {
_seekToPosition(details.globalPosition);
widget.onDragEnd?.call(widget.controller.progress);
}
},
onTapCancel: () {
if (widget.canDrag!) {
isDraging = false;
widget.onDragEnd?.call(widget.controller.progress);
}
},
child: Center(
......
......@@ -84,7 +84,8 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
}
});
// only register listen once
_pipSubscription = SuperPlayerPlugin.instance.onExtraEventBroadcast.listen((event) {
_pipSubscription =
SuperPlayerPlugin.instance.onExtraEventBroadcast.listen((event) {
int eventCode = event["event"];
if (eventCode == TXVodPlayEvent.EVENT_PIP_MODE_ALREADY_EXIT) {
// exit floatingMode
......@@ -126,7 +127,8 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
print('$eventCode');
}
});
_volumeSubscription = SuperPlayerPlugin.instance.onEventBroadcast.listen((event) {
_volumeSubscription =
SuperPlayerPlugin.instance.onEventBroadcast.listen((event) {
int eventCode = event["event"];
if (_isFloatingMode && _isPlaying) {
if (eventCode == TXVodPlayEvent.EVENT_AUDIO_FOCUS_PAUSE) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论