简体   繁体   中英

Azure Media Services - Stream video (blob) to HTML5 azure media player

My goal is to let users be able to upload their own videos and then play them back using Azure Media Services and Azure Media Player. I want the video playback to be supported in all modern browsers.

Currently I have only tested uploading manually using the Azure portal and I have some questions/concerns..

HTML

<link href="//amp.azure.net/libs/amp/latest/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
<script src="//amp.azure.net/libs/amp/latest/azuremediaplayer.min.js"></script>

<video id="azuremediaplayer" class="azuremediaplayer amp-default-skin amp-big-play-centered" controls autoplay width="640" height="400" poster="" data-setup='{"nativeControlsForTouch": false}' tabindex="0">
<source src="https://MYSTORAGE.blob.core.windows.net/asset-ad8677da-8869-4eb9-a93b-5805fc7e8122/bigbuck.mp4?sv=2012-02-12&sr=c&si=c7011ff9-be73-4ad4-a55a-fd05099ffa50&sig=WNnjsHGJB8PN8ZbmCGdBM34MEQ1oXsSxMXaPAqF1yK0I%3D&st=2016-05-11T14%3A32%3A19Z&se=2116-04-17T14%3A32%3A19Z" type="application/vnd.ms-sstr+xml" />
<p class="amp-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video</p>

1. With the example code above I have uploaded a mp4 video to Azure Media Services. Everything works when using Chrome, but with Firefox I get this error message:

A network error made downloading the video stopped. Check your network connection and try again later.

My guess here is that I need to do some additional coding on the video? If so, what encodings do I need for my spec?

In other examples I've seen people use special formats, ism/Manifest something(?) Did I miss a step? What I did was publish the asset, retrieve the URL and paste it into my HTML5 player. My URL looks like a SAS URI..

2. Do I need to create a Streaming Endpoint with atleast one unit? I looked at the pricing and I think it was around $139/month. Yuck. Is that not just for live streaming?

3. Each uploaded video in Azure Media Services, (asset), gets it's own blob container. Now imagine if I have over a thousand of users and even more videos. Is this really how it's done? Is it not possible to have the same blob container for all videos? Is Azure Media Service really what I'm looking for?

4. If I didn't use Azure Media Services, what would be my other options? Convert uploaded videos to MP4/WebM/Ogg and tripple my storage space?

Quick thing to note above is that the mime type you have provided in the source tag is incorrect because you are using progressive MP4 and are not using adaptive streaming. You have "application/vnd.ms-sstr+xml" when it should be "video/mp4" – there is a sample http://amp.azure.net/libs/amp/latest/samples/videotag_progressiveVideo.html for this use case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM