Skip to content

Instantly share code, notes, and snippets.

@mister-ben
Created May 6, 2015 10:57
Show Gist options
  • Save mister-ben/ad5eb5923aea97dc87ff to your computer and use it in GitHub Desktop.
Save mister-ben/ad5eb5923aea97dc87ff to your computer and use it in GitHub Desktop.
JS Bin Subtle skin // source http://jsbin.com/bipiga
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Subtle skin">
<meta charset="utf-8">
<title>JS Bin</title>
<link href='http://fonts.googleapis.com/css?family=Comfortaa:300' rel='stylesheet' type='text/css'>
<style id="jsbin-css">
/*Player size*/
.video-js {
width: 640px;
height: 360px;
}
/*Repurpose big play button as banner*/
.video-js.video-js .vjs-big-play-button {
top: 50%;
margin-top: -10%;
left: 0;
width: 100%;
height: 40%;
border-radius: 0;
}
/*Remove play icon*/
.video-js.video-js .vjs-big-play-button:before {
/* Changes */
content: none;
}
/*Format text in banner*/
.vjs-titles-overlay {
font-family: "Comfortaa", cursive;
color: #FFF;
text-align: center;
padding-top: 20px;
}
.vjs-titles-overlay h2 {
font-size: 50px;
text-transform: uppercase;
}
/*Remove bgcolor and top line from control bar*/
.video-js.video-js .vjs-control-bar {
border-top: none;
background-color: initial;
}
/*Progress colour */
.video-js.video-js .vjs-play-progress {
background-color: #fff;
}
/*Hide default shadow effect on hover, Become more solid instead*/
.video-js.video-js .vjs-control:focus:before,
.video-js.video-js .vjs-control:hover:before,
.video-js.video-js .vjs-menu-item:focus,
.video-js.video-js .vjs-menu-item:hover {
text-shadow: none;
opacity: 1;
}
.video-js.video-js .vjs-big-play-button:focus,
.video-js.video-js .vjs-big-play-button:hover,
.video-js.video-js .vjs-progress-holder:focus:before {
box-shadow: none;
}
/* Default to transparent / hidden */
.video-js.video-js .vjs-control,
.video-js.video-js .vjs-control-bar,
.video-js.video-js .vjs-progress-control {
opacity: 0;
}
/* Show on play (until inactive) */
.video-js.video-js.vjs-has-started .vjs-control,
.video-js.video-js.vjs-has-started .vjs-control-bar,
.video-js.video-js.vjs-has-started .vjs-progress-control {
opacity: 1;
}
/* Hide on inactive, override and set transition */
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control,
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control-bar,
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-progress-control {
-webkit-transform: none;
-ms-transform: none;
transform: none;
-webkit-transition: none;
transition: none;
-webkit-transition: opacity .5s;
transition: opacity .5s;
opacity: 0;
}
/* Show when paused */
.video-js.video-js.vjs-has-started.vjs-paused .vjs-control,
.video-js.video-js.vjs-has-started.vjs-paused .vjs-control-bar,
.video-js.video-js.vjs-has-started.vjs-paused .vjs-progress-control {
opacity: 1;
}
/* Don't squish width on inactive - or leave for a woosh off to side effect */
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control {
width: 48px;
}
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-time-divider {
width: 4px;
}
/*Play button after*/
.video-js.video-js .vjs-big-play-button:after {
/* Changes */
content: '\e001';
color: #FFF;
text-align: center;
font-family: VideoJS;
display: block;
font-size: 23px;
line-height: 27px;
}
</style>
</head>
<body>
<video
id="player"
data-account="906043040001"
data-player="default"
data-embed="default"
data-video-id="4218988778001"
class="video-js" controls></video>
<script src="http://players.brightcove.net/906043040001/default_default/index.min.js"></script>
<script>
(function(window, document, videojs) {
videojs.plugin('titles', function(settings) {
var options = {showDescription:true};
var player = this;
var title_overlay_container = document.createElement('div');
var big_play_button = player.el().querySelector('.vjs-big-play-button');
var title, description, title_overlay, description_overlay;
options = videojs.util.mergeOptions(options,settings);
// create overlay contianer and insert
title_overlay_container.className = 'vjs-titles-overlay';
big_play_button.appendChild(title_overlay_container);
player.on('loadstart', function() {
// clear overlay
title_overlay_container.innerHTML = '';
if (!player.mediainfo || !player.mediainfo.name) {
return;
}
// get strings for language
title = player.mediainfo.name;
description = player.mediainfo.description;
title_overlay = document.createElement('h2');
if (title_overlay.contentText) {
title_overlay.contentText = title;
}
else {
title_overlay.innerHTML = title;
}
title_overlay_container.appendChild(title_overlay);
if (options.showDescription && description !== '' && description !== title) {
description_overlay = document.createElement('p');
if (description_overlay.contentText) {
description_overlay.contentText = description;
}
else {
description_overlay.innerHTML = description;
}
title_overlay_container.appendChild(description_overlay);
}
});
});
})(window, document, videojs);
</script>
<script>
var playerready = false;
videojs('player').ready(function(){
if (!playerready) {
playerready = true;
this.titles({});
}
});
</script>
<script id="jsbin-source-html" type="text/html"><!DOCTYPE html>
<html>
<head>
<meta name="description" content="Subtle skin">
<meta charset="utf-8">
<title>JS Bin</title>
<link href='http://fonts.googleapis.com/css?family=Comfortaa:300' rel='stylesheet' type='text/css'>
</head>
<body>
<video
id="player"
data-account="906043040001"
data-player="default"
data-embed="default"
data-video-id="4218988778001"
class="video-js" controls></video>
<script src="//players.brightcove.net/906043040001/default_default/index.min.js"><\/script>
<script>
(function(window, document, videojs) {
videojs.plugin('titles', function(settings) {
var options = {showDescription:true};
var player = this;
var title_overlay_container = document.createElement('div');
var big_play_button = player.el().querySelector('.vjs-big-play-button');
var title, description, title_overlay, description_overlay;
options = videojs.util.mergeOptions(options,settings);
// create overlay contianer and insert
title_overlay_container.className = 'vjs-titles-overlay';
big_play_button.appendChild(title_overlay_container);
player.on('loadstart', function() {
// clear overlay
title_overlay_container.innerHTML = '';
if (!player.mediainfo || !player.mediainfo.name) {
return;
}
// get strings for language
title = player.mediainfo.name;
description = player.mediainfo.description;
title_overlay = document.createElement('h2');
if (title_overlay.contentText) {
title_overlay.contentText = title;
}
else {
title_overlay.innerHTML = title;
}
title_overlay_container.appendChild(title_overlay);
if (options.showDescription && description !== '' && description !== title) {
description_overlay = document.createElement('p');
if (description_overlay.contentText) {
description_overlay.contentText = description;
}
else {
description_overlay.innerHTML = description;
}
title_overlay_container.appendChild(description_overlay);
}
});
});
})(window, document, videojs);
<\/script>
<script>
var playerready = false;
videojs('player').ready(function(){
if (!playerready) {
playerready = true;
this.titles({});
}
});
<\/script>
</body>
</html></script>
<script id="jsbin-source-css" type="text/css">
$font: 'Comfortaa', cursive;
$fontsize: 50px;
/*Player size*/
.video-js {
width: 640px;
height: 360px;
}
/*Repurpose big play button as banner*/
.video-js.video-js .vjs-big-play-button {
top: 50%;
margin-top: -10%;
left: 0;
width: 100%;
height: 40%;
border-radius: 0;
}
/*Remove play icon*/
.video-js.video-js .vjs-big-play-button:before {
/* Changes */
content: none;
}
/*Format text in banner*/
.vjs-titles-overlay {
font-family: $font;
color: #FFF;
text-align:center;
padding-top:20px;
h2 {
font-size:$fontsize;
text-transform: uppercase;
}
}
/*Remove bgcolor and top line from control bar*/
.video-js.video-js .vjs-control-bar {
border-top: none;
background-color: initial;
}
/*Progress colour */
.video-js.video-js .vjs-play-progress {
background-color: #fff;
}
/*Hide default shadow effect on hover, Become more solid instead*/
.video-js.video-js .vjs-control:focus:before,
.video-js.video-js .vjs-control:hover:before,
.video-js.video-js .vjs-menu-item:focus,
.video-js.video-js .vjs-menu-item:hover {
text-shadow: none;
opacity: 1;
}
.video-js.video-js .vjs-big-play-button:focus,
.video-js.video-js .vjs-big-play-button:hover,
.video-js.video-js .vjs-progress-holder:focus:before {
box-shadow: none;
}
/* Default to transparent / hidden */
.video-js.video-js .vjs-control,
.video-js.video-js .vjs-control-bar,
.video-js.video-js .vjs-progress-control {
opacity: 0;
}
/* Show on play (until inactive) */
.video-js.video-js.vjs-has-started .vjs-control,
.video-js.video-js.vjs-has-started .vjs-control-bar,
.video-js.video-js.vjs-has-started .vjs-progress-control {
opacity:1;
}
/* Hide on inactive, override and set transition */
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control,
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control-bar,
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-progress-control {
-webkit-transform: none;
-ms-transform: none;
transform: none;
-webkit-transition: none;
transition: none;
-webkit-transition: opacity .5s;
transition: opacity .5s;
opacity: 0;
}
/* Show when paused */
.video-js.video-js.vjs-has-started.vjs-paused .vjs-control,
.video-js.video-js.vjs-has-started.vjs-paused .vjs-control-bar,
.video-js.video-js.vjs-has-started.vjs-paused .vjs-progress-control {
opacity:1;
}
/* Don't squish width on inactive - or leave for a woosh off to side effect */
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control {
width: 48px;
}
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-time-divider {
width: 4px;
}
/*Play button after*/
.video-js.video-js .vjs-big-play-button:after {
/* Changes */
content:'\e001';
color: #FFF;
text-align:center;
font-family:VideoJS;
display:block;
font-size:23px;
line-height:27px;
}</script>
</body>
</html>
/*Player size*/
.video-js {
width: 640px;
height: 360px;
}
/*Repurpose big play button as banner*/
.video-js.video-js .vjs-big-play-button {
top: 50%;
margin-top: -10%;
left: 0;
width: 100%;
height: 40%;
border-radius: 0;
}
/*Remove play icon*/
.video-js.video-js .vjs-big-play-button:before {
/* Changes */
content: none;
}
/*Format text in banner*/
.vjs-titles-overlay {
font-family: "Comfortaa", cursive;
color: #FFF;
text-align: center;
padding-top: 20px;
}
.vjs-titles-overlay h2 {
font-size: 50px;
text-transform: uppercase;
}
/*Remove bgcolor and top line from control bar*/
.video-js.video-js .vjs-control-bar {
border-top: none;
background-color: initial;
}
/*Progress colour */
.video-js.video-js .vjs-play-progress {
background-color: #fff;
}
/*Hide default shadow effect on hover, Become more solid instead*/
.video-js.video-js .vjs-control:focus:before,
.video-js.video-js .vjs-control:hover:before,
.video-js.video-js .vjs-menu-item:focus,
.video-js.video-js .vjs-menu-item:hover {
text-shadow: none;
opacity: 1;
}
.video-js.video-js .vjs-big-play-button:focus,
.video-js.video-js .vjs-big-play-button:hover,
.video-js.video-js .vjs-progress-holder:focus:before {
box-shadow: none;
}
/* Default to transparent / hidden */
.video-js.video-js .vjs-control,
.video-js.video-js .vjs-control-bar,
.video-js.video-js .vjs-progress-control {
opacity: 0;
}
/* Show on play (until inactive) */
.video-js.video-js.vjs-has-started .vjs-control,
.video-js.video-js.vjs-has-started .vjs-control-bar,
.video-js.video-js.vjs-has-started .vjs-progress-control {
opacity: 1;
}
/* Hide on inactive, override and set transition */
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control,
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control-bar,
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-progress-control {
-webkit-transform: none;
-ms-transform: none;
transform: none;
-webkit-transition: none;
transition: none;
-webkit-transition: opacity .5s;
transition: opacity .5s;
opacity: 0;
}
/* Show when paused */
.video-js.video-js.vjs-has-started.vjs-paused .vjs-control,
.video-js.video-js.vjs-has-started.vjs-paused .vjs-control-bar,
.video-js.video-js.vjs-has-started.vjs-paused .vjs-progress-control {
opacity: 1;
}
/* Don't squish width on inactive - or leave for a woosh off to side effect */
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-control {
width: 48px;
}
.video-js.video-js.vjs-has-started.vjs-user-inactive .vjs-time-divider {
width: 4px;
}
/*Play button after*/
.video-js.video-js .vjs-big-play-button:after {
/* Changes */
content: '\e001';
color: #FFF;
text-align: center;
font-family: VideoJS;
display: block;
font-size: 23px;
line-height: 27px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment