I am trying to Play video from https site into my media element throwing the following exception.
An exception of type 'System.NullReferenceException' occurred in PresentationCore.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object.
This is my code in xmal
<MediaElement x:Name="mediaElement" LoadedBehavior="Manual" Stretch="Fill" Loaded="OnMediaElementLoaded" MediaOpened="MediaElement_OnMediaOpened" />
var uri = new Uri("https://f60b7719060a37f20253-4343910d3bf76239b8a83e4f56d17dc5.ssl.cf2.rackcdn.com/mov-2015-06-07-22-08-09-391574e61009867cfcb1a1641639b39e55c8a34c.mp4", UriKind.RelativeOrAbsolute);
mediaElement.Source = uri;
mediaElement.Play();//Getting exception here.
Any help please? I also tried the same using the some other http.
Commentators are trying to look smart by giving completely irrelevant information, but the MediaElement, in fact, can't play from HTTPS sources, a bug that has been acknowledged and not prioritized enough to get fixed.
You will either have to supply a non-HTTPS source url or save the content to file first and then load it (can be accomplished with a virtualized file system).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With