简体   繁体   English

Azure媒体服务-流视频(blob)到HTML5天蓝色媒体播放器

[英]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. 我的目标是让用户能够上传自己的视频,然后使用Azure Media Services和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.. 目前,我只测试了使用Azure门户手动上传的内容,并且有一些问题/疑虑。

HTML 的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. 1.使用上面的示例代码,我已将mp4视频上传到Azure媒体服务。 Everything works when using Chrome, but with Firefox I get this error message: 使用Chrome时一切正常,但是使用Firefox时,出现以下错误消息:

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? 在其他示例中,我看到人们使用特殊格式,例如ism / Manifest something(?)我错过了一步吗? What I did was publish the asset, retrieve the URL and paste it into my HTML5 player. 我所做的就是发布资产,检索URL并将其粘贴到我的HTML5播放器中。 My URL looks like a SAS URI.. 我的URL看起来像是SAS URI。

2. Do I need to create a Streaming Endpoint with atleast one unit? 2.是否需要创建至少一个单元的流式传输端点? I looked at the pricing and I think it was around $139/month. 我看了一下价格,我认为大约是$ 139 /月。 Yuck. uck Is that not just for live streaming? 这不只是用于直播吗?

3. Each uploaded video in Azure Media Services, (asset), gets it's own blob container. 3. Azure媒体服务(资产)中的每个上载视频都获得其自己的Blob容器。 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? 所有视频都不可能有相同的Blob容器吗? Is Azure Media Service really what I'm looking for? 我真的在寻找Azure媒体服务吗?

4. If I didn't use Azure Media Services, what would be my other options? 4.如果我不使用Azure媒体服务,我还有其他选择吗? Convert uploaded videos to MP4/WebM/Ogg and tripple my storage space? 将上传的视频转换为MP4 / WebM / Ogg,使存储空间增加三倍?

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. 上面要注意的一点是,您在源代码标签中提供的mime类型不正确,因为您使用的是渐进式MP4,而不是自适应流。 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. 您应该将“ application / vnd.ms-sstr + xml”设置为“ video / mp4” –为此,有一个示例http://amp.azure.net/libs/amp/latest/samples/videotag_progressiveVideo.html用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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