Youtube Video Player

  • 2
  • Problem
  • Updated 4 years ago
  • Not a Problem
Hi,

I gat three presentations consisting of Image Slider, Youtube Video Player, and some data, respectively. The Youtube video is set to autoplay. I need to start the video when the presentation consisting it is sceduled. Currently it starts as soon as the first presentation in the scedule starts.

Please Help.
Photo of Kanwal Preet Singh

Kanwal Preet Singh

  • 110 Points 100 badge 2x thumb
  • confused

Posted 4 years ago

  • 2
Photo of Ajit Pawar

Ajit Pawar

  • 60 Points
Me too facing same problem not able to find Answer for it 
Photo of William Oneal

William Oneal, Champion

  • 13,770 Points 10k badge 2x thumb
Are you using the YouTube widget in the store or are you using html code? Thanks
Photo of Kanwal Preet Singh

Kanwal Preet Singh

  • 110 Points 100 badge 2x thumb
I 'm using a html code.
Photo of William Oneal

William Oneal, Champion

  • 13,770 Points 10k badge 2x thumb
If I'm correct it won't work and i will leave rise to correct me if I'm wrong. The reason it won't work is that it needs to be a its own widget that controls the video functions. The html widget can't control the video functions so the autoplay just plays when it its loaded. You will need to make a widget that uses youtube javascript APIs to control how video is played.

Here is a short work flow example of a widget.  
A video widget consist of a ready event that is called when the video is ready to play. The viewer then decides whether or not to call the play function that is registered in the widget. If its ready to play it will play. If the schedule is not ready for it to play it won't. Once the video has played or finished, it calls the done event and the viewer will decide again on what to do next. 

There is a lot more to it but thats just the basics of what its doing. Anyway hope this explains some of it anyway. 
Photo of Kanwal Preet Singh

Kanwal Preet Singh

  • 110 Points 100 badge 2x thumb
But how can we know that a schedule is triggered and is ready to play, thus calling the play function from the javascript ?
Photo of William Oneal

William Oneal, Champion

  • 13,770 Points 10k badge 2x thumb
You need to look up the documentation of widgets. The ready event and done events that I'm referring to are actually functions that rise made. These events tell the viewer that its ready or done.
Also widgets have to contain registered play, pause, and stop functions. This is what the viewer uses to trigger the function when its need to play, pause and stop. So the ready event that rise made, tells the viewer the information of the widget and that its ready to play. Practically registering the widget to the viewer. The viewer then decides (depending on schedule) to play or not. Once the viewer gets to the widget on its turn it calls the play function that was registered to the viewer which in turn calls play for the youtube video. Anyway Its really hard to explain but thats just how i look at it. You really need to look at the documentation on widgets and look at examples to get whats going on. You won't be able to do this in the html widget. Also making widgets are not easy to do either. If you don't know much coding then it will be hard to learn. It took me a month just to do the youtube widget on the store, but that was my way of learning. Now i can make a widget in a weeks time but i had to dig into the code and learn. 
Photo of Kanwal Preet Singh

Kanwal Preet Singh

  • 110 Points 100 badge 2x thumb
Thank You William, will check back and reply.