user29578
user29578

Reputation: 689

HTML 5 video url not found on server, but working on local

I have deployed my first site on azure, it is a website with static content only.I have the video and html file in the same dir, which is wwwroot I have provided a video path in the index.html like this

<video loop muted width="1024" height="768" autoplay style="width: 101% !important;height: 100% !important;margin-top: -2%;margin-left: -1%;">
  <source src="intro.mp4" type="video/mp4">
</video>

And its playing properly on local as i checked, but once i deployed the content to azure, the other content load but the video does not loads, and it gives 404 as i checked in the network tab.

Also the request url in network console is www.mywebsite.com/intro.mp4 and it is 404 not found

I could not understand why is this happening , please help

Upvotes: 1

Views: 1251

Answers (1)

Jack Zeng
Jack Zeng

Reputation: 2267

Azure Web App does not support some of the media files for direct deployment. Currently, I know SVG images and videos will not work in Azure Web App if you have them deployed directly along with the web app. And, I can't find any documents talking about this kind of things.

Hence, my suggestion is using Azure Media Service. If you don't think Azure Media Service is necessary, you can just upload the video to Azure Storage as a blob and set the access policy of the container to be public. And then, you can refer the video with the corresponding URL.

For more information about Azure Storage and Blob, see Get started with Azure Blob storage using .NET

After some digging, I found out that if you are using asp.net, it's possible to config the web app so that it support video. Here is a similar question as yours. For web app other than asp.net, I have no idea how to config something like this.

Upvotes: 2

Related Questions