Created
December 12, 2020 23:49
-
-
Save jhenry/09482b3f130c3971378b0ac223d81057 to your computer and use it in GitHub Desktop.
jwplayer theater mode button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Your theater-mode.svg file for the icon might look something like: | |
345,93 Bot | |
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80"> | |
<rect x="5" y="20" width="70" height="35" fill-opacity="0.01" stroke-width="8" stroke="lightgrey" shape-rendering="crispEdges" /> | |
</svg> | |
*/ | |
const buttonId = 'theater-mode-button'; | |
const iconPath = '/theater-mode.svg'; | |
const tooltipText = 'Theater Mode'; | |
// Call the player's `addButton` API method to add the custom button | |
playerInstance.addButton(iconPath, tooltipText, buttonClickAction, buttonId); | |
// This function is executed when the button is clicked | |
function buttonClickAction() { | |
// Toggle your width (in this case swapping bootstrap columns) | |
$("#video-col").toggleClass('col-md-8'); | |
$("#video-col").toggleClass('col-md-12'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment