简体   繁体   English

我的Azure媒体服务视频无法在Azure媒体播放器中播放

[英]My Azure Media Services Videos won't play in Azure Media Player

I'm being asked to add a video player to my company's web app that plays streaming video from Azure Media Services. 我被要求将视频播放器添加到公司的Web应用程序中,以播放来自Azure Media Services的流视频。

Using both the Azure portal and the Azure API I have been able to load and publish the video files we want to present. 通过使用Azure门户和Azure API,我已经能够加载和发布我们要呈现的视频文件。

I found samples here and here showing how simple it is to set up the Azure Media Player in your HTML page. 我在这里这里发现了示例, 这些示例显示了在HTML页面中设置Azure Media Player的简单程度。

I added the relevant bits to our web app and the player shows up, but nothing plays. 我将相关的内容添加到我们的Web应用程序中,并且播放器出现了,但是没有任何播放。 In Chrome, the player is blank. 在Chrome中,播放器为空白。 In IE11, the player shows "Invalid Source". 在IE11中,播放器显示“无效源”。 In Edge, the player shows "This type of video file isn't supported.". 在Edge中,播放器显示“不支持这种类型的视频文件”。

I plugged the URL's of our videos in the Azure Media Player Demo and they worked fine. 我将视频的URL插入了Azure Media Player演示中 ,并且效果很好。

I created stripped down HTML files with just the basics for the video player using Azure's samples and their own promo video. 我使用Azure的示例和他们自己的促销视频,仅使用视频播放器的基础知识创建了经过精简的HTML文件。

<!DOCTYPE html>
<html>
    <head>
        <title>Azure Media Player Test</title>
        <link href="//amp.azure.net/libs/amp/1.3.0/skins/amp-default/azuremediaplayer.min.css" rel="stylesheet">
        <script src= "//amp.azure.net/libs/amp/1.3.0/azuremediaplayer.min.js"></script>
    </head>
    <body>
        This sample came from <a href="https://azure.microsoft.com/en-us/blog/announcing-azure-media-player/">https://azure.microsoft.com/en-us/blog/announcing-azure-media-player/</a>
        <br />
        <br />
        <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="http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest" 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>
        </video>
    </body>
</html>

and

<!DOCTYPE html>
<html>
    <head>
        <title>Azure Media Player Test</title>
        <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>
    </head>
    <body>
        This sample came from <a href="http://amp.azure.net/libs/amp/latest/docs/">http://amp.azure.net/libs/amp/latest/docs/</a>
        <br />
        <br />
        <video id="vid1" class="azuremediaplayer amp-default-skin" autoplay controls width="640" height="400" poster="poster.jpg" data-setup='{"nativeControlsForTouch": false}'>
            <source src="http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest" 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>
        </video>
    </body>
</html>

I get the same results with these as I did in our web app, ie blank or "Invalid Source" or "This type of video file isn't supported." 我得到的结果与在Web应用程序中得到的结果相同,即为空白或“无效来源”或“不支持这种类型的视频文件”。

I assume I'm missing something basic, but what? 我认为我缺少基本的东西,但是呢?

Are you using a web server to host the code you wrote or just running it locally? 您是使用Web服务器托管您编写的代码还是只是在本地运行它? If you're running it locally, playback won't work in chrome or edge without some form of a webserver. 如果您在本地运行它,那么在没有某种形式的Web服务器的情况下,回放无法在Chrome或Edge中进行。 See this answer for more details: Azure media player(AMP) not working on chrome if script file is saved locally 请参阅此答案以获取更多详细信息: 如果脚本文件保存在本地,则Azure媒体播放器(AMP)在chrome上不起作用

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

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