0

video-js has the default toggle-pause-play button, which works fine. for a specific use, i want to a button next to it that pauses, rewinds, show the poster image and the big play button. in other words, a stop button :-)

it should be a simple plugin, but i cant find the right examples .. it would probably start with

videojs.plugin('stopbutton', function(options) {

    var StopButton = videojs.Button.extend({ ....

Can anyone point me to the simplest example of adding a button ?

Charles
  • 50,943
  • 13
  • 104
  • 142
commonpike
  • 10,499
  • 4
  • 65
  • 58

1 Answers1

1

Have a look here for a partial answer to your question.

If you decide to build your own "stop" button on top of the videojs interface then the sequence would be something like (API ref here):

myPlayer.pause();
myPlayer.currentTime(0);
myPlayer.posterImage.show(); // as per OP plans
myPlayer.bigPlayButton.show(); // as per OP plans
Community
  • 1
  • 1
Arnaud Leyder
  • 6,674
  • 5
  • 31
  • 43
  • Thanks for the link. There is a basic intro about writing plugins here https://github.com/videojs/video.js/blob/master/docs/guides/plugins.md . in the latest version, the complete set of commands for what i want is `this.pause(); this.currentTime(0); this.posterImage.show(); this.bigPlayButton.show();` – commonpike Apr 14 '14 at 12:05
  • Did not know about the this.posterImage.show() - convenient indeed – Arnaud Leyder Apr 14 '14 at 12:12