繁体   English   中英

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

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

我被要求将视频播放器添加到公司的Web应用程序中,以播放来自Azure Media Services的流视频。

通过使用Azure门户和Azure API,我已经能够加载和发布我们要呈现的视频文件。

我在这里这里发现了示例, 这些示例显示了在HTML页面中设置Azure Media Player的简单程度。

我将相关的内容添加到我们的Web应用程序中,并且播放器出现了,但是没有任何播放。 在Chrome中,播放器为空白。 在IE11中,播放器显示“无效源”。 在Edge中,播放器显示“不支持这种类型的视频文件”。

我将视频的URL插入了Azure Media Player演示中 ,并且效果很好。

我使用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>

<!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>

我得到的结果与在Web应用程序中得到的结果相同,即为空白或“无效来源”或“不支持这种类型的视频文件”。

我认为我缺少基本的东西,但是呢?

您是使用Web服务器托管您编写的代码还是只是在本地运行它? 如果您在本地运行它,那么在没有某种形式的Web服务器的情况下,回放无法在Chrome或Edge中进行。 请参阅此答案以获取更多详细信息: 如果脚本文件保存在本地,则Azure媒体播放器(AMP)在chrome上不起作用

暂无
暂无

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

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