If you don't find an answer, please click here to post your question.

Autoplay for V3 player

0 Kudos
Started ‎06-29-2014 by
Modified ‎06-29-2014 by

Autoplay for V3 player

by on ‎06-29-2014 05:28 AM (810 Views)

Symptoms

Autoplay is a functionality that allow a video to automatically start playback once the player is completely loaded.

 

Diagnosis

The Autoplay option being unchecked in Backlot is an expected behavior.

 

The Autoplay Checkbox in Backlot resets every time a video is selected. This is a default setting in Backlot.

If you check the Autoplay option for a certain video, and then move away from that video to select a new one, the Autoplay option for the first video will be unchecked.

However if you publish the embed code that contains the autoplay=1 value, your video will always start as soon as the webpage loads.

What Autoplay does is it adds the autoplay=1 value to the asset’s embed code.

 

Solution

  • You can use the parameter {autoplay:true} or
  • Or You can use the function videoPlayer.play();

If the autoplay option is not correctly defined the feature will not work. Please check the sample script below:

 

 

  1. Using {autoplay:true}

<!DOCTYPE html>

<html>

    <head>

            <!-- Load Ooyala Player -->

            <script type="text/javascript" src="http://player.ooyala.com/v3/78136cf793854a2ab842d23f9193b1de"></script>

    </head>

    <body>

            <!-- Player Placement -->

            <div id='playerwrapper' style='width:480px;height:360px;'></div>

            <script>

                    var videoPlayer = OO.Player.create('playerwrapper','<embedCode>',{autoplay:true});          </script>

  </body>

</html>

 

2. Using videoPlayer.play();    

<!DOCTYPE html>

<html>

    <head>

            <!-- Load Ooyala Player -->

            <script type="text/javascript" src="http://player.ooyala.com/v3/78136cf793854a2ab842d23f9193b1de"></script>

    </head>

    <body>

            <!-- Player Placement -->

            <div id='playerwrapper' style='width:480px;height:360px;'></div>

            <script>

                    var videoPlayer = OO.Player.create('playerwrapper','<embedCode>');

videoPlayer.play();              

            </script>            

    </body>

</html>