suman
suman

Reputation: 158

How to remove loading icon from azure media player

I am developing a site where i need to integrate "Azure media player" and i have a functionality that to render the video from where the user is already paused.

My issue is that, while resume the video a loading icon is appears in the player and which is not disappears when user start playing the video.

I am attaching my html and js code for rendering the player.Due to some security reasons i am attaching only the demo code.

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

Note: I am encoding the asset in "H264 Smooth Streaming 720p" format.

Please give a solution for this issue. Thanks.

Upvotes: 2

Views: 1363

Answers (1)

Amit Rajput
Amit Rajput

Reputation: 483

the spinner is shown via css so you can just hide the spinner element based on the class <div tabindex="-1" class="vjs-loading-spinner"></div>

Upvotes: 1

Related Questions