I have implemented the newest JW Player (8.24) and I would like to customize it, so that it has a fast forward button. Standard only has a -10 sec rewind. it would be nice with a forward +10 sec as well. And someone has already done it! And I have also implemented this script but it only show the icon in – transform = “scaleX(-1)”; – which shows the icon reversed, which is kind a drag. Is there anyone who is good at javascript who can help a noob with this small problem?
How can I get the icon/image not to be shown in reverse, or how can I replace it?
The script which I implemented is this:
const playerContainerSelector = '#jwplayer-container';
const player = jwplayer('#player');
const playerContainer = document.querySelector(playerContainerSelector);
// display icon
const rewindContainer = playerContainer.querySelector('.jw-display-icon-rewind');
const forwardContainer = rewindContainer.cloneNode(true);
const forwardDisplayButton = forwardContainer.querySelector('.jw-icon-rewind');
forwardDisplayButton.style.transform = "scaleX(-1)";
forwardDisplayButton.ariaLabel = "Forward 10 Seconds"
const nextContainer = playerContainer.querySelector('.jw-display-icon-next');
nextContainer.parentNode.insertBefore(forwardContainer, nextContainer);
// control bar icon
playerContainer.querySelector('.jw-display-icon-next').style.display = 'none'; //
hide next button
const buttonContainer = playerContainer.querySelector('.jw-button-container');
const rewindControlBarButton = buttonContainer.querySelector(".jw-icon-rewind");
const forwardControlBarButton = rewindControlBarButton.cloneNode(true);
forwardControlBarButton.style.transform = "scaleX(-1)";
forwardControlBarButton.ariaLabel = "Forward 10 Seconds";
rewindControlBarButton.parentNode.insertBefore(forwardControlBarButton,
rewindControlBarButton.nextElementSibling);
// add onclick handlers
[forwardDisplayButton, forwardControlBarButton].forEach(button => {
button.onclick = () => {
player.seek((player.getPosition() + 10));
}
})
The script is from this github thread:
https://github.com/jwplayer/jwplayer/issues/3894
Any help is is much obliged.