Merge branch 'fix' into alpha
This commit is contained in:
@ -167,7 +167,13 @@ class VideoDetailController extends GetxController
|
|||||||
playerInit();
|
playerInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future playerInit({video, audio, seekToTime, duration}) async {
|
Future playerInit({
|
||||||
|
video,
|
||||||
|
audio,
|
||||||
|
seekToTime,
|
||||||
|
duration,
|
||||||
|
bool autoplay = true,
|
||||||
|
}) async {
|
||||||
/// 设置/恢复 屏幕亮度
|
/// 设置/恢复 屏幕亮度
|
||||||
if (brightness != null) {
|
if (brightness != null) {
|
||||||
ScreenBrightness().setScreenBrightness(brightness!);
|
ScreenBrightness().setScreenBrightness(brightness!);
|
||||||
@ -199,6 +205,7 @@ class VideoDetailController extends GetxController
|
|||||||
cid: cid,
|
cid: cid,
|
||||||
enableHeart: enableHeart,
|
enableHeart: enableHeart,
|
||||||
isFirstTime: isFirstTime,
|
isFirstTime: isFirstTime,
|
||||||
|
autoplay: autoplay,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,6 +102,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
plPlayerController!.play();
|
plPlayerController!.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 未开启自动播放时触发播放
|
||||||
Future<void> handlePlay() async {
|
Future<void> handlePlay() async {
|
||||||
await videoDetailController.playerInit();
|
await videoDetailController.playerInit();
|
||||||
plPlayerController = videoDetailController.plPlayerController;
|
plPlayerController = videoDetailController.plPlayerController;
|
||||||
@ -111,8 +112,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
plPlayerController!.removeStatusLister(playerListener);
|
if (plPlayerController != null) {
|
||||||
plPlayerController!.dispose();
|
plPlayerController!.removeStatusLister(playerListener);
|
||||||
|
plPlayerController!.dispose();
|
||||||
|
}
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,9 +137,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
// 返回当前页面时
|
// 返回当前页面时
|
||||||
void didPopNext() async {
|
void didPopNext() async {
|
||||||
videoDetailController.isFirstTime = false;
|
videoDetailController.isFirstTime = false;
|
||||||
videoDetailController.playerInit();
|
bool autoplay =
|
||||||
|
setting.get(SettingBoxKey.autoPlayEnable, defaultValue: true);
|
||||||
|
videoDetailController.playerInit(autoplay: autoplay);
|
||||||
|
videoDetailController.autoPlay.value = true;
|
||||||
videoIntroController.isPaused = false;
|
videoIntroController.isPaused = false;
|
||||||
if (_extendNestCtr.position.pixels == 0) {
|
if (_extendNestCtr.position.pixels == 0 && autoplay) {
|
||||||
await Future.delayed(const Duration(milliseconds: 300));
|
await Future.delayed(const Duration(milliseconds: 300));
|
||||||
plPlayerController!.play();
|
plPlayerController!.play();
|
||||||
}
|
}
|
||||||
|
@ -756,6 +756,9 @@ class PlPlayerController {
|
|||||||
if (videoType.value == 'live') {
|
if (videoType.value == 'live') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (controlsLock.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
_doubleSpeedStatus.value = val;
|
_doubleSpeedStatus.value = val;
|
||||||
double currentSpeed = playbackSpeed;
|
double currentSpeed = playbackSpeed;
|
||||||
if (val) {
|
if (val) {
|
||||||
|
@ -239,35 +239,25 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
() => Align(
|
() => Align(
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: FractionalTranslation(
|
child: FractionalTranslation(
|
||||||
translation: const Offset(0.0, 1), // 上下偏移量(负数向上偏移)
|
translation: const Offset(0.0, 0.3), // 上下偏移量(负数向上偏移)
|
||||||
child: AnimatedOpacity(
|
child: AnimatedOpacity(
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
opacity: _.doubleSpeedStatus.value ? 1.0 : 0.0,
|
opacity: _.doubleSpeedStatus.value ? 1.0 : 0.0,
|
||||||
duration: const Duration(milliseconds: 150),
|
duration: const Duration(milliseconds: 150),
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0x88000000),
|
color: const Color(0x88000000),
|
||||||
borderRadius: BorderRadius.circular(64.0),
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
),
|
),
|
||||||
height: 34.0,
|
height: 32.0,
|
||||||
width: 86.0,
|
width: 70.0,
|
||||||
child: Row(
|
child: const Center(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
child: Text(
|
||||||
children: [
|
|
||||||
const SizedBox(width: 3),
|
|
||||||
Image.asset(
|
|
||||||
'assets/images/run-pokemon.gif',
|
|
||||||
height: 20,
|
|
||||||
),
|
|
||||||
const Text(
|
|
||||||
'倍速中',
|
'倍速中',
|
||||||
style: TextStyle(color: Colors.white, fontSize: 12),
|
style: TextStyle(color: Colors.white, fontSize: 13),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
)),
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user