opt: 视频初始化

This commit is contained in:
guozhigq
2024-04-16 23:41:45 +08:00
parent 29d4367316
commit eaa3e5c349

View File

@ -522,7 +522,22 @@ class PlPlayerController {
Duration seekTo = Duration.zero,
Duration? duration,
}) async {
// 设置倍速
getVideoFit();
// if (_looping) {
// await setLooping(_looping);
// }
/// 跳转播放
if (seekTo != Duration.zero) {
await this.seekTo(seekTo);
}
/// 自动播放
if (_autoPlay) {
await play(duration: duration);
}
/// 设置倍速
if (videoType.value == 'live') {
await setPlaybackSpeed(1.0);
} else {
@ -532,20 +547,6 @@ class PlPlayerController {
await setPlaybackSpeed(1.0);
}
}
getVideoFit();
// if (_looping) {
// await setLooping(_looping);
// }
// 跳转播放
if (seekTo != Duration.zero) {
await this.seekTo(seekTo);
}
// 自动播放
if (_autoPlay) {
await play(duration: duration);
}
}
List<StreamSubscription> subscriptions = [];
@ -716,11 +717,10 @@ class PlPlayerController {
await seekTo(Duration.zero);
}
await _videoPlayerController?.play();
playerStatus.status.value = PlayerStatus.playing;
await getCurrentVolume();
await getCurrentBrightness();
playerStatus.status.value = PlayerStatus.playing;
// screenManager.setOverlays(false);
/// 临时fix _duration.value丢失