Regarding playing an audio on lock screen using Xamarin.forms
Closed this issue · 1 comments
Hi,
I am trying to play the audio even when the screen is locked. Since we made use of octane video player, Even if I submit a URL for audio, it is considering it as a video. Is there a way to do this?
I look forward to hearing from you.
Thank you in advance for your time and assistance.
Looks like you could do something in a custom renderer by extending your platform-specific project by extending the VideoPlayerRenderer
class and also extending the MediaPlayer
class that is inside the Octane namespace to set the wake mode as shown in the documentation below. Note that it is not necessarily a cross-platform thing to do just audio files. Although some native players will support playing just audio out of the box, not all of them may behave the same way.
Android:
https://developer.android.com/guide/topics/media/mediaplayer#kotlin