fix: only play audio

related #558

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-29 10:05:37 +08:00
parent 385cffefb8
commit eea5257da2
2 changed files with 6 additions and 10 deletions

View File

@@ -1058,8 +1058,11 @@ class VideoDetailController extends GetxController
}) async {
await plPlayerController.setDataSource(
DataSource(
videoSource: video ?? videoUrl,
audioSource: audio ?? audioUrl,
videoSource: plPlayerController.onlyPlayAudio.value
? audio ?? audioUrl
: video ?? videoUrl,
audioSource:
plPlayerController.onlyPlayAudio.value ? '' : audio ?? audioUrl,
type: DataSourceType.network,
httpHeaders: {
'user-agent':

View File

@@ -322,14 +322,7 @@ class HeaderControlState extends State<HeaderControl> {
onTap: () {
widget.controller.onlyPlayAudio.value =
!widget.controller.onlyPlayAudio.value;
if (widget.controller.onlyPlayAudio.value) {
widget.videoDetailCtr.playerInit(
video: widget.videoDetailCtr.audioUrl ?? '',
audio: '',
);
} else {
widget.videoDetailCtr.playerInit();
}
},
text: " 听视频 ",
selectStatus: widget.controller.onlyPlayAudio.value,