From a00407a4754b79604fa8ffb5c0972b0e747ceebe Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Fri, 6 Mar 2015 17:47:08 +1100 Subject: [PATCH] Removed extra log --- dist/plyr.js | 2 +- src/js/plyr.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/dist/plyr.js b/dist/plyr.js index a52a23a5..3d3cecfd 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -1 +1 @@ -!function(e){"use strict";function t(e,t){v.debug&&window.console&&console[t?"error":"log"](e)}function n(){var e,t,n,r=navigator.userAgent,s=navigator.appName,a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",a="11;"):-1!==(t=r.indexOf("MSIE"))?(s="IE",a=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(s="Chrome",a=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(s="Safari",a=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(a=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(s="Firefox",a=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(s=r.substring(e,t),a=r.substring(t+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(n=a.indexOf(";"))&&(a=a.substring(0,n)),-1!==(n=a.indexOf(" "))&&(a=a.substring(0,n)),o=parseInt(""+a,10),isNaN(o)&&(a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),[s,o]}function r(e,t){var n=e.media;if("video"==e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"==e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function s(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function a(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,s=e[n],a=s.parentNode,o=s.nextSibling;r.appendChild(s),o?a.insertBefore(r,o):a.appendChild(r)}}function o(e){e.parentNode.removeChild(e)}function i(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function l(e,t,n,r){t=t.split(" ");for(var s=0;sn;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return"webkit"===e.prefix&&navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&(e.supportsFullScreen=!1),e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!==document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]("webkit"===this.prefix?e.ALLOW_KEYBOARD_INPUT:null)},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function m(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function b(e){function l(){for(K.subcount=0;g(K.captions[K.subcount][0])K.captions.length-1){K.subcount=K.captions.length-1;break}}function d(){i(K.container,v.classes.captions.enabled,!0),v.captions.defaultActive&&(i(K.container,v.classes.captions.active,!0),K.buttons.captions.setAttribute("checked","checked"))}function b(e){var t=[];return t=e.split(" --> "),h(t[0])}function g(e){var t=[];return t=e.split(" --> "),h(t[1])}function h(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function k(e){return K.container.querySelectorAll(e)}function x(e){return k(e)[0]}function w(){try{return window.self!==window.top}catch(e){return!0}}function T(){t("Injecting custom controls.");var e=v.html;e=s(e,"{seektime}",v.seekTime),e=s(e,"{id}",K.random),K.container.insertAdjacentHTML("beforeend",e)}function S(){try{return K.controls=x(v.selectors.controls),K.buttons={},K.buttons.seek=x(v.selectors.buttons.seek),K.buttons.play=x(v.selectors.buttons.play),K.buttons.pause=x(v.selectors.buttons.pause),K.buttons.restart=x(v.selectors.buttons.restart),K.buttons.rewind=x(v.selectors.buttons.rewind),K.buttons.forward=x(v.selectors.buttons.forward),K.buttons.mute=x(v.selectors.buttons.mute),K.buttons.captions=x(v.selectors.buttons.captions),K.buttons.fullscreen=x(v.selectors.buttons.fullscreen),K.progress={},K.progress.container=x(v.selectors.progress.container),K.progress.buffer={},K.progress.buffer.bar=x(v.selectors.progress.buffer),K.progress.buffer.text=K.progress.buffer.bar.getElementsByTagName("span")[0],K.progress.played={},K.progress.played.bar=x(v.selectors.progress.played),K.progress.played.text=K.progress.played.bar.getElementsByTagName("span")[0],K.volume=x(v.selectors.buttons.volume),K.duration=x(v.selectors.duration),K.seekTime=k(v.selectors.seekTime),!0}catch(e){return t("It looks like there's a problem with your controls html. Bailing.",!0),!1}}function F(){var e=K.buttons.play.innerText||"Play";"undefined"!=typeof v.title&&v.title.length&&(e+=", "+v.title),K.buttons.play.setAttribute("aria-label",e)}function N(){if(K.media=K.container.querySelectorAll("audio, video")[0],!K.media)return t("No audio or video element found!",!0),!1;if(K.media.removeAttribute("controls"),K.type="video"==K.media.tagName.toLowerCase()?"video":"audio",i(K.container,v.classes[K.type],!0),i(K.container,v.classes.stopped,null===K.media.getAttribute("autoplay")),"video"===K.type){var e=document.createElement("div");e.setAttribute("class",v.classes.videoWrapper),a(K.media,e),K.videoContainer=e}null!==K.media.getAttribute("autoplay")&&A()}function C(){if("video"===K.type){K.videoContainer.insertAdjacentHTML("afterbegin","
"),K.captionsContainer=x(v.selectors.captions),K.isTextTracks=!1,K.media.textTracks&&(K.isTextTracks=!0);for(var e,n="",r=K.media.childNodes,s=0;s=31||"Safari"===K.browserName&&K.browserMajorVersion>=7)&&(t("Detected IE 10/11 or Firefox 31+ or Safari 7+."),K.isTextTracks=!1),K.isTextTracks){t("TextTracks supported.");for(var l=0;lb(K.captions[K.subcount][0])&&K.media.currentTime.toFixed(1)g(K.captions[K.subcount][0])&&K.subcount=7){t("Safari 7+ detected; removing track from DOM."),a=K.media.getElementsByTagName("track");for(var f=0;f10&&(e=10),K.volume.value=e,K.media.volume=parseFloat(e/10),R(),v.storage.enabled&&m().supported&&(window.localStorage.plyr_volume=e)}function q(e){"undefined"==typeof active&&(e=!K.media.muted,K.buttons.mute.checked=e),K.media.muted=e,R()}function H(e){"undefined"==typeof e&&(e=-1===K.container.className.indexOf(v.classes.captions.active),K.buttons.captions.checked=e),e?i(K.container,v.classes.captions.active,!0):i(K.container,v.classes.captions.active)}function R(){i(K.container,v.classes.muted,0===K.media.volume||K.media.muted)}function B(e){var t=K.progress.played.bar,n=K.progress.played.text,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":r=p(K.media.currentTime,K.media.duration),"timeupdate"==e.type&&(K.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=K.progress.buffer.bar,n=K.progress.buffer.text,r=function(){var e=K.media.buffered;return e.length?p(e.end(0),K.media.duration):0}()}t.value=r,n.innerHTML=r}function W(){K.secs=parseInt(K.media.currentTime%60),K.mins=parseInt(K.media.currentTime/60%60),K.secs=("0"+K.secs).slice(-2),K.mins=("0"+K.mins).slice(-2),K.duration.innerHTML=K.mins+":"+K.secs}function _(e){W(),B(e)}function D(){for(var e=K.media.querySelectorAll("source"),t=e.length-1;t>=0;t--)o(e[t]);K.media.removeAttribute("src")}function U(e){r(K,e.type)&&(M(),L(),D(),K.media.setAttribute("src",e.src),Y(),_(),null!==K.media.getAttribute("autoplay")&&A())}function X(e){if("object"==typeof e)U(e);else if(e.constructor===Array)for(var t in e)U(e[t])}function J(e){"video"===K.type&&K.media.setAttribute("poster",e)}function $(){c(K.buttons.play,"click",function(){A(),setTimeout(function(){K.buttons.pause.focus()},100)}),c(K.buttons.pause,"click",function(){M(),setTimeout(function(){K.buttons.play.focus()},100)}),c(K.buttons.restart,"click",Y),c(K.buttons.rewind,"click",I),c(K.buttons.forward,"click",V),c(K.volume,"change input",function(){j(this.value)}),c(K.buttons.mute,"change",function(){q(this.checked)}),c(K.buttons.fullscreen,"click",O),c(document,y.fullScreenEventName,O),"video"===K.type&&v.click&&c(K.videoContainer,"click",function(){K.media.paused?A():K.media.ended?(Y(),A()):M()}),c(K.media,"timeupdate seeking",_),c(K.buttons.seek,"change input",Y),c(K.buttons.captions,"click",function(){H(this.checked)}),c(K.media,"ended",function(){"video"===K.type&&(K.captionsContainer.innerHTML=""),L()}),c(K.media,"progress",B),c(K.media,"playing",B),c(K.media,"volumechange",R),c(K.media,"play pause",L)}function z(){return y=f(),K.browserInfo=n(),K.browserName=K.browserInfo[0],K.browserMajorVersion=K.browserInfo[1],t(K.browserName+" "+K.browserMajorVersion),"IE"!==K.browserName||8!==K.browserMajorVersion&&9!==K.browserMajorVersion?(N(),K.random=Math.floor(1e4*Math.random()),T(),S()?(F(),C(),j(),E(),$(),void 0):!1):(t("Browser not suppported.",!0),!1)}var K=this;K.container=e;var Y=function(e){var n=0;"undefined"!=typeof e&&("number"==typeof e?n=e:("change"===e.type||"input"===e.type)&&(n=(this.value/this.max*K.media.duration).toFixed(1)),K.media.currentTime=n,t("Seeking to "+K.media.currentTime+" seconds"),K.isTextTracks||"video"!==K.type||l(K))};return z(),{media:K.media,play:A,pause:M,restart:Y,rewind:I,forward:V,seek:Y,setVolume:j,toggleMute:q,toggleCaptions:H,source:X,poster:J,support:r}}var y,v,g={enabled:!0,debug:!1,seekTime:10,volume:5,click:!0,selectors:{container:".player",controls:".player-controls",buttons:{seek:"[data-player='seek']",play:"[data-player='play']",pause:"[data-player='pause']",restart:"[data-player='restart']",rewind:"[data-player='rewind']",forward:"[data-player='fast-forward']",mute:"[data-player='mute']",volume:"[data-player='volume']",captions:"[data-player='captions']",fullscreen:"[data-player='fullscreen']"},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",duration:".player-duration"},classes:{video:"player-video",videoWrapper:"player-video-wrapper",audio:"player-audio",stopped:"stopped",playing:"playing",muted:"muted",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0},storage:{enabled:!0},html:function(){return["
","
","","","","0% played","","","0% buffered","","
","","","","","","","","Time","00:00","","","","","","","","","","","","
"].join("\n")}()};e.setup=function(e){if(v=d(g,e),!v.enabled)return!1;for(var t=document.querySelectorAll(v.selectors.container),n=[],r=t.length-1;r>=0;r--){var s=t[r];"undefined"==typeof s.plyr&&(s.plyr=new b(s)),n.push(s.plyr)}return n}}(this.plyr=this.plyr||{}); \ No newline at end of file +!function(e){"use strict";function t(e,t){v.debug&&window.console&&console[t?"error":"log"](e)}function n(){var e,t,n,r=navigator.userAgent,s=navigator.appName,a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",a="11;"):-1!==(t=r.indexOf("MSIE"))?(s="IE",a=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(s="Chrome",a=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(s="Safari",a=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(a=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(s="Firefox",a=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(s=r.substring(e,t),a=r.substring(t+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(n=a.indexOf(";"))&&(a=a.substring(0,n)),-1!==(n=a.indexOf(" "))&&(a=a.substring(0,n)),o=parseInt(""+a,10),isNaN(o)&&(a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),[s,o]}function r(e,t){var n=e.media;if("video"==e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"==e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function s(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function a(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,s=e[n],a=s.parentNode,o=s.nextSibling;r.appendChild(s),o?a.insertBefore(r,o):a.appendChild(r)}}function o(e){e.parentNode.removeChild(e)}function i(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function c(e,t,n,r){t=t.split(" ");for(var s=0;sn;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return"webkit"===e.prefix&&navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&(e.supportsFullScreen=!1),e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!==document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]("webkit"===this.prefix?e.ALLOW_KEYBOARD_INPUT:null)},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function m(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function b(e){function c(e){if(!K.usingTextTracks&&"video"===K.type){for(K.subcount=0,e="number"==typeof e?e:K.media.currentTime;g(K.captions[K.subcount][0])K.captions.length-1){K.subcount=K.captions.length-1;break}K.media.currentTime.toFixed(1)>=b(K.captions[K.subcount][0])&&K.media.currentTime.toFixed(1)<=g(K.captions[K.subcount][0])&&(K.currentCaption=K.captions[K.subcount][1]),K.media.currentTime.toFixed(1)>g(K.captions[K.subcount][0])&&K.subcount "),h(t[0])}function g(e){var t=[];return t=e.split(" --> "),h(t[1])}function h(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function k(e){return K.container.querySelectorAll(e)}function x(e){return k(e)[0]}function w(){try{return window.self!==window.top}catch(e){return!0}}function T(){t("Injecting custom controls.");var e=v.html;e=s(e,"{seektime}",v.seekTime),e=s(e,"{id}",K.random),K.container.insertAdjacentHTML("beforeend",e)}function S(){try{return K.controls=x(v.selectors.controls),K.buttons={},K.buttons.seek=x(v.selectors.buttons.seek),K.buttons.play=x(v.selectors.buttons.play),K.buttons.pause=x(v.selectors.buttons.pause),K.buttons.restart=x(v.selectors.buttons.restart),K.buttons.rewind=x(v.selectors.buttons.rewind),K.buttons.forward=x(v.selectors.buttons.forward),K.buttons.mute=x(v.selectors.buttons.mute),K.buttons.captions=x(v.selectors.buttons.captions),K.buttons.fullscreen=x(v.selectors.buttons.fullscreen),K.progress={},K.progress.container=x(v.selectors.progress.container),K.progress.buffer={},K.progress.buffer.bar=x(v.selectors.progress.buffer),K.progress.buffer.text=K.progress.buffer.bar.getElementsByTagName("span")[0],K.progress.played={},K.progress.played.bar=x(v.selectors.progress.played),K.progress.played.text=K.progress.played.bar.getElementsByTagName("span")[0],K.volume=x(v.selectors.buttons.volume),K.duration=x(v.selectors.duration),K.seekTime=k(v.selectors.seekTime),!0}catch(e){return t("It looks like there's a problem with your controls html. Bailing.",!0),!1}}function F(){var e=K.buttons.play.innerText||"Play";"undefined"!=typeof v.title&&v.title.length&&(e+=", "+v.title),K.buttons.play.setAttribute("aria-label",e)}function N(){if(K.media=K.container.querySelectorAll("audio, video")[0],!K.media)return t("No audio or video element found!",!0),!1;if(K.media.removeAttribute("controls"),K.type="video"==K.media.tagName.toLowerCase()?"video":"audio",i(K.container,v.classes[K.type],!0),i(K.container,v.classes.stopped,null===K.media.getAttribute("autoplay")),"video"===K.type){var e=document.createElement("div");e.setAttribute("class",v.classes.videoWrapper),a(K.media,e),K.videoContainer=e}null!==K.media.getAttribute("autoplay")&&E()}function C(){if("video"===K.type){K.videoContainer.insertAdjacentHTML("afterbegin","
"),K.captionsContainer=x(v.selectors.captions),K.usingTextTracks=!1,K.media.textTracks&&(K.usingTextTracks=!0);for(var e,n="",r=K.media.childNodes,s=0;s=31||"Safari"===K.browserName&&K.browserMajorVersion>=7)&&(t("Detected IE 10/11 or Firefox 31+ or Safari 7+."),K.usingTextTracks=!1),K.usingTextTracks){t("TextTracks supported.");for(var c=0;c=7){t("Safari 7+ detected; removing track from DOM."),a=K.media.getElementsByTagName("track");for(var f=0;f10&&(e=10),K.volume.value=e,K.media.volume=parseFloat(e/10),H(),v.storage.enabled&&m().supported&&(window.localStorage.plyr_volume=e)}function q(e){"undefined"==typeof active&&(e=!K.media.muted,K.buttons.mute.checked=e),K.media.muted=e,H()}function B(e){"undefined"==typeof e&&(e=-1===K.container.className.indexOf(v.classes.captions.active),K.buttons.captions.checked=e),e?i(K.container,v.classes.captions.active,!0):i(K.container,v.classes.captions.active)}function H(){i(K.container,v.classes.muted,0===K.media.volume||K.media.muted)}function R(e){var t=K.progress.played.bar,n=K.progress.played.text,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":r=p(K.media.currentTime,K.media.duration),"timeupdate"==e.type&&(K.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=K.progress.buffer.bar,n=K.progress.buffer.text,r=function(){var e=K.media.buffered;return e.length?p(e.end(0),K.media.duration):0}()}t.value=r,n.innerHTML=r}function W(){K.secs=parseInt(K.media.currentTime%60),K.mins=parseInt(K.media.currentTime/60%60),K.secs=("0"+K.secs).slice(-2),K.mins=("0"+K.mins).slice(-2),K.duration.innerHTML=K.mins+":"+K.secs}function _(e){W(),R(e)}function D(){for(var e=K.media.querySelectorAll("source"),t=e.length-1;t>=0;t--)o(e[t]);K.media.removeAttribute("src")}function U(e){e.type&&e.src&&(r(K,e.type)?(M(),L(),D(),K.media.setAttribute("src",e.src),Y(),_(),null!==K.media.getAttribute("autoplay")&&E()):t("No support for: "+e.src+" ["+e.type+"]"))}function X(e){if("object"==typeof e&&e.constructor!==Array)U(e);else if(e.constructor===Array)for(var n in e)U(e[n]);else t("Bad source format...")}function J(e){"video"===K.type&&K.media.setAttribute("poster",e)}function $(){l(K.buttons.play,"click",function(){E(),setTimeout(function(){K.buttons.pause.focus()},100)}),l(K.buttons.pause,"click",function(){M(),setTimeout(function(){K.buttons.play.focus()},100)}),l(K.buttons.restart,"click",Y),l(K.buttons.rewind,"click",I),l(K.buttons.forward,"click",V),l(K.volume,"change input",function(){j(this.value)}),l(K.buttons.mute,"change",function(){q(this.checked)}),l(K.buttons.fullscreen,"click",O),l(document,y.fullScreenEventName,O),"video"===K.type&&v.click&&l(K.videoContainer,"click",function(){K.media.paused?E():K.media.ended?(Y(),E()):M()}),l(K.media,"timeupdate seeking",_),l(K.media,"timeupdate",c),l(K.buttons.seek,"change input",Y),l(K.buttons.captions,"click",function(){B(this.checked)}),l(K.media,"ended",function(){"video"===K.type&&(K.captionsContainer.innerHTML=""),L()}),l(K.media,"progress",R),l(K.media,"playing",R),l(K.media,"volumechange",H),l(K.media,"play pause",L)}function z(){return y=f(),K.browserInfo=n(),K.browserName=K.browserInfo[0],K.browserMajorVersion=K.browserInfo[1],t(K.browserName+" "+K.browserMajorVersion),"IE"!==K.browserName||8!==K.browserMajorVersion&&9!==K.browserMajorVersion?(N(),K.random=Math.floor(1e4*Math.random()),T(),S()?(F(),C(),j(),A(),$(),void 0):!1):(t("Browser not suppported.",!0),!1)}var K=this;K.container=e;var Y=function(e){var n=0;"undefined"!=typeof e&&("number"==typeof e?n=e:("change"===e.type||"input"===e.type)&&(n=this.value/this.max*K.media.duration),0>n?n=0:n>K.media.duration&&(n=K.media.duration),K.media.currentTime=n.toFixed(1),t("Seeking to "+K.media.currentTime+" seconds"),c(n))};return z(),{media:K.media,play:E,pause:M,restart:Y,rewind:I,forward:V,seek:Y,setVolume:j,toggleMute:q,toggleCaptions:B,source:X,poster:J,support:r}}var y,v,g={enabled:!0,debug:!1,seekTime:10,volume:5,click:!0,selectors:{container:".player",controls:".player-controls",buttons:{seek:"[data-player='seek']",play:"[data-player='play']",pause:"[data-player='pause']",restart:"[data-player='restart']",rewind:"[data-player='rewind']",forward:"[data-player='fast-forward']",mute:"[data-player='mute']",volume:"[data-player='volume']",captions:"[data-player='captions']",fullscreen:"[data-player='fullscreen']"},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",duration:".player-duration"},classes:{video:"player-video",videoWrapper:"player-video-wrapper",audio:"player-audio",stopped:"stopped",playing:"playing",muted:"muted",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0},storage:{enabled:!0},html:function(){return["
","
","","","","0% played","","","0% buffered","","
","","","","","","","","Time","00:00","","","","","","","","","","","","
"].join("\n")}()};e.setup=function(e){if(v=d(g,e),!v.enabled)return!1;for(var t=document.querySelectorAll(v.selectors.container),n=[],r=t.length-1;r>=0;r--){var s=t[r];"undefined"==typeof s.plyr&&(s.plyr=new b(s)),n.push(s.plyr)}return n}}(this.plyr=this.plyr||{}); \ No newline at end of file diff --git a/src/js/plyr.js b/src/js/plyr.js index aac77c5c..227759d4 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1065,7 +1065,6 @@ // Remove each for (var i = sources.length - 1; i >= 0; i--) { - _log(sources[i]); _remove(sources[i]); }