Video.js: Player Reset

Created on 1 Mar 2014  路  6Comments  路  Source: videojs/video.js

Currently with version 4 there's no way to reset a player to the initialized state. In version 3 you could simply do the following things and the player would appear as it does immediately post initialization:

  • show the big play button
  • hide the controls
  • show the poster image

However, version 4...breaks all of these things. Rather than get back to the functionality of version 3, there should be a new method, Player#reset, that allows a player to be reset to the original state without calling dispose() and instantiating a new one.

confirmed enhancement

Most helpful comment

Is there any progress on this after 3 years? How can I reset the player after the playlist ended?

All 6 comments

I agree with this, especially as I have implemented a custom playlist to show all the videos uploaded by a particular member of my site. Right now when a user clicks on a new video in the list, I have to dispose of the old player and make a brand new one if I want it to show in its original state. Just setting the src and poster images and showing the big play button is sloppy and does not change the control bar anyhow, something I found out when trying the fiddle I found on the internet to switch sources.

@mmcc @heff , according to the pull request, i write this snippet to reset player when playing ends:

  player.on('ended', function() {
    player.trigger('loadstart');
  });

It's still not working. Is my code right?

All i need is exactly what this issue mentioned at start:

  • show the big play button
  • hide the controls
  • show the poster image

Is there any progress on this after 3 years? How can I reset the player after the playlist ended?

I am also quite curious how to solve this?

Ah, I think it is partly solved in this issue: https://github.com/videojs/video.js/issues/2661#issuecomment-150600956

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uikoo9 picture uikoo9  路  4Comments

gfviegas picture gfviegas  路  3Comments

cshah123 picture cshah123  路  4Comments

onigetoc picture onigetoc  路  4Comments

kocoten1992 picture kocoten1992  路  4Comments