Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
761 stars 304 forks source link

Plugin Not Play on android sdk 12 #876

Closed MohammedMahmoud01 closed 1 year ago

MohammedMahmoud01 commented 1 year ago

I Have Created an xamarin forms app with xamarin media manger to play hls videos.

it just play perfectly on android blow 12 sdk but android sdk 12 and above not working at all. any one Know Solution

carlosanpardo commented 1 year ago

Hello. Try add the below code before start the player

CrossMediaManager.Current.Speed = 1F;

okains commented 1 year ago

That workaround is a lifesaver @carlosanpardo !

carlosanpardo commented 1 year ago

Any idea to launch the top bar with the data of the stream?

okains commented 1 year ago

Not sure what you mean, what is the ' top bar ' ?

ghost commented 1 year ago

Hello. Try add the below code before start the player

CrossMediaManager.Current.Speed = 1F;

Hi, yeah, that helps me, too, after hourse of debugging... maybe that would be worth mentioned on startpage/howto for android... Lots of greets, your doing a great job, thanks for all! Thies

janwiebe-jump commented 1 year ago

@carlosanpardo At what time do you call this line? CrossMediaManager.Current.Speed = 1F; When I called soon after CrossMediaManager.Current.Init() it tells me that the MediaSession hasn't been setup yet.

bitshftr commented 1 year ago

@carlosanpardo At what time do you call this line? CrossMediaManager.Current.Speed = 1F; When I called soon after CrossMediaManager.Current.Init() it tells me that the MediaSession hasn't been setup yet.

I'd like to know where to put this magic line of code also.

cklenk commented 1 year ago

I put it in my PCL class right before calling play. image This seems to be working. With Google requiring targeting sdk 31+ this should be addressed soon.

c0demak3r commented 1 year ago

Thank you @carlosanpardo your suggestion of adding CrossMediaManager.Current.Speed = 1F; solved it for my non-profit's app on Android 12 and 13!