Merge branch 'develop' of github.com:Selz/plyr into develop

# Conflicts:
#	dist/plyr.js
#	src/js/plyr.js
This commit is contained in:
Sam Potts 2017-03-29 09:05:25 +11:00
commit 889712761a
5 changed files with 26 additions and 15 deletions

2
dist/plyr.css vendored

File diff suppressed because one or more lines are too long

4
dist/plyr.js vendored

File diff suppressed because one or more lines are too long

View File

@ -492,7 +492,7 @@
// Add text node // Add text node
if (is.string(text)) { if (is.string(text)) {
element.appendChild(document.createTextNode(text)); element.textContent = text;
} }
// Return built element // Return built element
@ -508,6 +508,14 @@
prependChild(parent, element); prependChild(parent, element);
} }
// Remove all child elements
function emptyElement(element) {
var length = element.childNodes.length;
while (length--) {
element.removeChild(element.lastChild);
}
}
// Get a classname from selector // Get a classname from selector
function getClassname(selector) { function getClassname(selector) {
return selector.replace('.', ''); return selector.replace('.', '');
@ -981,8 +989,8 @@
attributes.forEach(function(attribute) { attributes.forEach(function(attribute) {
insertElement(type, player.elements.media, attribute); insertElement(type, player.elements.media, attribute);
}); });
}
} }
}
// Get icon URL // Get icon URL
function getIconUrl() { function getIconUrl() {
@ -1159,8 +1167,7 @@
break; break;
} }
var label = document.createTextNode('% ' + suffix.toLowerCase()); progress.textContent = '% ' + suffix.toLowerCase();
progress.appendChild(label);
} }
player.elements.display[type] = progress; player.elements.display[type] = progress;
@ -1389,7 +1396,7 @@
config.tracks.forEach(function(track, index) { config.tracks.forEach(function(track, index) {
if (is.function(track)) { if (is.function(track)) {
return; return;
} }
var option = createElement('li'); var option = createElement('li');
@ -1404,7 +1411,7 @@
}); });
} }
break; break;
} }
pane.appendChild(options); pane.appendChild(options);
@ -1937,7 +1944,7 @@
var content = createElement('span'); var content = createElement('span');
// Empty the container // Empty the container
captions.innerHTML = ''; emptyElement(captions);
// Default to empty // Default to empty
if (is.undefined(caption)) { if (is.undefined(caption)) {
@ -2079,6 +2086,10 @@
//player.elements.buttons.captions_menu.innerHTML = show ? 'Off' : 'On'; //player.elements.buttons.captions_menu.innerHTML = show ? 'Off' : 'On';
//TODO: display lang getElement('[data-captions="settings"]').innerHTML = getSubsLangValue(); //TODO: display lang getElement('[data-captions="settings"]').innerHTML = getSubsLangValue();
// Set current language etc
//elements.buttons.captions_menu.innerHTML = show ? 'Off' : 'On';
//getElement('[data-captions="settings"]').innerHTML = getSubsLangValue();
// Toggle state // Toggle state
toggleState(player.elements.buttons.captions, player.captions.enabled); toggleState(player.elements.buttons.captions, player.captions.enabled);
@ -3083,7 +3094,7 @@
// It should be a number, but parse it just incase // It should be a number, but parse it just incase
var duration = parseInt(config.duration); var duration = parseInt(config.duration);
// True duration // True duration
var mediaDuration = 0; var mediaDuration = 0;
// Only if duration available // Only if duration available
@ -3449,10 +3460,10 @@
var display = (displayHours ? hours + ':' : '') + mins + ':' + secs; var display = (displayHours ? hours + ':' : '') + mins + ':' + secs;
// Render // Render
element.innerHTML = display; element.textContent = label;
// Return for looping // Return for looping
return display; return label;
} }
// Show the duration on metadataloaded // Show the duration on metadataloaded

View File

@ -17,7 +17,7 @@
@plyr-font-size-base: 16px; @plyr-font-size-base: 16px;
// Captions // Captions
@plyr-captions-bg: fade(#000, 85%); @plyr-captions-bg: fade(#000, 60%);
@plyr-captions-color: #fff; @plyr-captions-color: #fff;
@plyr-font-size-captions-base: @plyr-font-size-base; @plyr-font-size-captions-base: @plyr-font-size-base;
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5); @plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);

View File

@ -18,7 +18,7 @@ $plyr-font-size-small: 14px !default;
$plyr-font-size-base: 16px !default; $plyr-font-size-base: 16px !default;
// Captions // Captions
$plyr-captions-bg: transparentize(#000, .3) !default; $plyr-captions-bg: transparentize(#000, .4) !default;
$plyr-captions-color: #fff !default; $plyr-captions-color: #fff !default;
$plyr-font-size-captions-base: $plyr-font-size-base !default; $plyr-font-size-captions-base: $plyr-font-size-base !default;
$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default; $plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;