Open Neotrickster opened 4 years ago
In my app, GitTrends, I hit the same problem with MediaElement
when trying to stream my tutorial video from Azure Media Services:
(You can confirm that this streaming url works by copy/pasting it into the Safari browser on macOS)
Here are the custom renderers I created on iOS and Android for it to work.
They aren't feature-complete, but should help you get started with your Renderer implementation 👍
iOS Custom Renderer
Android Custom Renderer
Thanks a lot Brandon, I will study your solution (I´m a rookie) and will try to make it work in my project. But still not sure why something like this is out of radar as a media element. Hopefully will see it soon.
Hi @Neotrickster , I try to play your URL and I found error when MediaElement starts to play, it because your URL is HTTP not HTTPS.
You need to enable HTTP in your .plist file to request the HTTP https://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http The something for Android https://stackoverflow.com/questions/51902629/how-to-allow-all-network-connection-types-http-and-https-in-android-9-pie
Hi @jessejiang0214 , I will make some test, but even https links, like the one from @brminnick have some troubles but not with in other media players like:
https://github.com/Xamarians/MediaPlayer (from 3 years ago, still works) https://github.com/Baseflow/XamarinMediaManager
However I still appreciate this bug still been looking at now on the Community Toolkit so they can fix it as a integrated solution for all the lost souls like me. :)
If you add support for m3u8 it woul be nice if you can add support to add Headers to the native render functions.So the the player are able to use with azure media service with Authorization. Below is a sample.
Android in your protected virtual void UpdateSource(): Dictionary<string, string> RequestHeaders = new Dictionary<string, string>(); RequestHeaders.Add("Authorization", bearer); videoView.SetVideoURI(Android.Net.Uri.Parse(uri), RequestHeaders);
Ios in your protected virtual void UpdateSource(): NSMutableDictionary nativeHeaders = new NSMutableDictionary(); nativeHeaders.Add(new NSString("Authorization"), (NSString)bearer);
var nativeHeadersKey = (NSString)"AVURLAssetHTTPHeaderFieldsKey";
var options = new AVUrlAssetOptions(NSDictionary.FromObjectAndKey(
nativeHeaders,
nativeHeadersKey
));
asset = new AVUrlAsset(new NSUrl(uri), options);
I have same issue. trying to pay m3u8 URL but it not work with media element. any plan to support m3u8 URL in media element?
Thanks
Description
MediaElement Fails to play m3u8 link live video type
Steps to Reproduce
Expected Behavior
Play video
Actual Behavior
No play video
Basic Information
I already play the previous link in other media players like:
https://github.com/Xamarians/MediaPlayer (from 3 years ago, still works) https://github.com/Baseflow/XamarinMediaManager
Version with issue: Xamarin forms 4.7.0.1142
Last known good version: none
IDE: visual Studio 2019 16.6.5
Platform Target Frameworks:
Affected Devices: android/iOS