JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="video">
<a href="#" class="tubular-play">PLAY</a>
<a href="#" class="tubular-pause">PAUSE</a>
<a href="#" class="tubular-mute">SOUND</a>
</div>
</body>
CSS
body {
height: 100%;
}
#videocontrol {
z-index: 1000;
}
a {
color: #fff;
}
JavaScript
/* jQuery tubular plugin
|* by Sean McCambridge
|* http://www.seanmccambridge.com/tubular
|* version: 1.0
|* updated: October 1, 2012
|* since 2010
|* licensed under the MIT License
|* Enjoy.
|*
|* Thanks,
|* Sean */
;
(function ($, window) {
// test for feature support and return if failure
// defaults
var defaults = {
ratio: 16 / 9, // usually either 4/3 or 16/9 -- tweak as needed
videoId: 'ZCAnLxRvNNc', // toy robot in space is a good default, no?
mute: true,
repeat: true,
width: $(window).width(),
wrapperZIndex: 99,
playButtonClass: 'tubular-play',
pauseButtonClass: 'tubular-pause',
muteButtonClass: 'tubular-mute',
volumeUpClass: 'tubular-volume-up',
volumeDownClass: 'tubular-volume-down',
increaseVolumeBy: 10,
start: 0
};
// methods
var tubular = function (node, options) { // should be called on the wrapper div
var options = $.extend({}, defaults, options),
$body = $('body') // cache body node
$node = $(node); // cache wrapper node
// build container
var tubularContainer = '<div id="tubular-container" style="overflow: hidden; position: fixed; z-index: 1; width: 100%; height: 100%"><div id="tubular-player" style="position: absolute"></div></div><div id="tubular-shield" style="width: 100%; height: 100%; z-index: 2; position: absolute; left: 0; top: 0;"></div>';
// set up css prereq's, inject tubular container and set up wrapper defaults
$('html,body').css({
'width': '100%',
'height': '100%'
});
$body.prepend(tubularContainer);
$node.css({
position: 'relative',
'z-index': options.wrapperZIndex
});
// set up iframe player, use global scope so YT api can talk
window.player;
window.onYouTubeIframeAPIReady = function () {
player = new...