Video ended listener when video is ended

Hello,

    I want to get an event triggered when an video file is ended its play.
    What I am trying to solve here is, If I get notified when an video file is ended I am thinking to append next video file to the browser to play the videos continuously one after the other.
    Sadly, I was unable to find much information on this component. Please, help me how can I do this?
    Here is some example of html5 and javascript code in the internet which is exactly what I needed in vaadin.
    <!DOCTYPE html>

Please, tell me how can I do this in vaadin.

Thanks.

Currently, the Video component doesn’t provide much of a Java API. You would need to create a custom Extension to get such an event out of it. The upside is that it’s implemented using a video element just like in your example, and thus adding such an event listener shouldn’t be that difficult. I guess it would be possible to do it even with just a JavaScript snippet (see https://vaadin.com/docs/v8/framework/advanced/advanced-javascript.html).

-Olli

Hi Olli,

Tried to add video element using custom extension, but we are unable to access the javascript component from UI and extension class.
Can you please share me the sample code for reference.

Regards,
Naresh B

Did you create a GWT [Extension]
(http://https://vaadin.com/docs/v8/framework/gwt/gwt-extension.html) or a [JavaScript Extension]
(http://https://vaadin.com/docs/v8/framework/gwt/gwt-javascript.html)?

Javascript Extension. but javascript is not populating after inspecting element in browser. Can you please help me to resolve this.

Is this your first JavaScript Extension? You could first take a look at some existing JavaScript extension (for example https://github.com/johannest/sticky ) to see if you’re doing things right.