wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
197 stars 31 forks source link

`VideoController.mixWithOthers` has no effect #172

Open AlexV525 opened 1 month ago

AlexV525 commented 1 month ago

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

wang-bin commented 3 weeks ago

try master branch

AlexV525 commented 3 weeks ago
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 commented 3 weeks ago

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

AlexV525 commented 3 weeks ago

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

wang-bin commented 3 weeks ago
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

AlexV525 commented 3 weeks ago

i forgot to commit some files. try master branch again

The code is working.

wang-bin commented 3 weeks ago

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

AlexV525 commented 3 weeks ago

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

wang-bin commented 3 weeks ago

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

yes, but i don't have enough time recently

AlexV525 commented 3 weeks ago

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

wang-bin commented 3 weeks ago

yes

AlexV525 commented 3 weeks ago

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.

wang-bin commented 3 weeks ago

same as #72, audio_session package support this feature

AlexV525 commented 3 weeks ago

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.

wang-bin commented 3 weeks ago

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