0
votes

I am facing the issue, that my App Blocks Background Music when using a MediaElement for Video usage. The bottom line is that I want to play a silent video and the user should still be able to listen to spotify and etc. in the background In iOS the procedure to allow Background Music is pretty straight forward. On Android I cannot manage to get it working.

I already tried different xamarin.forms libraries where i set the video to mute or the volume to zero. But nothing seemed to work. I tried for example octane, mediamanager and several other videoplayers.

For this reason, I would now like to try to implement it in the native Android code. But I haven't found anything about it in various forums.

Xamarin Forms Version is 4.8

1

1 Answers

0
votes

You could use a service to stream audio to play audio while your application is not visible or under the lock screen.

You could check the blog about this and download the source file from the Github. https://devblogs.microsoft.com/xamarin/background-audio-streaming-with-xamarin-android/

I test with the sample in the thread i done before to play the audio. libVLCsharp.forms can not play Android resource video file while iOS can

When i make the app which play music in the background, the music would play as well.