海报图像在视频中不起作用,azure媒体播放器的1.5.0版本更新

Poster image is not working in videos, with version 1.5.0 update of azure media player

本文关键字:媒体播放器 版本更新 azure 图像 视频 不起作用 海报      更新时间:2023-09-26

我面临一个奇怪的问题,在将我的azure媒体播放器升级到1.5.0版本后,它没有占用海报图像,在1.3.0版本中,它运行得非常好。

这是我正在使用的代码。

<div class="marginBlock" id="mediaPlayer">
<h3>
    <asp:Label ID="lblTitle" runat="server"><%=Title.ToString()%></asp:Label>
</h3>
<video id="<%=mediaPlayerID %>" class="azuremediaplayer amp-default-skin amp-big-play-centered">
</video>
<p>
    <asp:Label ID="lblDescription" runat="server"><%=Description.ToString()%></asp:Label>
</p>

<script>
     $(document).ready(function () {
    var playOptions = {
        "nativeControlsForTouch": false,
        autoplay: false,
        controls: true,
        heuristicProfile: "High Quality",
        techOrder: ["azureHtml5JS", "html5", "flashSS", "silverlightSS"],
        logo: { enabled: false },
        poster: "<%=ImageSelector%>",
        width: '100%'
    };
    var azurePlayer = amp('<%=mediaPlayerID%>', playOptions);
    azurePlayer.src([{
        src: "<%=VideoURL%>",
        type: 'application/vnd.ms-sstr+xml'
    }]);
</script>

其中mediaplayerID、VideoURL、Title、Description和ImageSelector是来自后端的动态值,此代码与azure 1.3.0版本完美配合。

Azure Media Player 1.5.0有一些安全增强,其中之一是要求海报必须是绝对的URL。切换到使用绝对URL,它应该可以正常工作。我们将更新文档以反映这一变化。