Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset Video.js plugin to initial state

Tags:

video.js

I'm using jquery ui tabs and video.js. I want to stop the video when I go to another tab and reset it when I come back to second tab.

like image 326
Dhaval Avatar asked Dec 05 '22 13:12

Dhaval


1 Answers

As of VideoJS v4.6 you can do the following to reset the player:

player.pause().currentTime(0).trigger('loadstart');

That loadstart is the key which shows the poster image and rebinds the first play event.

like image 176
Tamlyn Avatar answered Dec 22 '22 01:12

Tamlyn