问题描述:

I am using azure block blob and making sure to setup the content type to video/mp4 when uploading the video from my asp.net mvc application. I'm using videoJs framework to stream my video. The problem is, I cannot forward my video or use other controls such as going back in the video.

I have read various posts on how the server might not be willing to accept partial content requests (206) after initial request and in some other cases, your content type might not be set.

Here's an example video I'm trying to render:

https://qasimalishah.blob.core.windows.net/videoscontainer/2016-May-25-02-52-59_Realize%20Your%20Love%20to%20Family%20Qasim%20Ali%20Shah%20Urdu%20Hindi%20WaqasNasir.mp4

on this page page but cannot forward it for example.

This is how I'm rendering it on my view

<video id="really-cool-video" class="video-js vjs-default-skin" controls poster="@Model.MediaThumbnailUrl"

preload="auto" style="width: 100%; min-height: 380px; height: 100%;"

data-setup='{}'>

<source src="@Model.MediaUrl" type="video/mp4"/>

<p class="vjs-no-js">

To view this video please enable JavaScript, and consider upgrading to a web browser

that supports HTML5 video.

</p>

</video>

Where @MediaUrl is reference of azure public blob.

This might sound stupid in 2016 but what am i missing here?

网友答案:

I made it working by setting the storage version to latest. This is ridiculous as i thought Microsoft may have covered it in year 2016 but upon investigation i saw DefaultServiceVersion was null.

CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();
            var properties = cloudBlobClient.GetServiceProperties();
            if (String.IsNullOrEmpty(properties.DefaultServiceVersion))
            {
                //set the version of storage to latest
                properties.DefaultServiceVersion = "2015-04-05";
                cloudBlobClient.SetServiceProperties(properties);
            }

Thanks to this blog I was able to figure it out. May help someone in future.

Thanks

相关阅读:
Top