Streaming video from secure azure blob in WPF

Does anyone know a way to stream .mp4 video from secure azure blob (via https) to a WPF application.

I generate uri as follows ...

public Uri GetSecureUriForBlob(CloudBlobContainer container, string blobName) { var blockBlob = container.GetBlockBlobReference(blobName); var beforeOffset = new DateTimeOffset(DateTime.UtcNow.AddMinutes(-5)); var afterOffset = new DateTimeOffset(DateTime.UtcNow.AddHours(1)); var builder = new UriBuilder(blockBlob.Uri) { Query = blockBlob.GetSharedAccessSignature( new SharedAccessBlobPolicy { Permissions = SharedAccessBlobPermissions.Read, SharedAccessStartTime = beforeOffset, SharedAccessExpiryTime = afterOffset }).TrimStart('?') }; return builder.Uri; } 

I checked that the service version is installed at least "2013-08-15" and that the blob element has the correct set of content types.

I know that the uri format is correct, because I can insert it into the browser, and also use it in the application for storing Windows 8, and the video streams are correct.

However, when I assign the same uri as the source for WPF MediaElement, I get a NullReferenceException in the inner work of MediaPlayer.Open ().

+7
wpf azure azure-storage-blobs
source share
1 answer

There seems to be a known issue with WPF MediaElement when playing with HTTPS . There is no problem playing through simple HTTP (without "S").

This is not related to Microsoft Azure, or related to Blob. This is a pure WPF issue that does not appear to be fixed soon if it is fixed at all.

For HTTPS streams, you can use either Silverlight applications or Windows 8 Modern - both support HTTPS streams without any problems.

Perhaps you can find a third-party WPF control that supports media playback via HTTPS.

UPDATE

Using the WPF VideoLan.NET Controls , I was able to play HTTPS libraries. So far, the only WPF controls that successfully play HTTPS libraries. This requires the correct installation of the VideoLAN VLC Player for Windows. I used a portable (ZIP package) and it works great. The documentation for VideoLan.NET is a bit messy, but as a result, you can safely play HTTPS streams / progressive downloads in WPF.

+2
source share

All Articles