If you don't find an answer, please click here to post your question.
Reply
Occasional Advisor
Posts: 9
Registered: ‎08-20-2017

Thumbnail

what should i script if i want to add a thumbnail from a second video,when clicking the thumbnail the second video must start playing on the existing player

Ooyalan
Posts: 4
Registered: ‎01-22-2017

Re: Thumbnail

Hi there,

 

The script should contain a new instance of the Ooyala containing the new embed code (Content ID), a click event and Ooyala Destroy() function. 

 

Example = 

<div id='ooyalaplayer' style='width:640px;height:360px'></div>

<div id="player2"></div>

<script>

OO.ready(function() { 

var player1 = null;

player1 = OO.Player.create('ooyalaplayer', 'CONTENTID_ONE', {autoplay:true}; // ooyalaplayer is the DIV ID of the player container

var pla2 = document.getElementById("player2"); //player2 being the <div ID> of the "thumbnail".
pla2.onclick = pla22; //when the thumbnail is clicked, call pla22() function

 });

function pla22() {
player1.destroy(); //destroying the existing player
player1 = OO.Player.create('ooyalaplayer', 'CONTENTID_TWO', {autoplay:true);
}

</script>

 

Hope this helps :)

 

Thanks,

Rohit