Baseflow / XamarinMediaManager

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

XamarinMediaManager with Azure CDN URL in IOS App not working #815

Closed shubhamrautgs closed 3 years ago

shubhamrautgs commented 3 years ago

We're using XamarinMediaManager for streaming audio files in android and iOS Xamarin app. For that We're using "Plugin.MediaManager.Form" with 1.0.1 version. Currently we are getting content through Azure CDN which having Azure blob has an origin. In below method we are giving Azure CDN + SAS URI.

"await CrossMediaManager.Current.Play(MediaItem, Timespan)"

Above things worked perfectly fine in Android Device but in iOS not able to stream audio contents which coming from CDN+Sasuri. In info.plist we already added below things :

"NSAppTransportSecurity

NSAllowsArbitraryLoads " But still not able to stream audio contents in iOS app. iOS Version : 14.5 Plugin.MediaManager.Form Version : 1.0.1 and 1.0.8(Latest) So could you please let us know the root cause and solution for it. We have tested on both iOS simulator and IOS physical Device as well.
shubh23594 commented 3 years ago

This issue may happen in iOS device, if playing azure blob storage content through Azure CDN url. As iOS Device is playing content through AV player as compared with Android for EXO player when we are using plugin.mediamanager.form package name. So try to check azure blob content type if it's "application/octet-stream" then try to change to "audio/mpeg" or whatever actual content type for the respective audio content. After that only it will play in iOS device. Also for new content while uploading into blob then make sure to add correct content type. Note:- Azure blob content may not change through Azure portal need to do it programmatically only.

shubhamrautgs commented 3 years ago

It worked with above approach.