"),e.join("")}function R(){if(Oe.supported.full&&("audio"!=Oe.type||h.fullscreen.allowAudio)&&h.fullscreen.enabled){var e=M.supportsFullScreen;e||h.fullscreen.fallback&&!W()?(T((e?"Native":"Fallback")+" fullscreen enabled"),m(Oe.container,h.classes.fullscreen.enabled,!0)):T("Fullscreen not supported and fallback disabled"),w(Oe.buttons.fullscreen,!1),Y()}}function L(){if("video"===Oe.type){G(h.selectors.captions)||Oe.videoContainer.insertAdjacentHTML("afterbegin",''),Oe.usingTextTracks=!1,Oe.media.textTracks&&(Oe.usingTextTracks=!0);for(var e,t="",n=Oe.media.childNodes,r=0;r=10||Oe.browser.isFirefox&&Oe.browser.version>=31)&&(T("Detected browser with known TextTrack issues - using manual fallback"),Oe.usingTextTracks=!1),Oe.usingTextTracks){T("TextTracks supported");for(var o=0;o ");for(var r=0;rOe.captions.length-1){Oe.subcount=Oe.captions.length-1;break}Oe.media.currentTime.toFixed(1)>=n(Oe.captions[Oe.subcount][0])&&Oe.media.currentTime.toFixed(1)<=r(Oe.captions[Oe.subcount][0])?(Oe.currentCaption=Oe.captions[Oe.subcount][1],B(Oe.currentCaption)):B()}}function H(){Oe.buttons.captions&&(m(Oe.container,h.classes.captions.enabled,!0),h.captions.defaultActive&&(m(Oe.container,h.classes.captions.active,!0),w(Oe.buttons.captions,!0)))}function V(e){return Oe.container.querySelectorAll(e)}function G(e){return V(e)[0]}function W(){try{return e.self!==e.top}catch(t){return!0}}function Y(){function e(e){9===e.which&&Oe.isFullscreen&&(e.target!==r||e.shiftKey?e.target===n&&e.shiftKey&&(e.preventDefault(),r.focus()):(e.preventDefault(),n.focus()))}var t=V("input:not([disabled]), button:not([disabled])"),n=t[0],r=t[t.length-1];b(Oe.container,"keydown",e)}function q(e,t){if("string"==typeof t)d(e,Oe.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Oe.media,t[n])}function X(){if(h.loadSprite){var e=I();e.absolute?(T("AJAX loading absolute SVG sprite"+(Oe.browser.isIE?" (due to IE)":"")),S(e.url,"sprite-plyr")):T("Sprite will be used as external resource directly")}var n=h.html;T("Injecting custom controls"),n||(n=P()),n=o(n,"{seektime}",h.seekTime),n=o(n,"{id}",Math.floor(1e4*Math.random()));var r;if(null!==h.selectors.controls.container&&(r=h.selectors.controls.container,"string"==typeof selector&&(r=t.querySelector(r))),r instanceof HTMLElement||(r=Oe.container),r.insertAdjacentHTML("beforeend",n),h.tooltips.controls)for(var a=V([h.selectors.controls.wrapper," ",h.selectors.labels," .",h.classes.hidden].join("")),s=a.length-1;s>=0;s--){var i=a[s];m(i,h.classes.hidden,!1),m(i,h.classes.tooltip,!0)}}function z(){try{return Oe.controls=G(h.selectors.controls.wrapper),Oe.buttons={},Oe.buttons.seek=G(h.selectors.buttons.seek),Oe.buttons.play=V(h.selectors.buttons.play),Oe.buttons.pause=G(h.selectors.buttons.pause),Oe.buttons.restart=G(h.selectors.buttons.restart),Oe.buttons.rewind=G(h.selectors.buttons.rewind),Oe.buttons.forward=G(h.selectors.buttons.forward),Oe.buttons.fullscreen=G(h.selectors.buttons.fullscreen),Oe.buttons.mute=G(h.selectors.buttons.mute),Oe.buttons.captions=G(h.selectors.buttons.captions),Oe.progress={},Oe.progress.container=G(h.selectors.progress.container),Oe.progress.buffer={},Oe.progress.buffer.bar=G(h.selectors.progress.buffer),Oe.progress.buffer.text=Oe.progress.buffer.bar&&Oe.progress.buffer.bar.getElementsByTagName("span")[0],Oe.progress.played=G(h.selectors.progress.played),Oe.progress.tooltip=Oe.progress.container&&Oe.progress.container.querySelector("."+h.classes.tooltip),Oe.volume={},Oe.volume.input=G(h.selectors.volume.input),Oe.volume.display=G(h.selectors.volume.display),Oe.duration=G(h.selectors.duration),Oe.currentTime=G(h.selectors.currentTime),Oe.seekTime=V(h.selectors.seekTime),!0}catch(e){return C("It looks like there is a problem with your controls HTML"),Q(!0),!1}}function D(){m(Oe.container,h.selectors.container.replace(".",""),Oe.supported.full)}function Q(e){e&&s(h.types.html5,Oe.type)?Oe.media.setAttribute("controls",""):Oe.media.removeAttribute("controls")}function j(e){var t=h.i18n.play;if("undefined"!=typeof h.title&&h.title.length&&(t+=", "+h.title),Oe.supported.full&&Oe.buttons.play)for(var n=Oe.buttons.play.length-1;n>=0;n--)Oe.buttons.play[n].setAttribute("aria-label",t);e instanceof HTMLElement&&e.setAttribute("title",h.i18n.frameTitle.replace("{title}",h.title))}function U(){if(!Oe.media)return void C("No media element found!");if(Oe.supported.full&&(m(Oe.container,h.classes.type.replace("{0}",Oe.type),!0),s(h.types.embed,Oe.type)&&m(Oe.container,h.classes.type.replace("{0}","video"),!0),m(Oe.container,h.classes.stopped,h.autoplay),m(Oe.container,h.classes.isIos,Oe.browser.isIos),m(Oe.container,h.classes.isTouch,Oe.browser.isTouch),"video"===Oe.type)){var e=t.createElement("div");e.setAttribute("class",h.classes.videoWrapper),i(Oe.media,e),Oe.videoContainer=e}s(h.types.embed,Oe.type)&&(Z(),Oe.embedId=null)}function Z(){for(var n=t.createElement("div"),r=Oe.embedId,s=Oe.type+"-"+Math.floor(1e4*Math.random()),o=V('[id^="'+Oe.type+'-"]'),i=o.length-1;i>=0;i--)u(o[i]);if(m(Oe.media,h.classes.videoWrapper,!0),m(Oe.media,h.classes.embedWrapper,!0),"youtube"===Oe.type)Oe.media.appendChild(n),n.setAttribute("id",s),"object"==typeof YT?J(r,n):(a(h.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){J(r,n)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Oe.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://player.vimeo.com/video/"+r+"?player_id="+s+"&api=1&badge=0&byline=0&portrait=0&title=0",id:s,allowfullscreen:"",frameborder:0}),Oe.supported.full?(n.appendChild(l),Oe.media.appendChild(n)):Oe.media.appendChild(l),"$f"in e||a(h.urls.vimeo.api);var c=e.setInterval(function(){"$f"in e&&l.loaded&&(e.clearInterval(c),K.call(l))},50)}else if("soundcloud"===Oe.type){var d=t.createElement("iframe");d.loaded=!1,b(d,"load",function(){d.loaded=!0}),p(d,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+r,id:s}),n.appendChild(d),Oe.media.appendChild(n),e.SC||a(h.urls.soundcloud.api);var A=e.setInterval(function(){e.SC&&d.loaded&&(e.clearInterval(A),ee.call(d))},50)}}function $(){Oe.container.plyr.embed=Oe.embed,Oe.supported.full&&Be(),j(G("iframe"))}function J(t,n){"timer"in Oe||(Oe.timer={}),Oe.embed=new YT.Player(n.id,{videoId:t,playerVars:{autoplay:h.autoplay?1:0,controls:Oe.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:h.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onError:function(e){k(Oe.container,"error",!0,{code:e.data,embed:e.target})},onReady:function(t){var n=t.target;Oe.media.play=function(){n.playVideo(),Oe.media.paused=!1},Oe.media.pause=function(){n.pauseVideo(),Oe.media.paused=!0},Oe.media.stop=function(){n.stopVideo(),Oe.media.paused=!0},Oe.media.duration=n.getDuration(),Oe.media.paused=!0,Oe.media.currentTime=n.getCurrentTime(),Oe.media.muted=n.isMuted(),h.title=n.getVideoData().title,k(Oe.media,"timeupdate"),e.clearInterval(Oe.timer.buffering),Oe.timer.buffering=e.setInterval(function(){Oe.media.buffered=n.getVideoLoadedFraction(),k(Oe.media,"progress"),1===Oe.media.buffered&&(e.clearInterval(Oe.timer.buffering),k(Oe.media,"canplaythrough"))},200),$(),xe()},onStateChange:function(t){var n=t.target;switch(e.clearInterval(Oe.timer.playing),t.data){case 0:Oe.media.paused=!0,k(Oe.media,"ended");break;case 1:Oe.media.paused=!1,Oe.media.seeking=!1,k(Oe.media,"play"),k(Oe.media,"playing"),Oe.timer.playing=e.setInterval(function(){Oe.media.currentTime=n.getCurrentTime(),k(Oe.media,"timeupdate")},100);break;case 2:Oe.media.paused=!0,k(Oe.media,"pause")}k(Oe.container,"statechange",!1,{code:t.data})}}})}function K(){Oe.embed=$f(this),Oe.embed.addEvent("ready",function(){Oe.media.play=function(){Oe.embed.api("play"),Oe.media.paused=!1},Oe.media.pause=function(){Oe.embed.api("pause"),Oe.media.paused=!0},Oe.media.stop=function(){Oe.embed.api("stop"),Oe.media.paused=!0},Oe.media.paused=!0,Oe.media.currentTime=0,$(),Oe.embed.api("getCurrentTime",function(e){Oe.media.currentTime=e,k(Oe.media,"timeupdate")}),Oe.embed.api("getDuration",function(e){Oe.media.duration=e,xe()}),Oe.embed.addEvent("play",function(){Oe.media.paused=!1,k(Oe.media,"play"),k(Oe.media,"playing")}),Oe.embed.addEvent("pause",function(){Oe.media.paused=!0,k(Oe.media,"pause")}),Oe.embed.addEvent("playProgress",function(e){Oe.media.seeking=!1,Oe.media.currentTime=e.seconds,k(Oe.media,"timeupdate")}),Oe.embed.addEvent("loadProgress",function(e){Oe.media.buffered=e.percent,k(Oe.media,"progress"),1===parseInt(e.percent)&&k(Oe.media,"canplaythrough")}),Oe.embed.addEvent("finish",function(){Oe.media.paused=!0,k(Oe.media,"ended")}),h.autoplay&&Oe.embed.api("play")})}function ee(){Oe.embed=e.SC.Widget(this),Oe.embed.bind(e.SC.Widget.Events.READY,function(){Oe.media.play=function(){Oe.embed.play(),Oe.media.paused=!1},Oe.media.pause=function(){Oe.embed.pause(),Oe.media.paused=!0},Oe.media.stop=function(){Oe.embed.seekTo(0),Oe.embed.pause(),Oe.media.paused=!0},Oe.media.paused=!0,Oe.media.currentTime=0,$(),Oe.embed.getPosition(function(e){Oe.media.currentTime=e,k(Oe.media,"timeupdate")}),Oe.embed.getDuration(function(e){Oe.media.duration=e/1e3,xe()}),Oe.embed.bind(e.SC.Widget.Events.PLAY,function(){Oe.media.paused=!1,k(Oe.media,"play"),k(Oe.media,"playing")}),Oe.embed.bind(e.SC.Widget.Events.PAUSE,function(){Oe.media.paused=!0,k(Oe.media,"pause")}),Oe.embed.bind(e.SC.Widget.Events.PLAY_PROGRESS,function(e){Oe.media.seeking=!1,Oe.media.currentTime=e.currentPosition/1e3,k(Oe.media,"timeupdate")}),Oe.embed.bind(e.SC.Widget.Events.LOAD_PROGRESS,function(e){Oe.media.buffered=e.loadProgress,k(Oe.media,"progress"),1===parseInt(e.loadProgress)&&k(Oe.media,"canplaythrough")}),Oe.embed.bind(e.SC.Widget.Events.FINISH,function(){Oe.media.paused=!0,k(Oe.media,"ended")}),h.autoplay&&Oe.embed.play()})}function te(){"play"in Oe.media&&Oe.media.play()}function ne(){"pause"in Oe.media&&Oe.media.pause()}function re(e){e===!0?te():e===!1?ne():Oe.media[Oe.media.paused?"play":"pause"]()}function ae(e){"number"!=typeof e&&(e=h.seekTime),oe(Oe.media.currentTime-e)}function se(e){"number"!=typeof e&&(e=h.seekTime),oe(Oe.media.currentTime+e)}function oe(e){var t=0,n=Oe.media.paused,r=ie();"number"==typeof e?t=e:e.type&&s(["input","change"],e.type)&&(t=e.target.value/e.target.max*r),0>t?t=0:t>r&&(t=r),Ee(t);try{Oe.media.currentTime=t.toFixed(4)}catch(a){}if(s(h.types.embed,Oe.type)){switch(Oe.type){case"youtube":Oe.embed.seekTo(t);break;case"vimeo":Oe.embed.api("seekTo",t.toFixed(0));break;case"soundcloud":Oe.embed.seekTo(1e3*t)}n&&ne(),k(Oe.media,"timeupdate"),Oe.media.seeking=!0}T("Seeking to "+Oe.media.currentTime+" seconds"),O(t)}function ie(){var e=parseInt(h.duration),t=0;return null===Oe.media.duration||isNaN(Oe.media.duration)||(t=Oe.media.duration),isNaN(e)?t:e}function le(){m(Oe.container,h.classes.playing,!Oe.media.paused),m(Oe.container,h.classes.stopped,Oe.media.paused),Ce(Oe.media.paused)}function ue(){N={x:e.pageXOffset||0,y:e.pageYOffset||0}}function ce(){e.scrollTo(N.x,N.y)}function pe(e){var n=M.supportsFullScreen;e&&e.type===M.fullScreenEventName?Oe.isFullscreen=M.isFullScreen(Oe.container):n?(M.isFullScreen(Oe.container)?M.cancelFullScreen():(ue(),M.requestFullScreen(Oe.container)),Oe.isFullscreen=M.isFullScreen(Oe.container)):(Oe.isFullscreen=!Oe.isFullscreen,Oe.isFullscreen?(b(t,"keyup",de),t.body.style.overflow="hidden"):(v(t,"keyup",de),t.body.style.overflow="")),m(Oe.container,h.classes.fullscreen.active,Oe.isFullscreen),Oe.isFullscreen?Oe.container.setAttribute("tabindex","-1"):Oe.container.removeAttribute("tabindex"),Y(Oe.isFullscreen),w(Oe.buttons.fullscreen,Oe.isFullscreen),k(Oe.container,Oe.isFullscreen?"enterfullscreen":"exitfullscreen",!0),!Oe.isFullscreen&&n&&ce()}function de(e){27===(e.which||e.charCode||e.keyCode)&&Oe.isFullscreen&&pe()}function Ae(e){if("boolean"!=typeof e&&(e=!Oe.media.muted),w(Oe.buttons.mute,e),Oe.media.muted=e,0===Oe.media.volume&&me(h.volume),s(h.types.embed,Oe.type)){switch(Oe.type){case"youtube":Oe.embed[Oe.media.muted?"mute":"unMute"]();break;case"vimeo":Oe.embed.api("setVolume",Oe.media.muted?0:parseFloat(h.volume/h.volumeMax));break;case"soundcloud":Oe.embed.setVolume(Oe.media.muted?0:parseFloat(h.volume/h.volumeMax))}k(Oe.media,"volumechange")}}function me(t){var n=h.volumeMax,r=h.volumeMin;if("undefined"==typeof t&&(t=h.volume,h.storage.enabled&&_().supported&&(t=e.localStorage.getItem(h.storage.key),e.localStorage.removeItem("plyr-volume"))),(null===t||isNaN(t))&&(t=h.volume),t>n&&(t=n),r>t&&(t=r),Oe.media.volume=parseFloat(t/n),Oe.volume.display&&(Oe.volume.display.value=t),s(h.types.embed,Oe.type)){switch(Oe.type){case"youtube":Oe.embed.setVolume(100*Oe.media.volume);break;case"vimeo":Oe.embed.api("setVolume",Oe.media.volume);break;case"soundcloud":Oe.embed.setVolume(Oe.media.volume)}k(Oe.media,"volumechange")}Oe.media.muted&&t>0&&Ae()}function fe(){var e=Oe.media.muted?0:Oe.media.volume*h.volumeMax;me(e+h.volumeStep/5)}function ye(){var e=Oe.media.muted?0:Oe.media.volume*h.volumeMax;me(e-h.volumeStep/5)}function be(){var t=Oe.media.muted?0:Oe.media.volume*h.volumeMax;Oe.supported.full&&(Oe.volume.input&&(Oe.volume.input.value=t),Oe.volume.display&&(Oe.volume.display.value=t)),h.storage.enabled&&_().supported&&!isNaN(t)&&e.localStorage.setItem(h.storage.key,t),m(Oe.container,h.classes.muted,0===t),Oe.supported.full&&Oe.buttons.mute&&w(Oe.buttons.mute,0===t)}function ve(e){Oe.supported.full&&Oe.buttons.captions&&("boolean"!=typeof e&&(e=-1===Oe.container.className.indexOf(h.classes.captions.active)),Oe.captionsEnabled=e,w(Oe.buttons.captions,Oe.captionsEnabled),m(Oe.container,h.classes.captions.active,Oe.captionsEnabled),k(Oe.container,Oe.captionsEnabled?"captionsenabled":"captionsdisabled",!0))}function ge(e){var t="waiting"===e.type;clearTimeout(Oe.timers.loading),Oe.timers.loading=setTimeout(function(){m(Oe.container,h.classes.loading,t)},t?250:0)}function he(e){if(Oe.supported.full){var t=Oe.progress.played,n=0,r=ie();if(e)switch(e.type){case"timeupdate":case"seeking":if(Oe.controls.pressed)return;n=x(Oe.media.currentTime,r),"timeupdate"==e.type&&Oe.buttons.seek&&(Oe.buttons.seek.value=n);break;case"playing":case"progress":t=Oe.progress.buffer,n=function(){var e=Oe.media.buffered;return e&&e.length?x(e.end(0),r):"number"==typeof e?100*e:0}()}ke(t,n)}}function ke(e,t){if(Oe.supported.full){if("undefined"==typeof t&&(t=0),"undefined"==typeof e){if(!Oe.progress||!Oe.progress.buffer)return;e=Oe.progress.buffer}e instanceof HTMLElement?e.value=t:e&&(e.bar&&(e.bar.value=t),e.text&&(e.text.innerHTML=t))}}function we(e,t){if(t){isNaN(e)&&(e=0),Oe.secs=parseInt(e%60),Oe.mins=parseInt(e/60%60),Oe.hours=parseInt(e/60/60%60);var n=parseInt(ie()/60/60%60)>0;Oe.secs=("0"+Oe.secs).slice(-2),Oe.mins=("0"+Oe.mins).slice(-2),t.innerHTML=(n?Oe.hours+":":"")+Oe.mins+":"+Oe.secs}}function xe(){if(Oe.supported.full){var e=ie()||0;!Oe.duration&&h.displayDuration&&Oe.media.paused&&we(e,Oe.currentTime),Oe.duration&&we(e,Oe.duration),_e()}}function Te(e){we(Oe.media.currentTime,Oe.currentTime),e&&"timeupdate"==e.type&&Oe.media.seeking||he(e)}function Ee(e){"number"!=typeof e&&(e=0);var t=ie(),n=x(e,t);Oe.progress&&Oe.progress.played&&(Oe.progress.played.value=n),Oe.buttons&&Oe.buttons.seek&&(Oe.buttons.seek.value=n)}function _e(e){var t=ie();if(h.tooltips.seek&&Oe.progress.container&&0!==t){var n=Oe.progress.container.getBoundingClientRect(),r=0,a=h.classes.tooltip+"--visible";if(e)r=100/n.width*(e.pageX-n.left);else{if(!f(Oe.progress.tooltip,a))return;r=Oe.progress.tooltip.style.left.replace("%","")}0>r?r=0:r>100&&(r=100),we(t/100*r,Oe.progress.tooltip),Oe.progress.tooltip.style.left=r+"%",e&&s(["mouseenter","mouseleave"],e.type)&&m(Oe.progress.tooltip,a,"mouseenter"===e.type)}}function Ce(t){if(h.hideControls&&"audio"!==Oe.type){var n=0,r=!1,a=t;if("boolean"!=typeof t&&(t&&t.type?(r="enterfullscreen"===t.type,a=s(["mousemove","touchstart","mouseenter","focus"],t.type),s(["mousemove","touchmove"],t.type)&&(n=2e3),"focus"===t.type&&(n=3e3)):a=f(Oe.container,h.classes.hideControls)),e.clearTimeout(Oe.timers.hover),a||Oe.media.paused){if(m(Oe.container,h.classes.hideControls,!1),Oe.media.paused)return;Oe.browser.isTouch&&(n=3e3)}a&&Oe.media.paused||(Oe.timers.hover=e.setTimeout(function(){(!Oe.controls.pressed&&!Oe.controls.hover||r)&&m(Oe.container,h.classes.hideControls,!0)},n))}}function Se(e){if("undefined"!=typeof e)return void Fe(e);var t;switch(Oe.type){case"youtube":t=Oe.embed.getVideoUrl();break;case"vimeo":Oe.embed.api("getVideoUrl",function(e){t=e});break;case"soundcloud":Oe.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Oe.media.currentSrc}return t||""}function Fe(n){if(!("undefined"!=typeof n&&"sources"in n&&n.sources.length))return void C("Invalid source format");if(ne(),Ee(),ke(),Pe(),"youtube"===Oe.type?(Oe.embed.destroy(),e.clearInterval(Oe.timer.buffering),e.clearInterval(Oe.timer.playing)):"video"===Oe.type&&Oe.videoContainer&&u(Oe.videoContainer),Oe.embed=null,u(Oe.media),"type"in n&&(Oe.type=n.type,"video"===Oe.type)){var r=n.sources[0];"type"in r&&s(h.types.embed,r.type)&&(Oe.type=r.type)}switch(Oe.supported=F(Oe.type),Oe.type){case"video":Oe.media=t.createElement("video");break;case"audio":Oe.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Oe.media=t.createElement("div"),Oe.embedId=n.sources[0].src}c(Oe.container,Oe.media),"undefined"!=typeof n.autoplay&&(h.autoplay=n.autoplay),s(h.types.html5,Oe.type)&&(h.crossorigin&&Oe.media.setAttribute("crossorigin",""),h.autoplay&&Oe.media.setAttribute("autoplay",""),"poster"in n&&Oe.media.setAttribute("poster",n.poster),h.loop&&Oe.media.setAttribute("loop","")),Oe.container.className=Oe.originalClassName,m(Oe.container,h.classes.fullscreen.active,Oe.isFullscreen),m(Oe.container,h.classes.captions.active,Oe.captionsEnabled),D(),s(h.types.html5,Oe.type)&&q("source",n.sources),U(),s(h.types.html5,Oe.type)?("tracks"in n&&q("track",n.tracks),Oe.media.load(),Be(),xe()):s(h.types.embed,Oe.type)&&!Oe.supported.full&&Be(),h.title=n.title,j(),Oe.container.plyr.media=Oe.media}function Ie(e){"video"===Oe.type&&Oe.media.setAttribute("poster",e)}function Me(){function n(){var e=Oe.media.paused;e?te():ne();var t=Oe.buttons[e?"play":"pause"],n=Oe.buttons[e?"pause":"play"];if(n=n&&n.length>1?n[n.length-1]:n[0]){var r=f(t,h.classes.tabFocus);setTimeout(function(){n.focus(),r&&(m(t,h.classes.tabFocus,!1),m(n,h.classes.tabFocus,!0))},100)}}function r(){var e=t.activeElement;e&&e!=t.body?t.querySelector&&(e=t.querySelector(":focus")):e=null;for(var n in Oe.buttons){var r=Oe.buttons[n];if(r instanceof NodeList)for(var a=0;a0)&&(t?ye():fe()),(e.deltaY>0||e.deltaX<0)&&(t?fe():ye())})}function Ne(){if(b(Oe.media,"timeupdate seeking",Te),b(Oe.media,"timeupdate",O),b(Oe.media,"durationchange loadedmetadata",xe),b(Oe.media,"ended",function(){"video"===Oe.type&&B(),le(),oe(0),xe(),"video"===Oe.type&&h.showPosterOnEnd&&Oe.media.load()}),b(Oe.media,"progress playing",he),b(Oe.media,"volumechange",be),b(Oe.media,"play pause",le),b(Oe.media,"waiting canplay seeked",ge),h.clickToPlay&&"audio"!==Oe.type){var e=G("."+h.classes.videoWrapper);if(!e)return;e.style.cursor="pointer",b(e,"click",function(){Oe.browser.isTouch&&!Oe.media.paused||(Oe.media.paused?te():Oe.media.ended?(oe(),te()):ne())})}h.disableContextMenu&&b(Oe.media,"contextmenu",function(e){e.preventDefault()}),b(Oe.media,h.events.join(" "),function(e){k(Oe.container,e.type,!0)})}function Pe(){if(s(h.types.html5,Oe.type)){for(var e=Oe.media.querySelectorAll("source"),t=0;t1)for(var c=0;c
@@ -80,7 +90,6 @@ Plyr extends upon the standard HTML5 markup so that's all you need for those typ
```
#### HTML5 Audio
-
```html
` tag and then call `ply
If you want to use our CDN for the JavaScript, you can use the following:
```html
-
+
```
### CSS
@@ -126,11 +133,11 @@ Include the `plyr.css` stylsheet into your `
`
If you want to use our CDN for the default CSS, you can use the following:
```html
-
+
```
### SVG Sprite
-The SVG sprite is loaded automatically from our CDN. To change this, see the [#options](Options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/1.8.2/plyr.svg`.
+The SVG sprite is loaded automatically from our CDN. To change this, see the [#options](Options) below. For reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/1.8.3/plyr.svg`.
## Advanced
@@ -192,7 +199,6 @@ plyr.setup(options);
Some touch browsers (particularly Mobile Safari on iOS) seem to have issues with `` elements whereby touching the track to set the value doesn't work and sliding the thumb can be tricky. To combat this, I've created [RangeTouch](https://rangetouch.com) which I'd recommend including in your solution. It's a tiny script with a nice benefit for users on touch devices.
#### Options
-
Options must be passed as an object to the `setup()` method as above or as JSON in `data-plyr` attribute on each of your target elements:
```html
@@ -202,176 +208,176 @@ Options must be passed as an object to the `setup()` method as above or as JSON
Note the single quotes encapsulating the JSON and double quotes on the object keys.
-
-
-
Option
-
Type
-
Default
-
Description
-
+
+
+
Option
+
Type
+
Default
+
Description
+
-
-
enabled
-
Boolean
-
true
-
Completely disable Plyr. This would allow you to do a User Agent check or similar to programmatically enable or disable Plyr for a certain UA. Example below.
Toggle which control elements you would like to display when using the default controls html. If you specify a html option, this is redundant. The default value is to display everything.
Used for internationalization (i18n) of the tooltips/labels within the buttons.
-
-
-
loadSprite
-
Boolean
-
true
-
Load the SVG sprite specified as the iconUrl option (if a URL). If false, it is assumed you are handling sprite loading yourself.
-
-
-
iconUrl
-
String
-
null
-
Specify a URL or path to the SVG sprite. See the SVG section for more info.
-
-
-
iconPrefix
-
String
-
plyr
-
Specify the id prefix for the icons used in the default controls (e.g. "plyr-play" would be "plyr"). This is to prevent clashes if you're using your own SVG sprite but with the default controls. Most people can ignore this option.
-
-
-
debug
-
Boolean
-
false
-
Display debugging information on what Plyr is doing.
-
-
-
autoplay
-
Boolean
-
false
-
Autoplay the media on load. This is generally advised against on UX grounds. It is also disabled on iOS (an Apple limitation).
-
-
-
seekTime
-
Number
-
10
-
The time, in seconds, to seek when a user hits fast forward or rewind.
-
-
-
volume
-
Number
-
5
-
A number, between 1 and 10, representing the initial volume of the player.
-
-
-
clickToPlay
-
Boolean
-
true
-
Click (or tap) of the video container will toggle pause/play.
-
-
-
disableContextMenu
-
Boolean
-
true
-
Disable right click menu on video to help as very primitive obfuscation to prevent downloads of content.
-
-
-
hideControls
-
Boolean
-
true
-
Hide video controls automatically after 2s of no mouse or focus movement, on control element blur (tab out), on playback start or entering fullscreen. As soon as the mouse is moved, a control element is focused or playback is paused, the controls reappear instantly.
-
-
-
showPosterOnEnd
-
Boolean
-
false
-
This will restore and *reload* HTML5 video once playback is complete. Note: depending on the browser caching, this may result in the video downloading again (or parts of it). Use with caution.
-
-
-
tooltips
-
Object
-
{ controls: false, seek: true }
-
- controls: Display control labels as tooltips on :hover & :focus (by default, the labels are screen reader only).
-
- seek: Display a seek tooltip to indicate on click where the media would seek to.
-
-
-
-
duration
-
Number
-
null
-
Specify a custom duration.
-
-
-
displayDuration
-
Boolean
-
true
-
Displays the duration of the media on the "metadataloaded" event (on startup) in the current time display. This will only work if the `preload` attribute is not set to `none` (or is not set at all) and you choose not to display the duration (see controls option).
-
-
-
selectors
-
Object
-
—
-
See plyr.js in /src for more info. You probably don't need to change any of these.
-
-
-
listeners
-
Object
-
—
-
Allows early binding of event listeners to the controls. See controls above for list of controls and see plyr.js in /src for more info.
-
-
-
classes
-
Object
-
—
-
Similar to above, these are the classes added to the player when state changes occur.
-
-
-
captions
-
Object
-
—
-
One property defaultActive which toggles if captions should be on by default. The default value is false.
Two properties; enabled which toggles if local storage should be enabled (if the browser supports it). The default value is `true`. This enables storing user settings, currently it only stores volume but more will be added later. The second property key is the key used for the local storage. The default is plyr_volume until more settings are stored.
-
-
+
+
enabled
+
Boolean
+
true
+
Completely disable Plyr. This would allow you to do a User Agent check or similar to programmatically enable or disable Plyr for a certain UA. Example below.
Toggle which control elements you would like to display when using the default controls html. If you specify a html option, this is redundant. The default value is to display everything.
Used for internationalization (i18n) of the tooltips/labels within the buttons.
+
+
+
loadSprite
+
Boolean
+
true
+
Load the SVG sprite specified as the iconUrl option (if a URL). If false, it is assumed you are handling sprite loading yourself.
+
+
+
iconUrl
+
String
+
null
+
Specify a URL or path to the SVG sprite. See the SVG section for more info.
+
+
+
iconPrefix
+
String
+
plyr
+
Specify the id prefix for the icons used in the default controls (e.g. "plyr-play" would be "plyr"). This is to prevent clashes if you're using your own SVG sprite but with the default controls. Most people can ignore this option.
+
+
+
debug
+
Boolean
+
false
+
Display debugging information on what Plyr is doing.
+
+
+
autoplay
+
Boolean
+
false
+
Autoplay the media on load. This is generally advised against on UX grounds. It is also disabled on iOS (an Apple limitation).
+
+
+
seekTime
+
Number
+
10
+
The time, in seconds, to seek when a user hits fast forward or rewind.
+
+
+
volume
+
Number
+
5
+
A number, between 1 and 10, representing the initial volume of the player.
+
+
+
clickToPlay
+
Boolean
+
true
+
Click (or tap) of the video container will toggle pause/play.
+
+
+
disableContextMenu
+
Boolean
+
true
+
Disable right click menu on video to help as very primitive obfuscation to prevent downloads of content.
+
+
+
hideControls
+
Boolean
+
true
+
Hide video controls automatically after 2s of no mouse or focus movement, on control element blur (tab out), on playback start or entering fullscreen. As soon as the mouse is moved, a control element is focused or playback is paused, the controls reappear instantly.
+
+
+
showPosterOnEnd
+
Boolean
+
false
+
This will restore and *reload* HTML5 video once playback is complete. Note: depending on the browser caching, this may result in the video downloading again (or parts of it). Use with caution.
+
+
+
tooltips
+
Object
+
{ controls: false, seek: true }
+
+ controls: Display control labels as tooltips on :hover & :focus (by default, the labels are screen reader only).
+
+ seek: Display a seek tooltip to indicate on click where the media would seek to.
+
+
+
+
duration
+
Number
+
null
+
Specify a custom duration.
+
+
+
displayDuration
+
Boolean
+
true
+
Displays the duration of the media on the "metadataloaded" event (on startup) in the current time display. This will only work if the `preload` attribute is not set to `none` (or is not set at all) and you choose not to display the duration (see controls option).
+
+
+
selectors
+
Object
+
—
+
See plyr.js in /src for more info. You probably don't need to change any of these.
+
+
+
listeners
+
Object
+
—
+
Allows early binding of event listeners to the controls. See controls above for list of controls and see plyr.js in /src for more info.
+
+
+
classes
+
Object
+
—
+
Similar to above, these are the classes added to the player when state changes occur.
+
+
+
captions
+
Object
+
—
+
One property defaultActive which toggles if captions should be on by default. The default value is false.
Two properties; enabled which toggles if local storage should be enabled (if the browser supports it). The default value is `true`. This enables storing user settings, currently it only stores volume but more will be added later. The second property key is the key used for the local storage. The default is plyr_volume until more settings are stored.
+
+
#### Fullscreen options
-
-
-
Option
-
Type
-
Default
-
Description
-
+
+
+
Option
+
Type
+
Default
+
Description
+
@@ -533,7 +539,6 @@ Here's a list of the methods supported:
#### .source() method
-
This allows changing the plyr source and type on the fly.
Video example:
@@ -643,9 +648,7 @@ Some more details on the object parameters
-
## Events
-
You can listen for events on the target element you setup Plyr on (see example under the table). Some events only apply to HTML5 audio and video.
@@ -788,7 +791,6 @@ document.querySelector('.js-plyr').addEventListener('ready', function(event) {
These events also bubble up the DOM.
## Embeds
-
YouTube and Vimeo are currently supported and function much like a HTML5 video. Check the relevant documentation sections for any differences.
Plyr references a custom version of the Vimeo Froogaloop API as Vimeo have neglected to maintain the library and there were bugs with their version. You don't need to worry about including your own versions of the Vimeo or YouTube JavaScript APIs.
@@ -813,8 +815,14 @@ More info on the respective API's here:
*Please note*: not all API methods may work 100%. Your mileage may vary. It's better to use the universal plyr API where possible.
-## Fullscreen
+## Streaming
+Because Plyr is an extension of the standard HTML5 video and audio elements, third party streaming plugins can be used with Plyr. Massive thanks to Matias Russitto ([@russitto](https://github.com/russitto)) for working on this. Here's a few examples:
+- Using [hls.js](https://github.com/dailymotion/hls.js) - [Demo](http://codepen.io/sampotts/pen/JKEMqB)
+- Using [Shaka](https://github.com/google/shaka-player) - [Demo](http://codepen.io/sampotts/pen/zBNpVR)
+- Using [dash.js](https://github.com/Dash-Industry-Forum/dash.js) - [Demo](http://codepen.io/sampotts/pen/BzpJXN)
+
+## Fullscreen
Fullscreen in Plyr is supported by all browsers that [currently support it](http://caniuse.com/#feat=fullscreen). If you're using the default CSS, you can also use a "full browser" mode which will use the full browser window by adding the `plyr-fullscreen` class to your container.
## Browser support
diff --git a/src/js/plyr.js b/src/js/plyr.js
index b7f59405..327cb9fa 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
-// plyr.js v1.8.2
+// plyr.js v1.8.3
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
@@ -44,7 +44,7 @@
displayDuration: true,
loadSprite: true,
iconPrefix: 'plyr',
- iconUrl: 'https://cdn.plyr.io/1.8.2/plyr.svg',
+ iconUrl: 'https://cdn.plyr.io/1.8.3/plyr.svg',
clickToPlay: true,
hideControls: true,
showPosterOnEnd: false,
@@ -253,8 +253,8 @@
isFirefox: isFirefox,
isChrome: isChrome,
isSafari: isSafari,
- ios: /(iPad|iPhone|iPod)/g.test(navigator.platform),
- touch: 'ontouchstart' in document.documentElement
+ isIos: /(iPad|iPhone|iPod)/g.test(navigator.platform),
+ isTouch: 'ontouchstart' in document.documentElement
};
}
@@ -684,9 +684,14 @@
_log(config);
// Debugging
- function _log(text, warn) {
+ function _log() {
if (config.debug && window.console) {
- console[(warn ? 'warn' : 'log')](text);
+ console.log.apply(console, arguments);
+ }
+ }
+ function _warn() {
+ if (config.debug && window.console) {
+ console.warn.apply(console, arguments);
}
}
@@ -694,7 +699,7 @@
function _getIconUrl() {
return {
url: config.iconUrl,
- external: (config.iconUrl.indexOf("http") === 0)
+ absolute: (config.iconUrl.indexOf("http") === 0) || plyr.browser.isIE
};
}
@@ -703,7 +708,7 @@
// Create html array
var html = [],
iconUrl = _getIconUrl(),
- iconPath = (!iconUrl.external ? iconUrl.url : '') + '#' + config.iconPrefix;
+ iconPath = (!iconUrl.absolute ? iconUrl.url : '') + '#' + config.iconPrefix;
// Larger overlaid play button
if (_inArray(config.controls, 'play-large')) {
@@ -1013,7 +1018,7 @@
_log('Successfully loaded the caption file via AJAX');
}
else {
- _log('There was a problem loading the caption file via AJAX', true);
+ _warn('There was a problem loading the caption file via AJAX');
}
}
};
@@ -1206,12 +1211,11 @@
function _injectControls() {
// Sprite
if (config.loadSprite) {
- var iconUrl = _getIconUrl(),
- isExternal = iconUrl.external;
+ var iconUrl = _getIconUrl();
// Only load external sprite using AJAX
- if (isExternal || plyr.browser.isIE) {
- _log('AJAX loading external SVG sprite' + (plyr.browser.isIE ? ' (due to IE)' : ''));
+ if (iconUrl.absolute) {
+ _log('AJAX loading absolute SVG sprite' + (plyr.browser.isIE ? ' (due to IE)' : ''));
loadSprite(iconUrl.url, "sprite-plyr");
}
else {
@@ -1316,7 +1320,7 @@
return true;
}
catch(e) {
- _log('It looks like there is a problem with your controls html', true);
+ _warn('It looks like there is a problem with your controls HTML');
// Restore native video controls
_toggleNativeControls(true);
@@ -1332,7 +1336,7 @@
// Toggle native controls
function _toggleNativeControls(toggle) {
- if (toggle) {
+ if (toggle && _inArray(config.types.html5, plyr.type)) {
plyr.media.setAttribute('controls', '');
}
else {
@@ -1351,7 +1355,7 @@
}
// If there's a play button, set label
- if (plyr.supported.full && plyr.buttons && plyr.buttons.play) {
+ if (plyr.supported.full && plyr.buttons.play) {
for (var i = plyr.buttons.play.length - 1; i >= 0; i--) {
plyr.buttons.play[i].setAttribute('aria-label', label);
}
@@ -1368,8 +1372,8 @@
function _setupMedia() {
// If there's no media, bail
if (!plyr.media) {
- _log('No audio or video element found', true);
- return false;
+ _warn('No media element found!');
+ return;
}
if (plyr.supported.full) {
@@ -1386,10 +1390,10 @@
_toggleClass(plyr.container, config.classes.stopped, config.autoplay);
// Add iOS class
- _toggleClass(plyr.container, config.classes.isIos, plyr.browser.ios);
+ _toggleClass(plyr.container, config.classes.isIos, plyr.browser.isIos);
// Add touch class
- _toggleClass(plyr.container, config.classes.isTouch, plyr.browser.touch);
+ _toggleClass(plyr.container, config.classes.isTouch, plyr.browser.isTouch);
// Inject the player wrapper
if (plyr.type === 'video') {
@@ -1533,8 +1537,10 @@
// Store reference to API
plyr.container.plyr.embed = plyr.embed;
- // Setup the UI
- _setupInterface();
+ // Setup the UI if full support
+ if (plyr.supported.full) {
+ _setupInterface();
+ }
// Set title
_setTitle(_getElement('iframe'));
@@ -1899,7 +1905,7 @@
targetTime = input;
}
// Event
- else if (typeof input === 'object' && (input.type === 'input' || input.type === 'change')) {
+ else if (input.type && _inArray(['input', 'change'], input.type)) {
// It's the seek slider
// Seek to the selected time
targetTime = ((input.target.value / input.target.max) * duration);
@@ -2276,6 +2282,10 @@
// Video playing
case 'timeupdate':
case 'seeking':
+ if (plyr.controls.pressed) {
+ return;
+ }
+
value = _getPercentage(plyr.media.currentTime, duration);
// Set seek range value only if it's a 'natural' time event
@@ -2485,21 +2495,22 @@
if (!config.hideControls || plyr.type === 'audio') {
return;
}
+
var delay = 0,
isEnterFullscreen = false,
show = toggle;
// Default to false if no boolean
- if (typeof toggle !== "boolean") {
+ if (typeof toggle !== 'boolean') {
if (toggle && toggle.type) {
// Is the enter fullscreen event
isEnterFullscreen = (toggle.type === 'enterfullscreen');
// Whether to show controls
- show = _inArray(['mousemove', 'mouseenter', 'focus'], toggle.type);
+ show = _inArray(['mousemove', 'touchstart', 'mouseenter', 'focus'], toggle.type);
- // Delay hiding on mousemove events
- if (toggle.type === 'mousemove') {
+ // Delay hiding on move events
+ if (_inArray(['mousemove', 'touchmove'], toggle.type)) {
delay = 2000;
}
@@ -2509,7 +2520,7 @@
}
}
else {
- show = !_hasClass(plyr.container, config.classes.hideControls);
+ show = _hasClass(plyr.container, config.classes.hideControls);
}
}
@@ -2526,7 +2537,7 @@
}
// Delay for hiding on touch
- if (plyr.browser.touch) {
+ if (plyr.browser.isTouch) {
delay = 3000;
}
}
@@ -2536,7 +2547,7 @@
if (!show || !plyr.media.paused) {
plyr.timers.hover = window.setTimeout(function() {
// If the mouse is over the controls (and not entering fullscreen), bail
- if (plyr.controls.active && !isEnterFullscreen) {
+ if ((plyr.controls.pressed || plyr.controls.hover) && !isEnterFullscreen) {
return;
}
@@ -2584,7 +2595,7 @@
// Sources are not checked for support so be careful
function _updateSource(source) {
if (typeof source === 'undefined' || !('sources' in source) || !source.sources.length) {
- _log('Invalid source format', true);
+ _warn('Invalid source format');
return;
}
@@ -2712,6 +2723,10 @@
// Display duration if available
_displayDuration();
}
+ // If embed but not fully supported, setupInterface now
+ else if (_inArray(config.types.embed, plyr.type) && !plyr.supported.full) {
+ _setupInterface();
+ }
// Set aria title and iframe title
config.title = source.title;
@@ -2857,11 +2872,16 @@
// Toggle controls visibility based on mouse movement
if (config.hideControls) {
// Toggle controls on mouse events and entering fullscreen
- _on(plyr.container, 'mouseenter mouseleave mousemove enterfullscreen', _toggleControls);
+ _on(plyr.container, 'mouseenter mouseleave mousemove touchstart touchend touchcancel touchmove enterfullscreen', _toggleControls);
// Watch for cursor over controls so they don't hide when trying to interact
_on(plyr.controls, 'mouseenter mouseleave', function(event) {
- plyr.controls.active = (event.type === 'mouseenter');
+ plyr.controls.hover = event.type === 'mouseenter';
+ });
+
+ // Watch for cursor over controls so they don't hide when trying to interact
+ _on(plyr.controls, 'mousedown mouseup touchstart touchend touchcancel', function(event) {
+ plyr.controls.pressed = _inArray(['mousedown', 'touchstart'], event.type);
});
// Focus in/out on controls
@@ -2959,8 +2979,8 @@
// On click play, pause ore restart
_on(wrapper, 'click', function() {
- if (plyr.browser.touch && !plyr.media.paused) {
- _toggleControls(true);
+ // Touch devices will just show controls
+ if (plyr.browser.isTouch && !plyr.media.paused) {
return;
}
@@ -3144,6 +3164,10 @@
_play();
}
}
+ // If embed but not fully supported, setupInterface now (to avoid flash of controls)
+ else if (_inArray(config.types.embed, plyr.type) && !plyr.supported.full) {
+ _setupInterface();
+ }
// Successful setup
plyr.init = true;
@@ -3152,7 +3176,7 @@
function _setupInterface() {
// Don't setup interface if no support
if (!plyr.supported.full) {
- _log('No full support for this media type (' + plyr.type + ')', true);
+ _warn('No full support for this media type (' + plyr.type + ')');
// Remove controls
_remove(_getElement(config.selectors.controls.wrapper));
@@ -3277,34 +3301,35 @@
// Check for support
function supported(type) {
- var browser = _browserSniff(),
- oldIE = (browser.isIE && browser.version <= 9),
- iPhone = /iPhone|iPod/i.test(navigator.userAgent),
- audio = !!document.createElement('audio').canPlayType,
- video = !!document.createElement('video').canPlayType,
+ var browser = _browserSniff(),
+ isOldIE = (browser.isIE && browser.version <= 9),
+ isIos = browser.isIos,
+ isIphone = /iPhone|iPod/i.test(navigator.userAgent),
+ audio = !!document.createElement('audio').canPlayType,
+ video = !!document.createElement('video').canPlayType,
basic, full;
switch (type) {
case 'video':
basic = video;
- full = (basic && (!oldIE && !iPhone));
+ full = (basic && (!isOldIE && !isIphone));
break;
case 'audio':
basic = audio;
- full = (basic && !oldIE);
+ full = (basic && !isOldIE);
break;
case 'vimeo':
case 'youtube':
case 'soundcloud':
basic = true;
- full = (!oldIE && !iPhone);
+ full = (!isOldIE && !isIos);
break;
default:
basic = (audio && video);
- full = (basic && !oldIE);
+ full = (basic && !isOldIE);
}
return {
@@ -3429,7 +3454,7 @@
return false;
}
- function CustomEvent (event, params) {
+ function CustomEvent(event, params) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
diff --git a/src/less/plyr.less b/src/less/plyr.less
index d60c281f..4dace8e8 100644
--- a/src/less/plyr.less
+++ b/src/less/plyr.less
@@ -19,6 +19,7 @@
position: relative;
max-width: 100%;
min-width: 200px;
+ overflow: hidden;
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
direction: ltr;
@@ -203,8 +204,8 @@
// Captions
// --------------------------------------------------------------
-// Hide default captions (can't find -moz -ms prefixes)
-.plyr ::-webkit-media-text-track-container {
+// Hide default captions
+.plyr video::-webkit-media-text-track-container {
display: none;
}
.plyr__captions {
@@ -246,9 +247,8 @@
// Controls
// --------------------------------------------------------------
-// Hide default controls (can't find -moz -ms prefixes)
-.plyr ::-webkit-media-controls,
-.plyr ::-webkit-media-controls-enclosure {
+// Hide native controls
+.plyr ::-webkit-media-controls {
display: none;
}
@@ -256,12 +256,9 @@
.plyr__controls {
display: flex;
align-items: center;
-
line-height: 1;
text-align: center;
- transition: opacity .3s ease;
-
// Spacing
> button,
.plyr__progress,
@@ -325,6 +322,7 @@
// Hide controls
.plyr--hide-controls .plyr__controls {
opacity: 0;
+ pointer-events: none;
}
// Video controls
@@ -338,6 +336,7 @@
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
color: @plyr-video-control-color;
+ transition: opacity .3s ease;
button {
// Hover and tab focus
diff --git a/src/scss/plyr.scss b/src/scss/plyr.scss
index 5abe18c0..3f8f2e9e 100644
--- a/src/scss/plyr.scss
+++ b/src/scss/plyr.scss
@@ -19,6 +19,7 @@
position: relative;
max-width: 100%;
min-width: 200px;
+ overflow: hidden;
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
direction: ltr;
@@ -203,8 +204,8 @@
// Captions
// --------------------------------------------------------------
-// Hide default captions (can't find -moz -ms prefixes)
-.plyr ::-webkit-media-text-track-container {
+// Hide default captions
+.plyr video::-webkit-media-text-track-container {
display: none;
}
.plyr__captions {
@@ -246,9 +247,8 @@
// Controls
// --------------------------------------------------------------
-// Hide default controls (can't find -moz -ms prefixes)
-.plyr ::-webkit-media-controls,
-.plyr ::-webkit-media-controls-enclosure {
+// Hide native controls
+.plyr ::-webkit-media-controls {
display: none;
}
@@ -256,12 +256,9 @@
.plyr__controls {
display: flex;
align-items: center;
-
line-height: 1;
text-align: center;
- transition: opacity .3s ease;
-
// Spacing
> button,
.plyr__progress,
@@ -325,6 +322,7 @@
// Hide controls
.plyr--hide-controls .plyr__controls {
opacity: 0;
+ pointer-events: none;
}
// Video controls
@@ -338,6 +336,7 @@
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
color: $plyr-video-control-color;
+ transition: opacity .3s ease;
button {
// Hover and tab focus