fvp icon indicating copy to clipboard operation
fvp copied to clipboard

`VideoController.mixWithOthers` has no effect

Open AlexV525 opened this issue 1 year ago • 15 comments

Describe the bug

When using fvp on iOS, setting mixWithOthers in the VideoPlayerController will still cause the background playback to stop when calling the VideoPlayerController.initialize or VideoPlayerController.play.

Also, playing background audio when the video is playing will cause the video to run into a very slow framerate.

Logs mdk.log

AlexV525 avatar Oct 25 '24 09:10 AlexV525

try master branch

wang-bin avatar Oct 28 '24 16:10 wang-bin

Error (Xcode): ../../../../.pub-cache/git/fvp-8281ae0ab6057e6665d181fb7ed1ebd99da06f71/lib/src/video_player_mdk.dart:344:26: Error: The method 'setMixWithOthers' isn't defined for the class 'FvpPlatform'.

AlexV525 avatar Oct 29 '24 02:10 AlexV525

https://github.com/wang-bin/fvp/actions/runs/11557830755/job/32168767278

AlexV525 avatar Oct 29 '24 02:10 AlexV525

How about Android and other platforms (I know that macOS has nothing to do with the playback mode support)?

AlexV525 avatar Oct 29 '24 02:10 AlexV525

Error (Xcode): ../../../../.pub-cache/git/fvp-8281ae0ab6057e6665d181fb7ed1ebd99da06f71/lib/src/video_player_mdk.dart:344:26: Error: The method 'setMixWithOthers' isn't defined for the class 'FvpPlatform'.

i forgot to commit some files. try master branch again

wang-bin avatar Oct 29 '24 04:10 wang-bin

i forgot to commit some files. try master branch again

The code is working.

AlexV525 avatar Oct 29 '24 04:10 AlexV525

How about Android and other platforms (I know that macOS has nothing to do with the playback mode support)?

android should be similar. i guess desktop platforms have no such feature

wang-bin avatar Oct 29 '24 04:10 wang-bin

So I guess the remain thing is to implement this with the Android platform.

AlexV525 avatar Oct 29 '24 04:10 AlexV525

So I guess the remain thing is to implement this with the Android platform.

yes, but i don't have enough time recently

wang-bin avatar Oct 29 '24 04:10 wang-bin

Is the repo open for pull requests? If so I can try to add the functionality.

AlexV525 avatar Oct 29 '24 04:10 AlexV525

yes

wang-bin avatar Oct 29 '24 04:10 wang-bin

I took some investigation with Android. video_player deals with the audio session within the ExoPlayer, but we don't seem to have such an interface to control that behavior. The video's audio track is always mixed with other audio on Android, so we should implement the contrary. I don't think there is anything I can do further.

AlexV525 avatar Oct 31 '24 01:10 AlexV525

same as #72, audio_session package support this feature

wang-bin avatar Nov 01 '24 03:11 wang-bin

same as #72, audio_session package support this feature

Absolutely! But it would be better to perform the same behavior as the video_package since the library declares itself as a plugin set.

AlexV525 avatar Nov 01 '24 03:11 AlexV525

yes, so that issue is still open. we can use audio_session's implementation

wang-bin avatar Nov 01 '24 03:11 wang-bin