如何从azure媒体播放器中删除加载图标

时间:2016-01-22 10:25:42

标签: azure azure-media-services

我正在开发一个网站,我需要整合" Azure媒体播放器"我有一个功能,可以从用户已暂停的位置呈现视频。

我的问题是,在恢复视频时,播放器中会出现一个加载图标,当用户开始播放视频时,该图标不会消失。

我附加了用于呈现播放器的html和js代码。由于某些安全原因,我只附加了演示代码。

<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>
<script>
    amp.options.flashSS.swf = "//amp.azure.net/libs/amp/latest/techs/StrobeMediaPlayback.2.0.swf"
    amp.options.flashSS.plugin = "//amp.azure.net/libs/amp/latest/techs/MSAdaptiveStreamingPlugin-osmf2.0.swf"
    amp.options.silverlightSS.xap = "//amp.azure.net/libs/amp/latest/techs/SmoothStreamingPlayer.xap"
</script>

<script type="text/javascript">
    $(document).ready(function () {
        displayVideo();
    });

    function displayVideo() {
        var myOptions = {
            techOrder: ["Flash","azureHtml5JS", "flashSS", "silverlightSS", "html5"],
            nativeControlsForTouch: false,
            autoplay: false,
            controls: true,
            width: "100%",
            height: "100%",
            poster: "",
            logo: { "enabled": false },
            hotKeys: { "enableFullscreen": true, "enableNumbers": true, "enableJogStyle": true, "enableMute": true, "seekStep": 3, "volumeStep": 5 },
        };
        var myPlayer = amp("moduleVideoPlayer", myOptions, function () {
        });

        myPlayer.addEventListener('ready', function () {
            console.log('ready!');
        });


        myPlayer.addEventListener("durationchange", function () {
            var duration = myPlayer.duration();
            if (duration > 0) {
                myPlayer.currentTime(8);
            }
        });


        myPlayer.addEventListener('ended', function () {
            console.log('Finished!');
        });

        myPlayer.addEventListener('pause', function () {
            //alert(this.currentTime());
            console.log('paused!');
        });

        myPlayer.src([
          {
              src: "//amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest",
              type: "application/vnd.ms-sstr+xml",
              streamingFormats: ['SMOOTH']
              //streamingFormats: ["SMOOTH", "DASH", "HLS-V3", "HLS-V4"]
          },
        ]);
    }
</script>

<div style="width:500px;height:300px;margin-top:50px;">
    <video id="moduleVideoPlayer" class="azuremediaplayer amp-default-skin amp-big-play-centered"> </video>
</div>

注意: 我正在以&#34; H264 Smooth Streaming 720p&#34; 格式对资源进行编码。

请为此问题提供解决方案。 感谢。

1 个答案:

答案 0 :(得分:1)

微调器通过css显示,因此您可以根据类<div tabindex="-1" class="vjs-loading-spinner"></div>隐藏微调器元素