Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

How to customize the default player controls (ex: back 15sec button)


Hi!
I am trying to customize my jw7 control bar.

How can I :
- remove the next / prev playlist buttons when several playlists are loaded? ( I know I could to this with CSS, but I like javascript better :-) )
Having the list is convenient. But Having the next and prev buttons are cumbersome.

- How can I add a 'back 15 sec' button? The label says it all. It's a very handy feature that some players have. I'll have no problem tying the callback function to it, but as far as I understand the current API, the addButton() function doesn't affect the controlbar which is where I'd like to place the button.

Thks!

1 Community Answers

Todd

JW Player Support Agent  
0 rated :

You can remove those next and previous buttons using Javascript:

jwplayer().once('displayClick',function(){
  document.getElementsByClassName('jw-icon-next')[0].style.display='none';
  document.getElementsByClassName('jw-icon-prev')[0].style.display='none';
})

We do not have built-in functionality to add buttons to the control bar, but you can also do this with Javascript and CSS:

jwplayer().onReady(function(){
	var myButton = document.createElement("div");
	myButton.id = "myButton";
	myButton.setAttribute('style',"margin-left: 10px; margin-top: 14px; background-image: url('http://qa.jwplayer.com/~todd/rewind.png');background-repeat: no-repeat;");
	myButton.setAttribute('class','jw-icon jw-icon-inline jw-button-color jw-reset');
	myButton.setAttribute('onclick','jwplayer().seek(jwplayer().getPosition()-15)');
	var leftGroup = document.getElementsByClassName('jw-controlbar-left-group')[0];
	leftGroup.insertBefore(myButton, leftGroup.childNodes[0]);
});

This question has received the maximum number of answers.