Skip to content

Instantly share code, notes, and snippets.

@rchrd2
Created December 19, 2014 09:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rchrd2/4cafdae8d8add51f2a9d to your computer and use it in GitHub Desktop.
Save rchrd2/4cafdae8d8add51f2a9d to your computer and use it in GitHub Desktop.
Videojs BigPlayButton Play Pause
videojs.BigPlayButton.prototype.onClick = function(){
if(this.player_.paused()) {
this.player_.play();
} else {
this.player_.pause();
}
};
/*
.vjs-playing
.vjs-paused
.vjs-user-active
.vjs-user-inactive
.vjs-has-started
*/
.vjs-custom-skin .vjs-big-play-button {
display: block;
position: relative;
top: 50%;
left: 50%;
transform: translateY(-50%) translateX(-50%);
width:54px;
height:64px;
cursor: pointer;
background-repeat: no-repeat;
z-index:1000;
background-image: url('/_media/play.png');
outline:0;
}
.vjs-custom-skin.vjs-playing .vjs-big-play-button {
display:none;
}
.vjs-custom-skin.vjs-playing.vjs-user-active .vjs-big-play-button {
display: block;
background-image: url('/_media/pause.png');
}
.vjs-custom-skin.vjs-paused .vjs-big-play-button {
display: block;
background-image: url('/_media/play.png');
}
.vjs-custom-skin.vjs-user-active .vjs-big-play-button {}
.vjs-custom-skin.vjs-user-inactive .vjs-big-play-button {}
.vjs-custom-skin.vjs-has-started .vjs-big-play-button {
}
@Leo01985
Copy link

This is the script to make play pause button? pleas check this photo http://gph.is/2nncT97 this is missing in my video-js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment