mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: only play audio
related #558 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1058,8 +1058,11 @@ class VideoDetailController extends GetxController
|
|||||||
}) async {
|
}) async {
|
||||||
await plPlayerController.setDataSource(
|
await plPlayerController.setDataSource(
|
||||||
DataSource(
|
DataSource(
|
||||||
videoSource: video ?? videoUrl,
|
videoSource: plPlayerController.onlyPlayAudio.value
|
||||||
audioSource: audio ?? audioUrl,
|
? audio ?? audioUrl
|
||||||
|
: video ?? videoUrl,
|
||||||
|
audioSource:
|
||||||
|
plPlayerController.onlyPlayAudio.value ? '' : audio ?? audioUrl,
|
||||||
type: DataSourceType.network,
|
type: DataSourceType.network,
|
||||||
httpHeaders: {
|
httpHeaders: {
|
||||||
'user-agent':
|
'user-agent':
|
||||||
|
|||||||
@@ -322,14 +322,7 @@ class HeaderControlState extends State<HeaderControl> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
widget.controller.onlyPlayAudio.value =
|
widget.controller.onlyPlayAudio.value =
|
||||||
!widget.controller.onlyPlayAudio.value;
|
!widget.controller.onlyPlayAudio.value;
|
||||||
if (widget.controller.onlyPlayAudio.value) {
|
widget.videoDetailCtr.playerInit();
|
||||||
widget.videoDetailCtr.playerInit(
|
|
||||||
video: widget.videoDetailCtr.audioUrl ?? '',
|
|
||||||
audio: '',
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
widget.videoDetailCtr.playerInit();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
text: " 听视频 ",
|
text: " 听视频 ",
|
||||||
selectStatus: widget.controller.onlyPlayAudio.value,
|
selectStatus: widget.controller.onlyPlayAudio.value,
|
||||||
|
|||||||
Reference in New Issue
Block a user