mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -1034,7 +1034,7 @@ class PlPlayerController {
|
|||||||
Future<void> setPlaybackSpeed(double speed) async {
|
Future<void> setPlaybackSpeed(double speed) async {
|
||||||
lastPlaybackSpeed = playbackSpeed;
|
lastPlaybackSpeed = playbackSpeed;
|
||||||
|
|
||||||
if (speed == playbackSpeed) {
|
if (speed == _videoPlayerController?.state.rate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -596,33 +596,35 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
),
|
),
|
||||||
|
|
||||||
/// 播放速度
|
/// 播放速度
|
||||||
BottomControlType.speed: Container(
|
BottomControlType.speed: Obx(
|
||||||
height: 30,
|
() => Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 10),
|
height: 30,
|
||||||
alignment: Alignment.center,
|
margin: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
child: PopupMenuButton<double>(
|
alignment: Alignment.center,
|
||||||
initialValue: plPlayerController.playbackSpeed,
|
child: PopupMenuButton<double>(
|
||||||
color: Colors.black.withOpacity(0.8),
|
initialValue: plPlayerController.playbackSpeed,
|
||||||
itemBuilder: (BuildContext context) {
|
color: Colors.black.withOpacity(0.8),
|
||||||
return plPlayerController.speedList.map((double speed) {
|
itemBuilder: (BuildContext context) {
|
||||||
return PopupMenuItem<double>(
|
return plPlayerController.speedList.map((double speed) {
|
||||||
height: 35,
|
return PopupMenuItem<double>(
|
||||||
padding: const EdgeInsets.only(left: 30),
|
height: 35,
|
||||||
value: speed,
|
padding: const EdgeInsets.only(left: 30),
|
||||||
onTap: () {
|
value: speed,
|
||||||
plPlayerController.setPlaybackSpeed(speed);
|
onTap: () {
|
||||||
},
|
plPlayerController.setPlaybackSpeed(speed);
|
||||||
child: Text(
|
},
|
||||||
"${speed}X",
|
child: Text(
|
||||||
style: const TextStyle(color: Colors.white, fontSize: 13),
|
"${speed}X",
|
||||||
semanticsLabel: "$speed倍速",
|
style: const TextStyle(color: Colors.white, fontSize: 13),
|
||||||
),
|
semanticsLabel: "$speed倍速",
|
||||||
);
|
),
|
||||||
}).toList();
|
);
|
||||||
},
|
}).toList();
|
||||||
child: Text("${plPlayerController.playbackSpeed}X",
|
},
|
||||||
style: const TextStyle(color: Colors.white, fontSize: 13),
|
child: Text("${plPlayerController.playbackSpeed}X",
|
||||||
semanticsLabel: "${plPlayerController.playbackSpeed}倍速"),
|
style: const TextStyle(color: Colors.white, fontSize: 13),
|
||||||
|
semanticsLabel: "${plPlayerController.playbackSpeed}倍速"),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user