YouTube control: PlayHead Position

I’m fairly new at Xojo for web. While experimenting with some web-apps I have a questing regarding the YouTube control on web pages.
Is there a way to get the current playhead position of a video? If there is, I know I can really use it.

A workaround could be to just figure out the videostream address, and connect with it with the MoviePlayer control. My guess is that there are more properties of a video to read in that control.

Has anybody figured this out yet? :slight_smile:

You need to study https://developers.google.com/youtube/iframe_api_reference

I believe player.getCurrentTime() is what you want.

Now this will require you look at the Xojo implementation with a browser developers tools, and use JavaScript to access that property.

[quote=253740:@Michel Bujardet]You need to study https://developers.google.com/youtube/iframe_api_reference

I believe player.getCurrentTime() is what you want.

Now this will require you look at the Xojo implementation with a browser developers tools, and use JavaScript to access that property.[/quote]

Thanks Michel!
I kinda figured out what property I need to look for. But so far, I can’t get the value back into Xojo.

[quote=253741:@Edwin van den Akker]Thanks Michel!
I kinda figured out what property I need to look for. But so far, I can’t get the value back into Xojo.[/quote]

The page I linked to has a sample code that can be used instead of the Xojo control in a WebSDK custom class or in a WebHTMLViewer. When you run it, it shows a very interesting webinar about precisely how to implement position with it :
https://youtu.be/M7lc1UVf-VE

A quick test shows that the getter getCurrentTime() and setter seek have no effect on the very sample code posted on the page.

getCurrentTime keeps returning zero, and seek simply does nothing.

Sorry, that looked pretty straightforward.

[quote=253743:@Michel Bujardet]The page I linked to has a sample code that can be used instead of the Xojo control in a WebSDK custom class or in a WebHTMLViewer. When you run it, it shows a very interesting webinar about precisely how to implement position with it :
https://youtu.be/M7lc1UVf-VE[/quote]

I am currently working on another project. I will look at it later.
The webinar sounds interesting. I need a little break. So, I’m gonna go in Couch-Potato mode :wink: