繁体   English   中英

Azure媒体播放器无法正常工作

[英]Azure media player not working

我对天青世界是陌生的,下面是我要开始使用的代码,我无法获取控件并始终获取加载程序,您能帮助我确定我所缺少的内容吗。

 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Azure Media Player</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <!--*****START OF Azure Media Player Scripts*****--> <!--Note: DO NOT USE the "latest" folder in production. Replace "latest" with a version number like "1.0.0"--> <!--EX:<script src="//amp.azure.net/libs/amp/1.0.0/azuremediaplayer.min.js"></script>--> <!--Azure Media Player versions can be queried from //aka.ms/ampchangelog--> <link href="http://amp.azure.net/libs/amp/1.7.1/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet"> <script src="http://amp.azure.net/libs/amp/1.7.1/azuremediaplayer.min.js"></script> <script src="http://html5video.org/w/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=html5video&amp;*"></script> <!--*****END OF Azure Media Player Scripts*****--> </head> <body> <h1>Sample: Logging</h1> <video id="azuremediaplayer" controls class="azuremediaplayer amp-default-skin amp-big-play-centered" autoplay width="640" height="400" data-setup='{ "techOrder": ["flashSS"]}' tabindex="0"> <source src="http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest" type="application/vnd.ms-sstr+xml" /> </video> <footer> <br /> <p>  Microsoft Corporation 2016</p> </footer> </body> </html> 

视频标签中的data-setup =“'{” techOrder“:[” flashSS“]}'属性引起了问题,请设置为data-setup =”'',如源页面videotag_setsource.html所示。

Chrome问题是浏览器的局限性,我要复制我在一个较早的问题上发布的答案:

在本地运行代码时,Chrome会使用file://协议打开index.html。 由于Chrome的安全政策,不允许加载本地资源,这就是阻止播放的原因。 (如果您签出JavaScript控制台,我敢打赌您会看到类似的错误。)要解决此问题,您可以使用Visual Studio或WebMatrix之类的IDE,它们会自动为您设置本地网络服务器,以便您可以访问自己的http:// localhost:8000或您喜欢的任何端口的页面。 如果您不想使用VS或WebMatrix,也可以使用Python的Simple HTTP服务器

它在IE中不起作用的事实可能是两件事:

a)如果直接从示例页面复制源代码,则说明您使用的是未预先确定的URL(// url与http:// url ),该URL无法在IE中正确加载

b)Internet Explorer阻止了脚本或ActiveX控件,您可以通过更改Internet选项中的安全设置来允许被阻止的内容

让我知道这是否回答了您的问题,祝您编程愉快:)

暂无
暂无

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

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