Skip to content
Advertisement

How can I play the next video when my current video is finish using java script?

Here i got the success to play the video according to current time but when unable to retrieve the next video after the finishing of current video according to current time. Here startat attribue in source tag is the starting time of that video.

HTML

JavaScript

Java Script

JavaScript

Advertisement

Answer

Below is the code to achieve this.

loadVideo() reads the startat property of the the source tag.

These sources are maintained inside a hidden div. Once a video ends next one is loaded and written to the video tag.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement