opt: 视频初始化

This commit is contained in:
guozhigq
2024-04-16 23:41:45 +08:00
parent a8cfe9fa1a
commit 038801a3b9

View File

@ -522,7 +522,22 @@ class PlPlayerController {
Duration seekTo = Duration.zero, Duration seekTo = Duration.zero,
Duration? duration, Duration? duration,
}) async { }) 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') { if (videoType.value == 'live') {
await setPlaybackSpeed(1.0); await setPlaybackSpeed(1.0);
} else { } else {
@ -532,20 +547,6 @@ class PlPlayerController {
await setPlaybackSpeed(1.0); 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 = []; List<StreamSubscription> subscriptions = [];
@ -716,11 +717,10 @@ class PlPlayerController {
await seekTo(Duration.zero); await seekTo(Duration.zero);
} }
await _videoPlayerController?.play(); await _videoPlayerController?.play();
playerStatus.status.value = PlayerStatus.playing;
await getCurrentVolume(); await getCurrentVolume();
await getCurrentBrightness(); await getCurrentBrightness();
playerStatus.status.value = PlayerStatus.playing;
// screenManager.setOverlays(false); // screenManager.setOverlays(false);
/// 临时fix _duration.value丢失 /// 临时fix _duration.value丢失