Merge branch 'feature-media_kit' into alpha
This commit is contained in:
@ -185,6 +185,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
videoIntroController.isPaused = false;
|
videoIntroController.isPaused = false;
|
||||||
if (_extendNestCtr.position.pixels == 0 && autoplay) {
|
if (_extendNestCtr.position.pixels == 0 && autoplay) {
|
||||||
await Future.delayed(const Duration(milliseconds: 300));
|
await Future.delayed(const Duration(milliseconds: 300));
|
||||||
|
plPlayerController!.seekTo(videoDetailController.defaultST);
|
||||||
plPlayerController?.play();
|
plPlayerController?.play();
|
||||||
}
|
}
|
||||||
plPlayerController?.addStatusLister(playerListener);
|
plPlayerController?.addStatusLister(playerListener);
|
||||||
|
|||||||
@ -678,9 +678,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
),
|
),
|
||||||
child: Slider(
|
child: Slider(
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 6,
|
max: 8,
|
||||||
value: danmakuSpeedVal,
|
value: danmakuSpeedVal,
|
||||||
divisions: 10,
|
divisions: 14,
|
||||||
label: danmakuSpeedVal.toString(),
|
label: danmakuSpeedVal.toString(),
|
||||||
onChanged: (double val) {
|
onChanged: (double val) {
|
||||||
danmakuSpeedVal = val;
|
danmakuSpeedVal = val;
|
||||||
|
|||||||
@ -428,6 +428,8 @@ class PlPlayerController {
|
|||||||
// 设置倍速
|
// 设置倍速
|
||||||
if (_playbackSpeed.value != 1.0) {
|
if (_playbackSpeed.value != 1.0) {
|
||||||
await setPlaybackSpeed(_playbackSpeed.value);
|
await setPlaybackSpeed(_playbackSpeed.value);
|
||||||
|
} else {
|
||||||
|
await setPlaybackSpeed(1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (_looping) {
|
// if (_looping) {
|
||||||
|
|||||||
@ -478,19 +478,13 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final tapPosition = details.localPosition.dx;
|
final tapPosition = details.localPosition.dx;
|
||||||
int curSliderPosition = _.sliderPosition.value.inSeconds;
|
int curSliderPosition = _.sliderPosition.value.inMilliseconds;
|
||||||
late int result;
|
double scale = 60000 / MediaQuery.of(context).size.width;
|
||||||
if (tapPosition - _initTapPositoin > 0) {
|
Duration pos = Duration(
|
||||||
// 快进
|
milliseconds:
|
||||||
/// TODO 优化屏幕越小效果越明显
|
curSliderPosition + (details.delta.dx * scale).round());
|
||||||
result = (curSliderPosition + 1)
|
Duration result = pos.clamp(Duration.zero, _.duration.value);
|
||||||
.clamp(0, _.duration.value.inSeconds);
|
_.onUodatedSliderProgress(result);
|
||||||
} else {
|
|
||||||
// 快退
|
|
||||||
result = (curSliderPosition - 1)
|
|
||||||
.clamp(0, _.duration.value.inSeconds);
|
|
||||||
}
|
|
||||||
_.onUodatedSliderProgress(Duration(seconds: result));
|
|
||||||
_.onChangedSliderStart();
|
_.onChangedSliderStart();
|
||||||
_initTapPositoin = tapPosition;
|
_initTapPositoin = tapPosition;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user