[YoutubePlayer] play multiple videos one after another and "only pause" ability

[YoutubePlayer] play multiple videos one after another and "only pause" ability

Forge Component
Published on 2015-04-07 by Ricardo Silva
6 votes
Published on 2015-04-07 by Ricardo Silva

I really like the youtube player, just had 2 questions.

A) is there a way if I want to play one video after another, that I can use the on-notify from the player to load a new video idea and then restart the video player?  I tried ajax refresh but it didn't seem to work and I have it in a popup so calling it to reload itself causes slider bars to appear (OutSystems doesn't seem to like calling a popup from a popup) and if I close the popup via a screen action then have the origional page call it again, that causes a blink of the popup being there which is not desired.

B) is there a way to set it such that the user can only pause and play the video vs being able to set the play location within the video?
Hello Jason,

Thank you for using my component and helping improve it :)

A) I've just updated the component with version 1.6.0 which should allow you to use Ajax Refresh on the player and everything seems to be working. Check the example usage (cycling 2 videos) in the HomePage of the component.

B) In version 1.7.0 this is possible. You have a new Controls input to the widget which lets you control whether or not the player has controls. When it has controls the user can do anything. When it doesn't, the only thing he can do is play / pause.

The reason why there are two versions here is because I was convinced B) wasn't possible until I explored the Youtube Javascript API a bit more and realized the controls option probably fit your use-case.

I also noted that the API I'm using is deprecated, so I'll need to update the component to use the new iframe API as soon as I can spare the extra time.
Also, for A) I could use the "playlist" feature of the API. I'll try to explore that in the future.

Thank you for the reply and the upgrades!  I do like the component and its very useful.  FYI, what we are doing as part of our overall project is making a Learning Management System (LMS) within OutSystems for our training modules.  Basically someone watches a video and then after the video automatically questions come up that they have to answer (multiple choice).  As long as that functionality is working you can have as many video/test combinations one after another.  So the playlist is not so useful as the ability to just change the video link on youtube and then ajax refresh to make it play.


Just tested, and this is exactly what I needed to have happen!  Thank you for these modifications.  My only suggestion for the next version is that with controls set to false the controls are gone but there is still a bar that appears on the top when you mouse over the video.  I would say take that top control bar off as well if controls = false.  Thank you again for these mods and for making the component publicly available.