Removed useless spaces
This commit is contained in:
parent
e56132ae3b
commit
c8b2867b1f
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
// Default config
|
// Default config
|
||||||
var defaults = {
|
var defaults = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
debug: false,
|
debug: false,
|
||||||
seekTime: 10,
|
seekTime: 10,
|
||||||
volume: 5,
|
volume: 5,
|
||||||
@ -302,14 +302,14 @@
|
|||||||
// Get major version
|
// Get major version
|
||||||
majorVersion = parseInt("" + fullVersion, 10);
|
majorVersion = parseInt("" + fullVersion, 10);
|
||||||
if (isNaN(majorVersion)) {
|
if (isNaN(majorVersion)) {
|
||||||
fullVersion = "" + parseFloat(navigator.appVersion);
|
fullVersion = "" + parseFloat(navigator.appVersion);
|
||||||
majorVersion = parseInt(navigator.appVersion, 10);
|
majorVersion = parseInt(navigator.appVersion, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return data
|
// Return data
|
||||||
return {
|
return {
|
||||||
name: name,
|
name: name,
|
||||||
version: majorVersion,
|
version: majorVersion,
|
||||||
ios: /(iPad|iPhone|iPod)/g.test(navigator.platform)
|
ios: /(iPad|iPhone|iPod)/g.test(navigator.platform)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -317,7 +317,7 @@
|
|||||||
// Check for mime type support against a player instance
|
// Check for mime type support against a player instance
|
||||||
// Credits: http://diveintohtml5.info/everything.html
|
// Credits: http://diveintohtml5.info/everything.html
|
||||||
// Related: http://www.leanbackplayer.com/test/h5mt.html
|
// Related: http://www.leanbackplayer.com/test/h5mt.html
|
||||||
function _supportMime(player, mimeType) {
|
function _supportMime(player, mimeType) {
|
||||||
var media = player.media;
|
var media = player.media;
|
||||||
|
|
||||||
// Only check video types for video players
|
// Only check video types for video players
|
||||||
@ -562,7 +562,7 @@
|
|||||||
|
|
||||||
// Update methods to do something useful
|
// Update methods to do something useful
|
||||||
if (fullscreen.supportsFullScreen) {
|
if (fullscreen.supportsFullScreen) {
|
||||||
// Yet again Microsoft awesomeness,
|
// Yet again Microsoft awesomeness,
|
||||||
// Sometimes the prefix is "ms", sometimes "MS" to keep you on your toes
|
// Sometimes the prefix is "ms", sometimes "MS" to keep you on your toes
|
||||||
fullscreen.fullScreenEventName = (fullscreen.prefix == "ms" ? "MSFullscreenChange" : fullscreen.prefix + "fullscreenchange");
|
fullscreen.fullScreenEventName = (fullscreen.prefix == "ms" ? "MSFullscreenChange" : fullscreen.prefix + "fullscreenchange");
|
||||||
|
|
||||||
@ -588,7 +588,7 @@
|
|||||||
fullscreen.cancelFullScreen = function() {
|
fullscreen.cancelFullScreen = function() {
|
||||||
return (this.prefix === "") ? document.cancelFullScreen() : document[this.prefix + (this.prefix == "ms" ? "ExitFullscreen" : "CancelFullScreen")]();
|
return (this.prefix === "") ? document.cancelFullScreen() : document[this.prefix + (this.prefix == "ms" ? "ExitFullscreen" : "CancelFullScreen")]();
|
||||||
};
|
};
|
||||||
fullscreen.element = function() {
|
fullscreen.element = function() {
|
||||||
return (this.prefix === "") ? document.fullscreenElement : document[this.prefix + "FullscreenElement"];
|
return (this.prefix === "") ? document.fullscreenElement : document[this.prefix + "FullscreenElement"];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -955,7 +955,7 @@
|
|||||||
window.clearInterval(player.timer.buffering);
|
window.clearInterval(player.timer.buffering);
|
||||||
|
|
||||||
// Setup buffering
|
// Setup buffering
|
||||||
player.timer.buffering = window.setInterval(function() {
|
player.timer.buffering = window.setInterval(function() {
|
||||||
// Get loaded % from YouTube
|
// Get loaded % from YouTube
|
||||||
player.media.buffered = instance.getVideoLoadedFraction();
|
player.media.buffered = instance.getVideoLoadedFraction();
|
||||||
|
|
||||||
@ -1128,7 +1128,7 @@
|
|||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState === 4) {
|
if (xhr.readyState === 4) {
|
||||||
if (xhr.status === 200) {
|
if (xhr.status === 200) {
|
||||||
var records = [],
|
var records = [],
|
||||||
record,
|
record,
|
||||||
req = xhr.responseText;
|
req = xhr.responseText;
|
||||||
|
|
||||||
@ -1368,7 +1368,7 @@
|
|||||||
isMouseOver = (event.type === "mouseenter");
|
isMouseOver = (event.type === "mouseenter");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.fullscreen.hideControls) {
|
if (config.fullscreen.hideControls) {
|
||||||
// Hide on entering full screen
|
// Hide on entering full screen
|
||||||
_toggleClass(player.controls, config.classes.hover, false);
|
_toggleClass(player.controls, config.classes.hover, false);
|
||||||
|
|
||||||
@ -1384,7 +1384,7 @@
|
|||||||
function _handleEscapeFullscreen(event) {
|
function _handleEscapeFullscreen(event) {
|
||||||
// If it's a keypress and not escape, bail
|
// If it's a keypress and not escape, bail
|
||||||
if ((event.which || event.charCode || event.keyCode) === 27 && player.isFullscreen) {
|
if ((event.which || event.charCode || event.keyCode) === 27 && player.isFullscreen) {
|
||||||
_toggleFullscreen();
|
_toggleFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1473,7 +1473,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Toggle captions
|
// Toggle captions
|
||||||
function _toggleCaptions(show) {
|
function _toggleCaptions(show) {
|
||||||
// If there's no full support, or there's no caption toggle
|
// If there's no full support, or there's no caption toggle
|
||||||
if (!player.supported.full || !player.buttons.captions) {
|
if (!player.supported.full || !player.buttons.captions) {
|
||||||
return;
|
return;
|
||||||
@ -1506,8 +1506,8 @@
|
|||||||
|
|
||||||
// Update <progress> elements
|
// Update <progress> elements
|
||||||
function _updateProgress(event) {
|
function _updateProgress(event) {
|
||||||
var progress = player.progress.played.bar,
|
var progress = player.progress.played.bar,
|
||||||
text = player.progress.played.text,
|
text = player.progress.played.text,
|
||||||
value = 0;
|
value = 0;
|
||||||
|
|
||||||
if (event) {
|
if (event) {
|
||||||
@ -1536,7 +1536,7 @@
|
|||||||
case "progress":
|
case "progress":
|
||||||
progress = player.progress.buffer.bar;
|
progress = player.progress.buffer.bar;
|
||||||
text = player.progress.buffer.text;
|
text = player.progress.buffer.text;
|
||||||
value = (function() {
|
value = (function() {
|
||||||
var buffered = player.media.buffered;
|
var buffered = player.media.buffered;
|
||||||
|
|
||||||
// HTML5
|
// HTML5
|
||||||
@ -1548,7 +1548,7 @@
|
|||||||
return (buffered * 100);
|
return (buffered * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
})();
|
})();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1675,7 +1675,7 @@
|
|||||||
// Check if a source exists, use that or set the "src" attribute?
|
// Check if a source exists, use that or set the "src" attribute?
|
||||||
// .source([{ src: "path/to/video.mp4", type: "video/mp4" },{ src: "path/to/video.webm", type: "video/webm" }])
|
// .source([{ src: "path/to/video.mp4", type: "video/mp4" },{ src: "path/to/video.webm", type: "video/webm" }])
|
||||||
else if (sources.constructor === Array) {
|
else if (sources.constructor === Array) {
|
||||||
for (var index in sources) {
|
for (var index in sources) {
|
||||||
_addSource(sources[index]);
|
_addSource(sources[index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1740,14 +1740,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Play
|
// Play
|
||||||
_on(player.buttons.play, "click", function() {
|
_on(player.buttons.play, "click", function() {
|
||||||
_play();
|
_play();
|
||||||
setTimeout(function() { player.buttons.pause.focus(); }, 100);
|
setTimeout(function() { player.buttons.pause.focus(); }, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Pause
|
// Pause
|
||||||
_on(player.buttons.pause, "click", function() {
|
_on(player.buttons.pause, "click", function() {
|
||||||
_pause();
|
_pause();
|
||||||
setTimeout(function() { player.buttons.play.focus(); }, 100);
|
setTimeout(function() { player.buttons.play.focus(); }, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -2009,12 +2009,12 @@
|
|||||||
case "audio":
|
case "audio":
|
||||||
basic = audio;
|
basic = audio;
|
||||||
full = (basic && !oldIE);
|
full = (basic && !oldIE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "youtube":
|
case "youtube":
|
||||||
basic = true;
|
basic = true;
|
||||||
full = (!oldIE && !iPhone);
|
full = (!oldIE && !iPhone);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
basic = (audio && video);
|
basic = (audio && video);
|
||||||
@ -2040,7 +2040,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the players
|
// Get the players
|
||||||
var elements = document.querySelectorAll(config.selectors.container),
|
var elements = document.querySelectorAll(config.selectors.container),
|
||||||
players = [];
|
players = [];
|
||||||
|
|
||||||
// Create a player instance for each element
|
// Create a player instance for each element
|
||||||
@ -2049,7 +2049,7 @@
|
|||||||
var element = elements[i];
|
var element = elements[i];
|
||||||
|
|
||||||
// Setup a player instance and add to the element
|
// Setup a player instance and add to the element
|
||||||
if (typeof element.plyr === "undefined") {
|
if (typeof element.plyr === "undefined") {
|
||||||
// Create new instance
|
// Create new instance
|
||||||
var instance = new Plyr(element);
|
var instance = new Plyr(element);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user