diff --git a/.gitignore b/.gitignore index 4a37ad0d..a62b76db 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ node_modules aws.json docs/index.dev.html *.mp4 +index-dev.html notes.txt -npm-debug.log diff --git a/dist/plyr.css b/dist/plyr.css index 3e6de097..846b82c2 100644 --- a/dist/plyr.css +++ b/dist/plyr.css @@ -1 +1 @@ -.plyr__captions,.plyr__controls{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-align:center}.plyr__tooltip,.plyr__video-embed.plyr iframe{pointer-events:none}@-webkit-keyframes plyr-progress{to{background-position:40px 0}}@keyframes plyr-progress{to{background-position:40px 0}}.plyr{position:relative;max-width:100%;min-width:290px;font-family:Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr a,.plyr button,.plyr input,.plyr label{-ms-touch-action:manipulation;touch-action:manipulation}.plyr__sr-only{position:absolute!important;clip:rect(1px,1px,1px,1px);padding:0!important;border:0!important;height:1px!important;width:1px!important;overflow:hidden}.plyr__video-wrapper{position:relative}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle}.plyr video::-webkit-media-text-track-container{display:none}.plyr__video-embed{padding-bottom:56.25%;height:0;overflow:hidden;background:#000}.plyr__video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plyr__video-embed>div{position:relative;padding-bottom:200%;-webkit-transform:translateY(-35.95%);transform:translateY(-35.95%)}.plyr__captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px 20px 30px;color:#fff;font-size:20px}.plyr__captions span{border-radius:2px;padding:3px 10px;background:rgba(0,0,0,.9)}.plyr__captions span:empty{display:none}@media (min-width:768px){.plyr__captions{font-size:24px}}.plyr--captions-active .plyr__captions{display:block}.plyr--fullscreen-active .plyr__captions{font-size:32px}.plyr__controls{position:relative;padding:10px;background:#fff;line-height:1;box-shadow:0 1px 1px rgba(52,63,74,.2)}.plyr__controls::after{content:'';display:table;clear:both}.plyr__controls--right{display:block;margin:10px auto 0}@media (min-width:560px){.plyr__controls--left{float:left}.plyr__controls--right{float:right;margin-top:0}}.plyr__controls button{display:inline-block;vertical-align:middle;margin:0 2px;padding:5px 10px;overflow:hidden;border:0;background:0 0;border-radius:3px;cursor:pointer;color:#6B7D86;transition:background .3s ease,color .3s ease,opacity .3s ease}.plyr__controls button svg{width:18px;height:18px;display:block;fill:currentColor;transition:fill .3s ease}.plyr__controls button.tab-focus:focus,.plyr__controls button:hover{background:#3498DB;color:#fff}.plyr__controls .plyr__time,.plyr__tooltip{color:#6B7D86;font-size:14px;font-weight:600}.plyr__controls button:focus{outline:0}.plyr__controls .icon--captions-on,.plyr__controls .icon--exit-fullscreen,.plyr__controls .icon--muted{display:none}.plyr__controls .plyr__time{display:inline-block;vertical-align:middle;margin-left:10px}.plyr__controls .plyr__time+.plyr__time{display:none}@media (min-width:560px){.plyr__controls .plyr__time+.plyr__time{display:inline-block}}.plyr__controls .plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}.plyr__tooltip{visibility:hidden;position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:10px 15px;opacity:0;background:#fff;box-shadow:0 0 5px rgba(64,64,64,.1),0 0 0 1px rgba(64,64,64,.1);border-radius:3px;line-height:1.5;-webkit-transform:translate(-50%,10px) scale(.8);transform:translate(-50%,10px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:opacity .2s .1s ease,visibility .3s ease,-webkit-transform .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,visibility .3s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,visibility .3s ease,-webkit-transform .2s .1s ease}.plyr__tooltip::after,.plyr__tooltip::before{content:'';position:absolute;width:0;height:0;top:100%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.plyr__tooltip::after{bottom:-8px;border-right:7px solid transparent;border-top:7px solid rgba(64,64,64,.2);border-left:7px solid transparent;z-index:1}.plyr__tooltip::before{bottom:-6px;border-right:6px solid transparent;border-top:6px solid #fff;border-left:6px solid transparent;z-index:2}.plyr button.tab-focus:focus .plyr__tooltip,.plyr button:hover .plyr__tooltip,.plyr__tooltip--visible{visibility:visible;opacity:1;-webkit-transform:translate(-50%,0) scale(1);transform:translate(-50%,0) scale(1)}.plyr button:hover .plyr__tooltip{z-index:3}.plyr input[type=range]::-ms-tooltip{display:none}.plyr input[type=range].tab-focus:focus{outline:rgba(52,63,74,.8) dotted 1px;outline-offset:3px}.plyr__progress--seek[type=range]:focus,.plyr__volume[type=range]:focus{outline:0}.plyr__progress{position:absolute;bottom:100%;left:0;right:0;width:100%;height:10px;background:rgba(86,93,100,.2)}.plyr__progress--buffer[value],.plyr__progress--played[value],.plyr__progress--seek[type=range]{position:absolute;left:0;top:0;width:100%;height:10px;margin:0;padding:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;border:none;background:0 0}.plyr__progress--buffer[value]::-webkit-progress-bar,.plyr__progress--played[value]::-webkit-progress-bar{background:0 0;transition:width .2s ease}.plyr__progress--buffer[value]::-webkit-progress-value,.plyr__progress--played[value]::-webkit-progress-value{background:currentColor;transition:width .2s ease}.plyr__progress--buffer[value]::-moz-progress-bar,.plyr__progress--played[value]::-moz-progress-bar{background:currentColor;transition:width .2s ease}.plyr__progress--played[value]{z-index:2;color:#3498DB}.plyr__progress--buffer[value]{color:rgba(86,93,100,.25)}.plyr__progress--seek[type=range]{z-index:4;cursor:pointer;outline:0}.plyr__progress--seek[type=range]::-webkit-slider-runnable-track{background:0 0;border:0}.plyr__progress--seek[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:0 0;border:0;width:1px;height:10px}.plyr__progress--seek[type=range]::-moz-range-track{background:0 0;border:0}.plyr__progress--seek[type=range]::-moz-range-thumb{-moz-appearance:none;background:0 0;border:0;width:1px;height:10px}.plyr__progress--seek[type=range]::-ms-track{color:transparent;background:0 0;border:0}.plyr__progress--seek[type=range]::-ms-fill-lower,.plyr__progress--seek[type=range]::-ms-fill-upper{background:0 0;border:0}.plyr__progress--seek[type=range]::-ms-thumb{background:0 0;border:0;width:1px;height:10px}.plyr__progress--seek[type=range]::-moz-focus-outer{border:0}.plyr__progress .plyr__tooltip{left:0}.plyr--is-touch .plyr--seek[type=range]::-webkit-slider-thumb{width:40px;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.plyr--is-touch .plyr--seek[type=range]::-moz-range-thumb{width:40px;transform:translateX(-50%)}.plyr--is-touch .plyr--seek[type=range]::-ms-thumb{width:40px;transform:translateX(-50%)}.plyr--loading .plyr__progress--buffer{-webkit-animation:plyr-progress 1s linear infinite;animation:plyr-progress 1s linear infinite;background-size:40px 40px;background-repeat:repeat-x;background-color:rgba(86,93,100,.25);background-image:linear-gradient(-45deg,rgba(0,0,0,.15) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.15) 50%,rgba(0,0,0,.15) 75%,transparent 75%,transparent);color:transparent}.plyr--playing .plyr__controls [data-plyr=play],.plyr__controls [data-plyr=pause]{display:none}.plyr--playing .plyr__controls [data-plyr=pause]{display:inline-block}.plyr__volume[type=range]{display:inline-block;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;width:100px;margin:0 10px 0 0;padding:0;cursor:pointer;background:0 0;border:none}.plyr__volume[type=range]::-webkit-slider-runnable-track{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-3px;height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]::-moz-range-track{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-moz-range-thumb{height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]::-ms-track{height:6px;background:0 0;border-color:transparent;border-width:3px 0;color:transparent}.plyr__volume[type=range]::-ms-fill-lower,.plyr__volume[type=range]::-ms-fill-upper{height:6px;background:#e6e6e6;border:0;border-radius:3px}.plyr__volume[type=range]::-ms-thumb{height:12px;width:12px;background:#6B7D86;border:0;border-radius:100%;transition:background .3s ease;cursor:ew-resize}.plyr__volume[type=range]:focus::-webkit-slider-thumb{background:#3498DB}.plyr__volume[type=range]:focus::-moz-range-thumb{background:#3498DB}.plyr__volume[type=range]:focus::-ms-thumb{background:#3498DB}.plyr--is-ios .plyr__volume,.plyr--is-ios [data-plyr=mute],.plyr--is-ios.plyr--audio .plyr__controls--right{display:none}.plyr--is-ios.plyr--audio .plyr__controls--left{float:none}.plyr--audio .plyr__controls{padding-top:20px}.plyr--audio .plyr__progress{bottom:auto;top:0;background:#D6DADD}.plyr--fullscreen-active,.plyr.plyr--fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000}.plyr--fullscreen-active video,.plyr.plyr--fullscreen video{height:100%}.plyr--fullscreen-active .plyr__video-wrapper,.plyr.plyr--fullscreen .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen-active .plyr__controls,.plyr.plyr--fullscreen .plyr__controls{position:absolute;bottom:0;left:0;right:0}.plyr--fullscreen-active.plyr--fullscreen--hide-controls.plyr--playing .plyr__controls,.plyr.plyr--fullscreen.plyr--fullscreen--hide-controls.plyr--playing .plyr__controls{-webkit-transform:translateY(100%) translateY(5px);transform:translateY(100%) translateY(5px);transition:-webkit-transform .3s .2s ease;transition:transform .3s .2s ease;transition:transform .3s .2s ease,-webkit-transform .3s .2s ease}.plyr--fullscreen-active.plyr--fullscreen--hide-controls.plyr--playing .plyr__captions,.plyr.plyr--fullscreen.plyr--fullscreen--hide-controls.plyr--playing .plyr__captions{bottom:5px;transition:bottom .3s .2s ease}.plyr--fullscreen-active.plyr--fullscreen--hide-controls.plyr--playing.plyr--hover .plyr__controls,.plyr.plyr--fullscreen.plyr--fullscreen--hide-controls.plyr--playing.plyr--hover .plyr__controls{-webkit-transform:translateY(0);transform:translateY(0)}.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions,.plyr--fullscreen-active .plyr__captions,.plyr.plyr--fullscreen .plyr__captions{top:auto;bottom:90px}@media (min-width:560px){.plyr--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions,.plyr--fullscreen-active .plyr__captions,.plyr.plyr--fullscreen .plyr__captions{bottom:60px}}.plyr--captions-active .plyr__controls .icon--captions-on,.plyr--fullscreen-active .icon--exit-fullscreen,.plyr--muted .plyr__controls .icon--muted{display:block}.plyr [data-plyr=fullscreen],.plyr [data-plyr=captions],.plyr--captions-active .plyr__controls .icon--captions-on+svg,.plyr--fullscreen-active .icon--exit-fullscreen+svg,.plyr--muted .plyr__controls .icon--muted+svg{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block} \ No newline at end of file +.plyr .plyr__video-embed iframe,.plyr__tooltip{pointer-events:none}.plyr--hide-controls .plyr__controls,.plyr--playing .plyr__play-large,.plyr__tooltip{visibility:hidden;opacity:0}@-webkit-keyframes plyr-progress{to{background-position:25px 0}}@keyframes plyr-progress{to{background-position:25px 0}}.plyr{position:relative;max-width:100%;min-width:290px;font-family:Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr a,.plyr button,.plyr input,.plyr label{-ms-touch-action:manipulation;touch-action:manipulation}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle;border-radius:inherit}.plyr input[type=range]{display:block;height:16px;width:100%;margin:0;padding:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;background:0 0}.plyr input[type=range]::-webkit-slider-runnable-track{height:8px;background:rgba(255,255,255,.25);border:0;border-radius:4px;-webkit-user-select:none;user-select:none}.plyr input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-moz-range-track{height:8px;background:rgba(255,255,255,.25);border:0;border-radius:4px;-moz-user-select:none;user-select:none}.plyr input[type=range]::-moz-range-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-ms-track{height:8px;background:0 0;border:0;color:transparent}.plyr input[type=range]::-ms-fill-lower,.plyr input[type=range]::-ms-fill-upper{height:8px;background:rgba(255,255,255,.25);border:0;border-radius:4px;-ms-user-select:none;user-select:none}.plyr input[type=range]::-ms-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15);box-sizing:border-box;margin-top:0}.plyr input[type=range]::-ms-tooltip{display:none}.plyr input[type=range]:focus{outline:0}.plyr input[type=range]::-moz-focus-outer{border:0}.plyr input[type=range].tab-focus:focus{outline:rgba(255,255,255,.5) dotted 1px;outline-offset:3px}.plyr input[type=range]:active::-webkit-slider-thumb{background:#63B4E1;border-color:#fff;-webkit-transform:scale(1.25);transform:scale(1.25)}.plyr input[type=range]:active::-moz-range-thumb{background:#63B4E1;border-color:#fff;transform:scale(1.25)}.plyr input[type=range]:active::-ms-thumb{background:#63B4E1;border-color:#fff;transform:scale(1.25)}.plyr__sr-only{position:absolute!important;clip:rect(1px,1px,1px,1px);padding:0!important;border:0!important;height:1px!important;width:1px!important;overflow:hidden}.plyr__video-wrapper{position:relative;background:#000;border-radius:inherit}.plyr__video-embed{padding-bottom:56.25%;height:0;overflow:hidden;border-radius:inherit}.plyr__video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plyr__video-embed>div{position:relative;padding-bottom:200%;-webkit-transform:translateY(-35.95%);transform:translateY(-35.95%)}.plyr video::-webkit-media-text-track-container{display:none}.plyr__captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px 20px 80px;color:#fff;font-size:20px;text-align:center;font-weight:400}.plyr__captions span{border-radius:2px;padding:3px 10px;background:rgba(0,0,0,.85)}.plyr__captions span:empty{display:none}@media (min-width:768px){.plyr__captions{font-size:24px}}.plyr--captions-active .plyr__captions{display:block}.plyr--fullscreen-active .plyr__captions{font-size:32px}.plyr__controls,.plyr__play-large{transition:visibility .3s ease,opacity .3s ease}.plyr__controls{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;line-height:1;text-align:center}.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls>button{margin-left:10px}.plyr__controls .plyr__progress:first-child,.plyr__controls .plyr__time:first-child,.plyr__controls>button:first-child{margin-left:0}.plyr__controls .plyr__volume[type=range]{margin-left:5px}.plyr__controls [data-plyr=pause]{margin-left:0}.plyr__controls button{position:relative;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;vertical-align:middle;padding:5px 10px;border:0;background:0 0;border-radius:3px;cursor:pointer;transition:background .3s ease,color .3s ease,opacity .3s ease;color:inherit}.plyr__controls button svg{width:18px;height:18px;display:block;fill:currentColor}.plyr__controls button:focus{outline:0}.plyr__controls .icon--captions-on,.plyr__controls .icon--exit-fullscreen,.plyr__controls .icon--muted{display:none}.plyr--video .plyr__controls{position:absolute;left:0;right:0;bottom:0;padding:50px 15px 10px;background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.5));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:#fff}.plyr--video .plyr__controls button.tab-focus:focus,.plyr--video .plyr__controls button:hover{background:#63B4E1;color:#fff}.plyr--audio .plyr__controls{padding:10px;border-radius:inherit;background:0 0;color:#565D64}.plyr--audio .plyr__controls button.tab-focus:focus,.plyr--audio .plyr__controls button:hover,.plyr__play-large{background:#63B4E1;color:#fff}.plyr__play-large{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);padding:10px;border:4px solid #fff;border-radius:100%}.plyr__play-large svg{position:relative;left:2px;width:20px;height:20px;display:block;fill:currentColor}.plyr__play-large:focus{outline:rgba(255,255,255,.5) dotted 1px}.plyr--audio .plyr__play-large,.plyr--playing .plyr__controls [data-plyr=play],.plyr__controls [data-plyr=pause]{display:none}.plyr--playing .plyr__controls [data-plyr=pause]{display:inline-block}.plyr--captions-active .plyr__controls .icon--captions-on,.plyr--fullscreen-active .icon--exit-fullscreen,.plyr--muted .plyr__controls .icon--muted{display:block}.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr--captions-active .plyr__controls .icon--captions-on+svg,.plyr--fullscreen-active .icon--exit-fullscreen+svg,.plyr--muted .plyr__controls .icon--muted+svg{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr__time{display:inline-block}.plyr__tooltip{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:5px 7.5px;background:#000;box-shadow:0 0 5px rgba(0,0,0,.1),0 0 0 1px rgba(0,0,0,.1);border-radius:3px;color:#fff;font-size:14px;line-height:1.3;-webkit-transform:translate(-50%,10px) scale(.8);transform:translate(-50%,10px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:opacity .2s .1s ease,visibility .3s ease,-webkit-transform .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,visibility .3s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,visibility .3s ease,-webkit-transform .2s .1s ease}.plyr__tooltip::before{content:'';position:absolute;width:0;height:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:-4px;border-right:4px solid transparent;border-top:4px solid #000;border-left:4px solid transparent;z-index:2}.plyr button.tab-focus:focus .plyr__tooltip,.plyr button:hover .plyr__tooltip,.plyr__tooltip--visible{visibility:visible;opacity:1;-webkit-transform:translate(-50%,0) scale(1);transform:translate(-50%,0) scale(1)}.plyr button:hover .plyr__tooltip{z-index:3}.plyr__progress{position:relative;-webkit-flex:1;-ms-flex:1;flex:1}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress input[type=range]::-webkit-slider-runnable-track{background:0 0}.plyr__progress input[type=range]::-moz-range-track{background:0 0}.plyr__progress input[type=range]::-ms-fill-lower,.plyr__progress input[type=range]::-ms-fill-upper{background:0 0}.plyr__progress .plyr__tooltip{left:0}.plyr__progress--buffer[value],.plyr__progress--played[value]{position:absolute;left:0;top:50%;width:100%;height:8px;margin:-4px 0 0;padding:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:100px}.plyr__progress--buffer[value]::-webkit-progress-bar,.plyr__progress--played[value]::-webkit-progress-bar{background:0 0}.plyr__progress--buffer[value]::-webkit-progress-value,.plyr__progress--played[value]::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer[value]::-moz-progress-bar,.plyr__progress--played[value]::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer[value]::-ms-fill,.plyr__progress--played[value]::-ms-fill{border-radius:100px}.plyr__progress--played[value]{z-index:1;color:#63B4E1;background:0 0}.plyr__progress--played[value]::-webkit-progress-value{min-width:8px;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--played[value]::-moz-progress-bar{min-width:8px;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--played[value]::-ms-fill{min-width:8px;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--buffer[value]{color:rgba(255,255,255,.25);background:rgba(255,255,255,.25)}.plyr__progress--buffer[value]::-webkit-progress-value{transition:width .2s ease}.plyr__progress--buffer[value]::-moz-progress-bar{transition:width .2s ease}.plyr__progress--buffer[value]::-ms-fill{transition:width .2s ease}.plyr--loading .plyr__progress--buffer{-webkit-animation:plyr-progress 1s linear infinite;animation:plyr-progress 1s linear infinite;background-size:25px 25px;background-repeat:repeat-x;background-color:rgba(255,255,255,.25);background-image:linear-gradient(-45deg,rgba(0,0,0,.15) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.15) 50%,rgba(0,0,0,.15) 75%,transparent 75%,transparent);color:transparent}.plyr__time{vertical-align:middle;font-size:14px;line-height:.95}.plyr__time+.plyr__time{display:none}@media (min-width:560px){.plyr__time+.plyr__time{display:inline-block}}.plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}.plyr__volume[type=range]{max-width:100px}.plyr--is-ios .plyr__volume,.plyr--is-ios [data-plyr=mute],.plyr--is-ios.plyr--audio .plyr__controls--right{display:none}.plyr--is-ios.plyr--audio .plyr__controls--left{float:none}.plyr--fullscreen,.plyr--fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000}.plyr--fullscreen video,.plyr--fullscreen-active video{height:100%}.plyr--fullscreen .plyr__video-wrapper,.plyr--fullscreen-active .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen .plyr__controls,.plyr--fullscreen-active .plyr__controls{position:absolute;bottom:0;left:0;right:0} \ No newline at end of file diff --git a/dist/plyr.js b/dist/plyr.js index 81ce46c6..05d5bc15 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -1,2 +1,2 @@ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,document):"function"==typeof define&&define.amd?define(null,function(){t(e,document)}):e.plyr=t(e,document)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(){var e,n,r,a=navigator.userAgent,s=navigator.appName,o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",o="11;"):-1!==(n=a.indexOf("MSIE"))?(s="IE",o=a.substring(n+5)):-1!==(n=a.indexOf("Chrome"))?(s="Chrome",o=a.substring(n+7)):-1!==(n=a.indexOf("Safari"))?(s="Safari",o=a.substring(n+7),-1!==(n=a.indexOf("Version"))&&(o=a.substring(n+8))):-1!==(n=a.indexOf("Firefox"))?(s="Firefox",o=a.substring(n+8)):(e=a.lastIndexOf(" ")+1)<(n=a.lastIndexOf("/"))&&(s=a.substring(e,n),o=a.substring(n+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(r=o.indexOf(";"))&&(o=o.substring(0,r)),-1!==(r=o.indexOf(" "))&&(o=o.substring(0,r)),i=parseInt(""+o,10),isNaN(i)&&(o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10)),{name:s,version:i,ios:/(iPad|iPhone|iPod)/g.test(navigator.platform),touch:"ontouchstart"in t.documentElement}}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 a(e){if(!t.querySelectorAll('script[src="'+e+'"]').length){var n=t.createElement("script");n.src=e;var r=t.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r)}}function s(e,t){return Array.prototype.indexOf&&-1!=e.indexOf(t)}function o(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function i(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,a=e[n],s=a.parentNode,o=a.nextSibling;r.appendChild(a),o?s.insertBefore(r,o):s.appendChild(r)}}function l(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function u(e){e&&e.parentNode.removeChild(e)}function c(e,t){e.insertBefore(t,e.firstChild)}function p(e,t){for(var n in t)e.setAttribute(n,"boolean"==typeof t[n]&&t[n]?"":t[n])}function d(e,n,r){var a=t.createElement(e);p(a,r),c(n,a)}function m(e){return e.replace(".","")}function f(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 y(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className):!1}function b(e,t,n){e&&h(e,t,n,!0)}function v(e,t,n){e&&h(e,t,n,!1)}function g(e,t,n,r){b(e,t,function(t){n&&n.apply(e,[t]),r.apply(e,[t])})}function h(e,t,n,r){var a=t.split(" ");if(e instanceof NodeList)for(var s=0;sr;r++){var a=e[r];for(var s in a)a[s]&&a[s].constructor&&a[s].constructor===Object?(t[s]=t[s]||{},x(t[s],a[s])):t[s]=a[s]}return t}}function _(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof t.cancelFullScreen)e.supportsFullScreen=!0;else for(var r=0,a=n.length;a>r;r++){if(e.prefix=n[r],"undefined"!=typeof t[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof t.msExitFullscreen&&t.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch("undefined"==typeof e&&(e=t.body),this.prefix){case"":return t.fullscreenElement==e;case"moz":return t.mozFullScreenElement==e;default:return t[this.prefix+"FullscreenElement"]==e}},e.requestFullScreen=function(e){return"undefined"==typeof e&&(e=t.body),""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]()},e.cancelFullScreen=function(){return""===this.prefix?t.cancelFullScreen():t[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?t.fullscreenElement:t[this.prefix+"FullscreenElement"]}),e}function C(){var t={supported:function(){if(!("localStorage"in e))return!1;try{e.localStorage.setItem("___test","OK");var t=e.localStorage.getItem("___test");return e.localStorage.removeItem("___test"),"OK"===t}catch(n){return!1}return!1}()};return t}function F(h,x){function F(t,n){x.debug&&e.console&&console[n?"warn":"log"](t)}function A(){var e=['
','
','','','',"0% "+x.i18n.played,"",'',"0% "+x.i18n.buffered,""];return x.tooltips.seek&&e.push('00:00'),e.push("
",''),s(x.controls,"restart")&&e.push('"),s(x.controls,"rewind")&&e.push('"),s(x.controls,"play")&&e.push('",'"),s(x.controls,"fast-forward")&&e.push('"),s(x.controls,"current-time")&&e.push('',''+x.i18n.currentTime+"",'00:00',""),s(x.controls,"duration")&&e.push('',''+x.i18n.duration+"",'00:00',""),e.push("",''),s(x.controls,"mute")&&e.push('"),s(x.controls,"volume")&&e.push('",''),s(x.controls,"captions")&&e.push('"),s(x.controls,"fullscreen")&&e.push('"),e.push("","
"),e.join("")}function N(){if(Ee.supported.full&&("audio"!=Ee.type||x.fullscreen.allowAudio)&&x.fullscreen.enabled){var e=E.supportsFullScreen;e||x.fullscreen.fallback&&!R()?(F((e?"Native":"Fallback")+" fullscreen enabled"),f(Ee.container,x.classes.fullscreen.enabled,!0)):F("Fullscreen not supported and fallback disabled"),w(Ee.buttons.fullscreen,!1),q(),x.fullscreen.hideControls&&f(Ee.container,x.classes.fullscreen.hideControls,!0)}}function I(){if("video"===Ee.type){V(x.selectors.captions)||Ee.videoContainer.insertAdjacentHTML("afterbegin",'
'),Ee.usingTextTracks=!1,Ee.media.textTracks&&(Ee.usingTextTracks=!0);for(var e,t="",n=Ee.media.childNodes,r=0;r=10||"Firefox"===Ee.browser.name&&Ee.browser.version>=31)&&(F("Detected browser with known TextTrack issues - using manual fallback"),Ee.usingTextTracks=!1),Ee.usingTextTracks){F("TextTracks supported");for(var o=0;o ");for(var r=0;rEe.captions.length-1){Ee.subcount=Ee.captions.length-1;break}Ee.media.currentTime.toFixed(1)>=n(Ee.captions[Ee.subcount][0])&&Ee.media.currentTime.toFixed(1)<=r(Ee.captions[Ee.subcount][0])?(Ee.currentCaption=Ee.captions[Ee.subcount][1],P(Ee.currentCaption)):P()}}function M(){Ee.buttons.captions&&(f(Ee.container,x.classes.captions.enabled,!0),x.captions.defaultActive&&(f(Ee.container,x.classes.captions.active,!0),w(Ee.buttons.captions,!0)))}function O(e){return Ee.container.querySelectorAll(e)}function V(e){return O(e)[0]}function R(){try{return e.self!==e.top}catch(t){return!0}}function q(){function e(e){9===e.which&&Ee.isFullscreen&&(e.target!==r||e.shiftKey?e.target===n&&e.shiftKey&&(e.preventDefault(),r.focus()):(e.preventDefault(),n.focus()))}var t=O("input:not([disabled]), button:not([disabled])"),n=t[0],r=t[t.length-1];b(Ee.container,"keydown",e)}function j(e,t){if("string"==typeof t)d(e,Ee.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Ee.media,t[n])}function H(){var e=x.html;F("Injecting custom controls"),e||(e=A()),e=o(e,"{seektime}",x.seekTime),e=o(e,"{id}",Math.floor(1e4*Math.random()));var n;if(null!==x.selectors.controls.container&&(n=x.selectors.controls.container,"string"==typeof selector&&(n=t.querySelector(n))),n instanceof HTMLElement||(n=Ee.container),n.insertAdjacentHTML("beforeend",e),x.tooltips.controls)for(var r=O(x.selectors.labels+" ."+x.classes.hidden),a=r.length-1;a>=0;a--){var s=r[a];f(s,x.classes.hidden,!1),f(s,x.classes.tooltip,!0)}}function W(){try{return Ee.controls=V(x.selectors.controls.wrapper),Ee.buttons={},Ee.buttons.seek=V(x.selectors.buttons.seek),Ee.buttons.play=V(x.selectors.buttons.play),Ee.buttons.pause=V(x.selectors.buttons.pause),Ee.buttons.restart=V(x.selectors.buttons.restart),Ee.buttons.rewind=V(x.selectors.buttons.rewind),Ee.buttons.forward=V(x.selectors.buttons.forward),Ee.buttons.fullscreen=V(x.selectors.buttons.fullscreen),Ee.buttons.volume=V(x.selectors.buttons.volume),Ee.buttons.mute=V(x.selectors.buttons.mute),Ee.buttons.captions=V(x.selectors.buttons.captions),Ee.checkboxes=O('[type="checkbox"]'),Ee.progress={},Ee.progress.container=V(x.selectors.progress.container),Ee.progress.buffer={},Ee.progress.buffer.bar=V(x.selectors.progress.buffer),Ee.progress.buffer.text=Ee.progress.buffer.bar&&Ee.progress.buffer.bar.getElementsByTagName("span")[0],Ee.progress.played={},Ee.progress.played.bar=V(x.selectors.progress.played),Ee.progress.played.text=Ee.progress.played.bar&&Ee.progress.played.bar.getElementsByTagName("span")[0],Ee.progress.tooltip=Ee.progress.container&&Ee.progress.container.querySelector("."+x.classes.tooltip),Ee.volume=V(x.selectors.buttons.volume),Ee.duration=V(x.selectors.duration),Ee.currentTime=V(x.selectors.currentTime),Ee.seekTime=O(x.selectors.seekTime),!0}catch(e){return F("It looks like there is a problem with your controls html",!0),Y(!0),!1}}function D(){f(Ee.container,x.selectors.container.replace(".",""),Ee.supported.full)}function Y(e){e?Ee.media.setAttribute("controls",""):Ee.media.removeAttribute("controls")}function B(e){var t=x.i18n.play;"undefined"!=typeof x.title&&x.title.length&&(t+=", "+x.title),Ee.supported.full&&Ee.buttons.play&&Ee.buttons.play.setAttribute("aria-label",t),e instanceof HTMLElement&&e.setAttribute("title",x.i18n.frameTitle.replace("{title}",x.title))}function $(){if(!Ee.media)return F("No audio or video element found",!0),!1;if(Ee.supported.full&&(f(Ee.container,x.classes.type.replace("{0}",Ee.type),!0),f(Ee.container,x.classes.stopped,x.autoplay),f(Ee.container,x.classes.isIos,Ee.browser.ios),f(Ee.container,x.classes.isTouch,Ee.browser.touch),"video"===Ee.type)){var e=t.createElement("div");e.setAttribute("class",x.classes.videoWrapper),i(Ee.media,e),Ee.videoContainer=e}s(x.types.embed,Ee.type)&&(U(),Ee.embedId=null)}function U(){for(var n=t.createElement("div"),r=Ee.embedId,s=Ee.type+"-"+Math.floor(1e4*Math.random()),o=O('[id^="'+Ee.type+'-"]'),i=o.length-1;i>=0;i--)u(o[i]);if(f(Ee.media,x.classes.videoWrapper,!0),f(Ee.media,x.classes.embedWrapper,!0),"youtube"===Ee.type)Ee.media.appendChild(n),n.setAttribute("id",s),"object"==typeof YT?K(r,n):(a(x.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){K(r,n)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Ee.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,webkitallowfullscreen:"",mozallowfullscreen:"",allowfullscreen:"",frameborder:0}),Ee.supported.full?(n.appendChild(l),Ee.media.appendChild(n)):Ee.media.appendChild(l),"$f"in e||a(x.urls.vimeo.api);var c=e.setInterval(function(){"$f"in e&&l.loaded&&(e.clearInterval(c),X.call(l))},50)}else if("soundcloud"===Ee.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+r,id:s}),n.appendChild(l),Ee.media.appendChild(n),e.SC||a(x.urls.soundcloud.api);var c=e.setInterval(function(){e.SC&&l.loaded&&(e.clearInterval(c),J.call(l))},50)}}function z(){Ee.container.plyr.embed=Ee.embed,Fe(),B(V("iframe"))}function K(t,n){"timer"in Ee||(Ee.timer={}),Ee.embed=new YT.Player(n.id,{videoId:t,playerVars:{autoplay:x.autoplay?1:0,controls:Ee.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:x.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onReady:function(t){var n=t.target;Ee.media.play=function(){n.playVideo(),Ee.media.paused=!1},Ee.media.pause=function(){n.pauseVideo(),Ee.media.paused=!0},Ee.media.stop=function(){n.stopVideo(),Ee.media.paused=!0},Ee.media.duration=n.getDuration(),Ee.media.paused=!0,Ee.media.currentTime=n.getCurrentTime(),Ee.media.muted=n.isMuted(),x.title=n.getVideoData().title,k(Ee.media,"timeupdate"),e.clearInterval(Ee.timer.buffering),Ee.timer.buffering=e.setInterval(function(){Ee.media.buffered=n.getVideoLoadedFraction(),k(Ee.media,"progress"),1===Ee.media.buffered&&(e.clearInterval(Ee.timer.buffering),k(Ee.media,"canplaythrough"))},200),z(),fe()},onStateChange:function(t){var n=t.target;switch(e.clearInterval(Ee.timer.playing),t.data){case 0:Ee.media.paused=!0,k(Ee.media,"ended");break;case 1:Ee.media.paused=!1,Ee.media.seeking=!1,k(Ee.media,"play"),k(Ee.media,"playing"),Ee.timer.playing=e.setInterval(function(){Ee.media.currentTime=n.getCurrentTime(),k(Ee.media,"timeupdate")},100);break;case 2:Ee.media.paused=!0,k(Ee.media,"pause")}}}})}function X(){Ee.embed=$f(this),Ee.embed.addEvent("ready",function(){Ee.media.play=function(){Ee.embed.api("play"),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.api("pause"),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.api("stop"),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.api("getCurrentTime",function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.api("getDuration",function(e){Ee.media.duration=e,fe()}),Ee.embed.addEvent("play",function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.addEvent("pause",function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.addEvent("playProgress",function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.seconds,k(Ee.media,"timeupdate")}),Ee.embed.addEvent("loadProgress",function(e){Ee.media.buffered=e.percent,k(Ee.media,"progress"),1===parseInt(e.percent)&&k(Ee.media,"canplaythrough")}),Ee.embed.addEvent("finish",function(){Ee.media.paused=!0,k(Ee.media,"ended")}),x.autoplay&&Ee.embed.api("play")})}function J(){Ee.embed=SC.Widget(this),Ee.embed.bind(SC.Widget.Events.READY,function(){Ee.media.play=function(){Ee.embed.play(),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.pause(),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.seekTo(0),Ee.embed.pause(),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.getPosition(function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.getDuration(function(e){Ee.media.duration=e/1e3,fe()}),Ee.embed.bind(SC.Widget.Events.PLAY,function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.bind(SC.Widget.Events.PAUSE,function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.bind(SC.Widget.Events.PLAY_PROGRESS,function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.currentPosition/1e3,k(Ee.media,"timeupdate")}),Ee.embed.bind(SC.Widget.Events.LOAD_PROGRESS,function(e){Ee.media.buffered=e.loadProgress,k(Ee.media,"progress"),1===parseInt(e.loadProgress)&&k(Ee.media,"canplaythrough")}),Ee.embed.bind(SC.Widget.Events.FINISH,function(){Ee.media.paused=!0,k(Ee.media,"ended")}),x.autoplay&&Ee.embed.play()})}function G(){"play"in Ee.media&&Ee.media.play()}function Q(){"pause"in Ee.media&&Ee.media.pause()}function Z(e){e===!0?G():e===!1?Q():Ee.media[Ee.media.paused?"play":"pause"]()}function ee(e){"number"!=typeof e&&(e=x.seekTime),ne(Ee.media.currentTime-e)}function te(e){"number"!=typeof e&&(e=x.seekTime),ne(Ee.media.currentTime+e)}function ne(e){var t=0,n=Ee.media.paused,r=re();"number"==typeof e?t=e:"object"!=typeof e||"input"!==e.type&&"change"!==e.type||(t=e.target.value/e.target.max*r),0>t?t=0:t>r&&(t=r);try{Ee.media.currentTime=t.toFixed(1)}catch(a){}if(s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.seekTo(t);break;case"vimeo":Ee.embed.api("seekTo",t.toFixed(0));break;case"soundcloud":Ee.embed.seekTo(1e3*t)}n&&Q(),k(Ee.media,"timeupdate"),Ee.media.seeking=!0}F("Seeking to "+Ee.media.currentTime+" seconds"),L(t)}function re(){var e=parseInt(x.duration);return isNaN(e)?Ee.media.duration:e}function ae(){f(Ee.container,x.classes.playing,!Ee.media.paused),f(Ee.container,x.classes.stopped,Ee.media.paused)}function se(e){var n=E.supportsFullScreen;e&&e.type===E.fullScreenEventName?Ee.isFullscreen=E.isFullScreen(Ee.container):n?(E.isFullScreen(Ee.container)?E.cancelFullScreen():E.requestFullScreen(Ee.container),Ee.isFullscreen=E.isFullScreen(Ee.container)):(Ee.isFullscreen=!Ee.isFullscreen,Ee.isFullscreen?(b(t,"keyup",oe),t.body.style.overflow="hidden"):(v(t,"keyup",oe),t.body.style.overflow="")),f(Ee.container,x.classes.fullscreen.active,Ee.isFullscreen),Ee.isFullscreen?Ee.container.setAttribute("tabindex","-1"):Ee.container.removeAttribute("tabindex"),q(Ee.isFullscreen),w(Ee.buttons.fullscreen,Ee.isFullscreen),x.fullscreen.hideControls&&ve(!0),k(Ee.container,Ee.isFullscreen?"enterfullscreen":"exitfullscreen")}function oe(e){27===(e.which||e.charCode||e.keyCode)&&Ee.isFullscreen&&se()}function ie(e){if("boolean"!=typeof e&&(e=!Ee.media.muted),w(Ee.buttons.mute,e),Ee.media.muted=e,s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed[Ee.media.muted?"mute":"unMute"]();break;case"vimeo":Ee.embed.api("setVolume",Ee.media.muted?0:parseFloat(x.volume/10));break;case"soundcloud":Ee.embed.setVolume(Ee.media.muted?0:parseFloat(x.volume/10))}k(Ee.media,"volumechange")}}function le(t){if("undefined"==typeof t&&(t=x.volume,x.storage.enabled&&C().supported&&(t=e.localStorage.getItem(x.storage.key),e.localStorage.removeItem("plyr-volume"))),(null===t||isNaN(t))&&(t=x.volume),t>10&&(t=10),0>t&&(t=0),Ee.media.volume=parseFloat(t/10),x.volume=t,s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.setVolume(100*Ee.media.volume);break;case"vimeo":Ee.embed.api("setVolume",Ee.media.volume);break;case"soundcloud":Ee.embed.setVolume(Ee.media.volume)}k(Ee.media,"volumechange")}Ee.media.muted&&t>0&&ie()}function ue(){var t=Ee.media.muted?0:10*Ee.media.volume;Ee.supported.full&&Ee.volume&&(Ee.volume.value=t),x.storage.enabled&&C().supported&&!isNaN(t)&&e.localStorage.setItem(x.storage.key,t),f(Ee.container,x.classes.muted,0===t),Ee.supported.full&&Ee.buttons.mute&&w(Ee.buttons.mute,0===t)}function ce(e){Ee.supported.full&&Ee.buttons.captions&&("boolean"!=typeof e&&(e=-1===Ee.container.className.indexOf(x.classes.captions.active)),Ee.captionsEnabled=e,w(Ee.buttons.captions,Ee.captionsEnabled),f(Ee.container,x.classes.captions.active,Ee.captionsEnabled),k(Ee.container,Ee.captionsEnabled?"captionsenabled":"captionsdisabled"))}function pe(e){var t="waiting"===e.type;clearTimeout(Ee.timers.loading),Ee.timers.loading=setTimeout(function(){f(Ee.container,x.classes.loading,t)},t?250:0)}function de(e){var t=Ee.progress.played.bar,n=Ee.progress.played.text,r=0,a=re();if(e)switch(e.type){case"timeupdate":case"seeking":r=T(Ee.media.currentTime,a),"timeupdate"==e.type&&Ee.buttons.seek&&(Ee.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=Ee.progress.buffer.bar,n=Ee.progress.buffer.text,r=function(){var e=Ee.media.buffered;return e&&e.length?T(e.end(0),a):"number"==typeof e?100*e:0}()}t&&(t.value=r),n&&(n.innerHTML=r)}function me(e,t){if(t){isNaN(e)&&(e=0),Ee.secs=parseInt(e%60),Ee.mins=parseInt(e/60%60),Ee.hours=parseInt(e/60/60%60);var n=parseInt(re()/60/60%60)>0;Ee.secs=("0"+Ee.secs).slice(-2),Ee.mins=("0"+Ee.mins).slice(-2),t.innerHTML=(n?Ee.hours+":":"")+Ee.mins+":"+Ee.secs}}function fe(){if(Ee.supported.full){var e=re()||0;!Ee.duration&&x.displayDuration&&Ee.media.paused&&me(e,Ee.currentTime),Ee.duration&&me(e,Ee.duration),be()}}function ye(e){me(Ee.media.currentTime,Ee.currentTime),e&&"timeupdate"==e.type&&Ee.media.seeking||de(e)}function be(e){if(x.tooltips.seek&&!Ee.browser.touch){var t=Ee.progress.container.getBoundingClientRect(),n=0,r=x.classes.tooltip+"--visible";if(e)n=100/t.width*(e.pageX-t.left);else{if(!y(Ee.progress.tooltip,r))return;n=Ee.progress.tooltip.style.left.replace("%","")}0>n?n=0:n>100&&(n=100),me(re()/100*n,Ee.progress.tooltip),Ee.progress.tooltip.style.left=n+"%",e&&s(["mouseenter","mouseleave"],e.type)&&f(Ee.progress.tooltip,r,"mouseenter"===e.type)}}function ve(t){Ee.isFullscreen&&(f(Ee.container,x.classes.hover,!0),e.clearTimeout(Ee.timers.hover),Ee.timers.hover=e.setTimeout(function(){Ee.controls.mouseover&&t!==!0||f(Ee.container,x.classes.hover,!1)},2e3))}function ge(e){if("undefined"!=typeof e)return void he(e);var t;switch(Ee.type){case"youtube":t=Ee.embed.getVideoUrl();break;case"vimeo":Ee.embed.api("getVideoUrl",function(e){t=e});break;case"soundcloud":Ee.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Ee.media.currentSrc}return t||""}function he(n){if(!("undefined"!=typeof n&&"sources"in n&&n.sources.length))return void F("Invalid source format",!0);if(Q(),"youtube"===Ee.type?(Ee.embed.destroy(),e.clearInterval(Ee.timer.buffering),e.clearInterval(Ee.timer.playing)):"video"===Ee.type&&Ee.videoContainer&&u(Ee.videoContainer),Ee.embed=null,xe(),u(Ee.media),"type"in n&&(Ee.type=n.type,"video"===Ee.type)){var r=n.sources[0];"type"in r&&s(x.types.embed,r.type)&&(Ee.type=r.type)}switch(Ee.supported=S.supported(Ee.type),Ee.type){case"video":Ee.media=t.createElement("video");break;case"audio":Ee.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Ee.media=t.createElement("div"),Ee.embedId=n.sources[0].src}c(Ee.container,Ee.media),"undefined"!=typeof n.autoplay&&(x.autoplay=n.autoplay),s(x.types.html5,Ee.type)&&(x.crossorigin&&Ee.media.setAttribute("crossorigin",""),x.autoplay&&Ee.media.setAttribute("autoplay",""),"poster"in n&&Ee.media.setAttribute("poster",n.poster),x.loop&&Ee.media.setAttribute("loop","")),Ee.container.className=Ee.originalClassName,f(Ee.container,x.classes.fullscreen.active,Ee.isFullscreen),f(Ee.container,x.classes.captions.active,Ee.captionsEnabled),D(),s(x.types.html5,Ee.type)&&j("source",n.sources),$(),s(x.types.html5,Ee.type)&&("tracks"in n&&j("track",n.tracks),Ee.media.load(),Fe(),fe()),x.title=n.title,B(),Ee.container.plyr.media=Ee.media}function ke(e){"video"===Ee.type&&Ee.media.setAttribute("poster",e)}function we(){function n(){var e=Ee.media.paused;e?G():Q();var t=Ee.buttons[e?"play":"pause"],n=Ee.buttons[e?"pause":"play"];if(n){var r=y(t,x.classes.tabFocus);setTimeout(function(){n.focus(),r&&(f(t,x.classes.tabFocus,!1),f(n,x.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 Ee.buttons){var r=Ee.buttons[n];f(r,x.classes.tabFocus,r===e)}}var a="IE"==Ee.browser.name?"change":"input";b(e,"keyup",function(e){var t=e.keyCode?e.keyCode:e.which;9==t&&r()}),b(t.body,"click",function(){f(V("."+x.classes.tabFocus),x.classes.tabFocus,!1)});for(var s in Ee.buttons){var o=Ee.buttons[s];b(o,"blur",function(){f(o,"tab-focus",!1)})}g(Ee.buttons.play,"click",x.listeners.play,n),g(Ee.buttons.pause,"click",x.listeners.pause,n),g(Ee.buttons.restart,"click",x.listeners.restart,ne),g(Ee.buttons.rewind,"click",x.listeners.rewind,ee),g(Ee.buttons.forward,"click",x.listeners.forward,te),g(Ee.buttons.seek,a,x.listeners.seek,ne),g(Ee.volume,a,x.listeners.volume,function(){le(Ee.volume.value)}),g(Ee.buttons.mute,"click",x.listeners.mute,ie),g(Ee.buttons.fullscreen,"click",x.listeners.fullscreen,se),E.supportsFullScreen&&b(t,E.fullScreenEventName,se),b(Ee.buttons.captions,"click",ce),b(Ee.progress.container,"mouseenter mouseleave mousemove",be);x.fullscreen.hideControls&&b(Ee.controls,"mouseenter mouseleave",function(e){Ee.controls.mouseover="mouseenter"===e.type})}function Te(){b(Ee.media,"timeupdate seeking",ye),b(Ee.media,"timeupdate",L),b(Ee.media,"durationchange loadedmetadata",fe),b(Ee.media,"ended",function(){"video"===Ee.type&&P(),ae()}),b(Ee.media,"progress playing",de),b(Ee.media,"volumechange",ue),b(Ee.media,"play pause",ae),b(Ee.media,"waiting canplay seeked",pe),x.click&&b(Ee.media,"click",function(){Ee.media.paused?G():Ee.media.ended?(ne(),G()):Q()}),x.fullscreen.hideControls&&b(Ee.media,"mousemove",ve),b(Ee.media,x.events.join(" "),function(e){k(Ee.container,e.type)})}function xe(){if(s(x.types.html5,Ee.type)){Ee.media.setAttribute("src","");for(var e=Ee.media.querySelectorAll("source"),t=0;t=0;n--){var a=n>0?t.cloneNode(!0):t,r=e[n],s=r.parentNode,o=r.nextSibling;a.appendChild(r),o?s.insertBefore(a,o):s.appendChild(a)}}function l(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function u(e){e&&e.parentNode.removeChild(e)}function c(e,t){e.insertBefore(t,e.firstChild)}function p(e,t){for(var n in t)e.setAttribute(n,"boolean"==typeof t[n]&&t[n]?"":t[n])}function d(e,n,a){var r=t.createElement(e);p(r,a),c(n,r)}function m(e){return e.replace(".","")}function f(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=a+(n?" "+t:"")}}function y(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className):!1}function b(e,t,n){e&&h(e,t,n,!0)}function v(e,t,n){e&&h(e,t,n,!1)}function g(e,t,n,a){b(e,t,function(t){n&&n.apply(e,[t]),a.apply(e,[t])})}function h(e,t,n,a){var r=t.split(" ");if(e instanceof NodeList)for(var s=0;sa;a++){var r=e[a];for(var s in r)r[s]&&r[s].constructor&&r[s].constructor===Object?(t[s]=t[s]||{},x(t[s],r[s])):t[s]=r[s]}return t}}function _(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof t.cancelFullScreen)e.supportsFullScreen=!0;else for(var a=0,r=n.length;r>a;a++){if(e.prefix=n[a],"undefined"!=typeof t[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof t.msExitFullscreen&&t.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch("undefined"==typeof e&&(e=t.body),this.prefix){case"":return t.fullscreenElement==e;case"moz":return t.mozFullScreenElement==e;default:return t[this.prefix+"FullscreenElement"]==e}},e.requestFullScreen=function(e){return"undefined"==typeof e&&(e=t.body),""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]()},e.cancelFullScreen=function(){return""===this.prefix?t.cancelFullScreen():t[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?t.fullscreenElement:t[this.prefix+"FullscreenElement"]}),e}function C(){var t={supported:function(){if(!("localStorage"in e))return!1;try{e.localStorage.setItem("___test","OK");var t=e.localStorage.getItem("___test");return e.localStorage.removeItem("___test"),"OK"===t}catch(n){return!1}return!1}()};return t}function F(h,x){function F(t,n){x.debug&&e.console&&console[n?"warn":"log"](t)}function A(){var e=[];return s(x.controls,"play-large")&&e.push('"),e.push('
'),s(x.controls,"restart")&&e.push('"),s(x.controls,"rewind")&&e.push('"),s(x.controls,"play")&&e.push('",'"),s(x.controls,"fast-forward")&&e.push('"),s(x.controls,"progress")&&(e.push('','','','',"0% "+x.i18n.played,"",'',"0% "+x.i18n.buffered,""),x.tooltips.seek&&e.push('00:00'),e.push("")),s(x.controls,"current-time")&&e.push('',''+x.i18n.currentTime+"",'00:00',""),s(x.controls,"duration")&&e.push('',''+x.i18n.duration+"",'00:00',""),s(x.controls,"mute")&&e.push('"),s(x.controls,"volume")&&e.push('",''),s(x.controls,"captions")&&e.push('"),s(x.controls,"fullscreen")&&e.push('"),e.push("
"),e.join("")}function N(){if(Ee.supported.full&&("audio"!=Ee.type||x.fullscreen.allowAudio)&&x.fullscreen.enabled){var e=E.supportsFullScreen;e||x.fullscreen.fallback&&!R()?(F((e?"Native":"Fallback")+" fullscreen enabled"),f(Ee.container,x.classes.fullscreen.enabled,!0)):F("Fullscreen not supported and fallback disabled"),w(Ee.buttons.fullscreen,!1),q()}}function P(){if("video"===Ee.type){V(x.selectors.captions)||Ee.videoContainer.insertAdjacentHTML("afterbegin",'
'),Ee.usingTextTracks=!1,Ee.media.textTracks&&(Ee.usingTextTracks=!0);for(var e,t="",n=Ee.media.childNodes,a=0;a=10||"Firefox"===Ee.browser.name&&Ee.browser.version>=31)&&(F("Detected browser with known TextTrack issues - using manual fallback"),Ee.usingTextTracks=!1),Ee.usingTextTracks){F("TextTracks supported");for(var o=0;o ");for(var a=0;aEe.captions.length-1){Ee.subcount=Ee.captions.length-1;break}Ee.media.currentTime.toFixed(1)>=n(Ee.captions[Ee.subcount][0])&&Ee.media.currentTime.toFixed(1)<=a(Ee.captions[Ee.subcount][0])?(Ee.currentCaption=Ee.captions[Ee.subcount][1],I(Ee.currentCaption)):I()}}function M(){Ee.buttons.captions&&(f(Ee.container,x.classes.captions.enabled,!0),x.captions.defaultActive&&(f(Ee.container,x.classes.captions.active,!0),w(Ee.buttons.captions,!0)))}function O(e){return Ee.container.querySelectorAll(e)}function V(e){return O(e)[0]}function R(){try{return e.self!==e.top}catch(t){return!0}}function q(){function e(e){9===e.which&&Ee.isFullscreen&&(e.target!==a||e.shiftKey?e.target===n&&e.shiftKey&&(e.preventDefault(),a.focus()):(e.preventDefault(),n.focus()))}var t=O("input:not([disabled]), button:not([disabled])"),n=t[0],a=t[t.length-1];b(Ee.container,"keydown",e)}function j(e,t){if("string"==typeof t)d(e,Ee.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Ee.media,t[n])}function H(){var e=x.html;F("Injecting custom controls"),e||(e=A()),e=o(e,"{seektime}",x.seekTime),e=o(e,"{id}",Math.floor(1e4*Math.random()));var n;if(null!==x.selectors.controls.container&&(n=x.selectors.controls.container,"string"==typeof selector&&(n=t.querySelector(n))),n instanceof HTMLElement||(n=Ee.container),n.insertAdjacentHTML("beforeend",e),x.tooltips.controls)for(var a=O([x.selectors.controls.wrapper," ",x.selectors.labels," .",x.classes.hidden].join("")),r=a.length-1;r>=0;r--){var s=a[r];f(s,x.classes.hidden,!1),f(s,x.classes.tooltip,!0)}}function W(){try{return Ee.controls=V(x.selectors.controls.wrapper),Ee.buttons={},Ee.buttons.seek=V(x.selectors.buttons.seek),Ee.buttons.play=O(x.selectors.buttons.play),Ee.buttons.pause=V(x.selectors.buttons.pause),Ee.buttons.restart=V(x.selectors.buttons.restart),Ee.buttons.rewind=V(x.selectors.buttons.rewind),Ee.buttons.forward=V(x.selectors.buttons.forward),Ee.buttons.fullscreen=V(x.selectors.buttons.fullscreen),Ee.buttons.volume=V(x.selectors.buttons.volume),Ee.buttons.mute=V(x.selectors.buttons.mute),Ee.buttons.captions=V(x.selectors.buttons.captions),Ee.checkboxes=O('[type="checkbox"]'),Ee.progress={},Ee.progress.container=V(x.selectors.progress.container),Ee.progress.buffer={},Ee.progress.buffer.bar=V(x.selectors.progress.buffer),Ee.progress.buffer.text=Ee.progress.buffer.bar&&Ee.progress.buffer.bar.getElementsByTagName("span")[0],Ee.progress.played={},Ee.progress.played.bar=V(x.selectors.progress.played),Ee.progress.played.text=Ee.progress.played.bar&&Ee.progress.played.bar.getElementsByTagName("span")[0],Ee.progress.tooltip=Ee.progress.container&&Ee.progress.container.querySelector("."+x.classes.tooltip),Ee.volume=V(x.selectors.buttons.volume),Ee.duration=V(x.selectors.duration),Ee.currentTime=V(x.selectors.currentTime),Ee.seekTime=O(x.selectors.seekTime),!0}catch(e){return F("It looks like there is a problem with your controls html",!0),Y(!0),!1}}function D(){f(Ee.container,x.selectors.container.replace(".",""),Ee.supported.full)}function Y(e){e?Ee.media.setAttribute("controls",""):Ee.media.removeAttribute("controls")}function B(e){var t=x.i18n.play;if("undefined"!=typeof x.title&&x.title.length&&(t+=", "+x.title),Ee.supported.full&&Ee.buttons.play)for(var n=Ee.buttons.play.length-1;n>=0;n--)Ee.buttons.play[n].setAttribute("aria-label",t);e instanceof HTMLElement&&e.setAttribute("title",x.i18n.frameTitle.replace("{title}",x.title))}function $(){if(!Ee.media)return F("No audio or video element found",!0),!1;if(Ee.supported.full&&(f(Ee.container,x.classes.type.replace("{0}",Ee.type),!0),s(x.types.embed,Ee.type)&&f(Ee.container,x.classes.type.replace("{0}","video"),!0),f(Ee.container,x.classes.stopped,x.autoplay),f(Ee.container,x.classes.isIos,Ee.browser.ios),f(Ee.container,x.classes.isTouch,Ee.browser.touch),"video"===Ee.type)){var e=t.createElement("div");e.setAttribute("class",x.classes.videoWrapper),i(Ee.media,e),Ee.videoContainer=e}s(x.types.embed,Ee.type)&&(U(),Ee.embedId=null)}function U(){for(var n=t.createElement("div"),a=Ee.embedId,s=Ee.type+"-"+Math.floor(1e4*Math.random()),o=O('[id^="'+Ee.type+'-"]'),i=o.length-1;i>=0;i--)u(o[i]);if(f(Ee.media,x.classes.videoWrapper,!0),f(Ee.media,x.classes.embedWrapper,!0),"youtube"===Ee.type)Ee.media.appendChild(n),n.setAttribute("id",s),"object"==typeof YT?K(a,n):(r(x.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){K(a,n)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Ee.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://player.vimeo.com/video/"+a+"?player_id="+s+"&api=1&badge=0&byline=0&portrait=0&title=0",id:s,webkitallowfullscreen:"",mozallowfullscreen:"",allowfullscreen:"",frameborder:0}),Ee.supported.full?(n.appendChild(l),Ee.media.appendChild(n)):Ee.media.appendChild(l),"$f"in e||r(x.urls.vimeo.api);var c=e.setInterval(function(){"$f"in e&&l.loaded&&(e.clearInterval(c),X.call(l))},50)}else if("soundcloud"===Ee.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+a,id:s}),n.appendChild(l),Ee.media.appendChild(n),e.SC||r(x.urls.soundcloud.api);var c=e.setInterval(function(){e.SC&&l.loaded&&(e.clearInterval(c),J.call(l))},50)}}function z(){Ee.container.plyr.embed=Ee.embed,Fe(),B(V("iframe"))}function K(t,n){"timer"in Ee||(Ee.timer={}),Ee.embed=new YT.Player(n.id,{videoId:t,playerVars:{autoplay:x.autoplay?1:0,controls:Ee.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:x.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onReady:function(t){var n=t.target;Ee.media.play=function(){n.playVideo(),Ee.media.paused=!1},Ee.media.pause=function(){n.pauseVideo(),Ee.media.paused=!0},Ee.media.stop=function(){n.stopVideo(),Ee.media.paused=!0},Ee.media.duration=n.getDuration(),Ee.media.paused=!0,Ee.media.currentTime=n.getCurrentTime(),Ee.media.muted=n.isMuted(),x.title=n.getVideoData().title,k(Ee.media,"timeupdate"),e.clearInterval(Ee.timer.buffering),Ee.timer.buffering=e.setInterval(function(){Ee.media.buffered=n.getVideoLoadedFraction(),k(Ee.media,"progress"),1===Ee.media.buffered&&(e.clearInterval(Ee.timer.buffering),k(Ee.media,"canplaythrough"))},200),z(),fe()},onStateChange:function(t){var n=t.target;switch(e.clearInterval(Ee.timer.playing),t.data){case 0:Ee.media.paused=!0,k(Ee.media,"ended");break;case 1:Ee.media.paused=!1,Ee.media.seeking=!1,k(Ee.media,"play"),k(Ee.media,"playing"),Ee.timer.playing=e.setInterval(function(){Ee.media.currentTime=n.getCurrentTime(),k(Ee.media,"timeupdate")},100);break;case 2:Ee.media.paused=!0,k(Ee.media,"pause")}}}})}function X(){Ee.embed=$f(this),Ee.embed.addEvent("ready",function(){Ee.media.play=function(){Ee.embed.api("play"),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.api("pause"),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.api("stop"),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.api("getCurrentTime",function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.api("getDuration",function(e){Ee.media.duration=e,fe()}),Ee.embed.addEvent("play",function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.addEvent("pause",function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.addEvent("playProgress",function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.seconds,k(Ee.media,"timeupdate")}),Ee.embed.addEvent("loadProgress",function(e){Ee.media.buffered=e.percent,k(Ee.media,"progress"),1===parseInt(e.percent)&&k(Ee.media,"canplaythrough")}),Ee.embed.addEvent("finish",function(){Ee.media.paused=!0,k(Ee.media,"ended")}),x.autoplay&&Ee.embed.api("play")})}function J(){Ee.embed=SC.Widget(this),Ee.embed.bind(SC.Widget.Events.READY,function(){Ee.media.play=function(){Ee.embed.play(),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.pause(),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.seekTo(0),Ee.embed.pause(),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.getPosition(function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.getDuration(function(e){Ee.media.duration=e/1e3,fe()}),Ee.embed.bind(SC.Widget.Events.PLAY,function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.bind(SC.Widget.Events.PAUSE,function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.bind(SC.Widget.Events.PLAY_PROGRESS,function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.currentPosition/1e3,k(Ee.media,"timeupdate")}),Ee.embed.bind(SC.Widget.Events.LOAD_PROGRESS,function(e){Ee.media.buffered=e.loadProgress,k(Ee.media,"progress"),1===parseInt(e.loadProgress)&&k(Ee.media,"canplaythrough")}),Ee.embed.bind(SC.Widget.Events.FINISH,function(){Ee.media.paused=!0,k(Ee.media,"ended")}),x.autoplay&&Ee.embed.play()})}function G(){"play"in Ee.media&&Ee.media.play()}function Q(){"pause"in Ee.media&&Ee.media.pause()}function Z(e){e===!0?G():e===!1?Q():Ee.media[Ee.media.paused?"play":"pause"]()}function ee(e){"number"!=typeof e&&(e=x.seekTime),ne(Ee.media.currentTime-e)}function te(e){"number"!=typeof e&&(e=x.seekTime),ne(Ee.media.currentTime+e)}function ne(e){var t=0,n=Ee.media.paused,a=ae();"number"==typeof e?t=e:"object"!=typeof e||"input"!==e.type&&"change"!==e.type||(t=e.target.value/e.target.max*a),0>t?t=0:t>a&&(t=a);try{Ee.media.currentTime=t.toFixed(1)}catch(r){}if(s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.seekTo(t);break;case"vimeo":Ee.embed.api("seekTo",t.toFixed(0));break;case"soundcloud":Ee.embed.seekTo(1e3*t)}n&&Q(),k(Ee.media,"timeupdate"),Ee.media.seeking=!0}F("Seeking to "+Ee.media.currentTime+" seconds"),L(t)}function ae(){var e=parseInt(x.duration);return isNaN(e)?Ee.media.duration:e}function re(){f(Ee.container,x.classes.playing,!Ee.media.paused),f(Ee.container,x.classes.stopped,Ee.media.paused),ve(Ee.media.paused)}function se(e){var n=E.supportsFullScreen;e&&e.type===E.fullScreenEventName?Ee.isFullscreen=E.isFullScreen(Ee.container):n?(E.isFullScreen(Ee.container)?E.cancelFullScreen():E.requestFullScreen(Ee.container),Ee.isFullscreen=E.isFullScreen(Ee.container)):(Ee.isFullscreen=!Ee.isFullscreen,Ee.isFullscreen?(b(t,"keyup",oe),t.body.style.overflow="hidden"):(v(t,"keyup",oe),t.body.style.overflow="")),f(Ee.container,x.classes.fullscreen.active,Ee.isFullscreen),Ee.isFullscreen?Ee.container.setAttribute("tabindex","-1"):Ee.container.removeAttribute("tabindex"),q(Ee.isFullscreen),w(Ee.buttons.fullscreen,Ee.isFullscreen),k(Ee.container,Ee.isFullscreen?"enterfullscreen":"exitfullscreen")}function oe(e){27===(e.which||e.charCode||e.keyCode)&&Ee.isFullscreen&&se()}function ie(e){if("boolean"!=typeof e&&(e=!Ee.media.muted),w(Ee.buttons.mute,e),Ee.media.muted=e,s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed[Ee.media.muted?"mute":"unMute"]();break;case"vimeo":Ee.embed.api("setVolume",Ee.media.muted?0:parseFloat(x.volume/10));break;case"soundcloud":Ee.embed.setVolume(Ee.media.muted?0:parseFloat(x.volume/10))}k(Ee.media,"volumechange")}}function le(t){if("undefined"==typeof t&&(t=x.volume,x.storage.enabled&&C().supported&&(t=e.localStorage.getItem(x.storage.key),e.localStorage.removeItem("plyr-volume"))),(null===t||isNaN(t))&&(t=x.volume),t>10&&(t=10),0>t&&(t=0),Ee.media.volume=parseFloat(t/10),x.volume=t,s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.setVolume(100*Ee.media.volume);break;case"vimeo":Ee.embed.api("setVolume",Ee.media.volume);break;case"soundcloud":Ee.embed.setVolume(Ee.media.volume)}k(Ee.media,"volumechange")}Ee.media.muted&&t>0&&ie()}function ue(){var t=Ee.media.muted?0:10*Ee.media.volume;Ee.supported.full&&Ee.volume&&(Ee.volume.value=t),x.storage.enabled&&C().supported&&!isNaN(t)&&e.localStorage.setItem(x.storage.key,t),f(Ee.container,x.classes.muted,0===t),Ee.supported.full&&Ee.buttons.mute&&w(Ee.buttons.mute,0===t)}function ce(e){Ee.supported.full&&Ee.buttons.captions&&("boolean"!=typeof e&&(e=-1===Ee.container.className.indexOf(x.classes.captions.active)),Ee.captionsEnabled=e,w(Ee.buttons.captions,Ee.captionsEnabled),f(Ee.container,x.classes.captions.active,Ee.captionsEnabled),k(Ee.container,Ee.captionsEnabled?"captionsenabled":"captionsdisabled"))}function pe(e){var t="waiting"===e.type;clearTimeout(Ee.timers.loading),Ee.timers.loading=setTimeout(function(){f(Ee.container,x.classes.loading,t)},t?250:0)}function de(e){var t=Ee.progress.played.bar,n=Ee.progress.played.text,a=0,r=ae();if(e)switch(e.type){case"timeupdate":case"seeking":a=T(Ee.media.currentTime,r),"timeupdate"==e.type&&Ee.buttons.seek&&(Ee.buttons.seek.value=a);break;case"change":case"input":a=e.target.value;break;case"playing":case"progress":t=Ee.progress.buffer.bar,n=Ee.progress.buffer.text,a=function(){var e=Ee.media.buffered;return e&&e.length?T(e.end(0),r):"number"==typeof e?100*e:0}()}t&&(t.value=a),n&&(n.innerHTML=a)}function me(e,t){if(t){isNaN(e)&&(e=0),Ee.secs=parseInt(e%60),Ee.mins=parseInt(e/60%60),Ee.hours=parseInt(e/60/60%60);var n=parseInt(ae()/60/60%60)>0;Ee.secs=("0"+Ee.secs).slice(-2),Ee.mins=("0"+Ee.mins).slice(-2),t.innerHTML=(n?Ee.hours+":":"")+Ee.mins+":"+Ee.secs}}function fe(){if(Ee.supported.full){var e=ae()||0;!Ee.duration&&x.displayDuration&&Ee.media.paused&&me(e,Ee.currentTime),Ee.duration&&me(e,Ee.duration),be()}}function ye(e){me(Ee.media.currentTime,Ee.currentTime),e&&"timeupdate"==e.type&&Ee.media.seeking||de(e)}function be(e){if(x.tooltips.seek&&!Ee.browser.touch){var t=Ee.progress.container.getBoundingClientRect(),n=0,a=x.classes.tooltip+"--visible";if(e)n=100/t.width*(e.pageX-t.left);else{if(!y(Ee.progress.tooltip,a))return;n=Ee.progress.tooltip.style.left.replace("%","")}0>n?n=0:n>100&&(n=100),me(ae()/100*n,Ee.progress.tooltip),Ee.progress.tooltip.style.left=n+"%",e&&s(["mouseenter","mouseleave"],e.type)&&f(Ee.progress.tooltip,a,"mouseenter"===e.type)}}function ve(t){if(x.hideControls&&"audio"!==Ee.type){var n=!1,a=!1,r=t;"boolean"!=typeof t&&(t&&t.type?(n="mousemove"===t.type,a="enterfullscreen"===t.type,r=s(["mousemove","mouseenter"],t.type)):r=!1),e.clearTimeout(Ee.timers.hover),(r||Ee.media.paused)&&(f(Ee.container,x.classes.hideControls,!1),Ee.media.paused)||r&&Ee.media.paused||(Ee.timers.hover=e.setTimeout(function(){Ee.controls.active&&!a||f(Ee.container,x.classes.hideControls,!0)},n?2e3:0))}}function ge(e){if("undefined"!=typeof e)return void he(e);var t;switch(Ee.type){case"youtube":t=Ee.embed.getVideoUrl();break;case"vimeo":Ee.embed.api("getVideoUrl",function(e){t=e});break;case"soundcloud":Ee.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Ee.media.currentSrc}return t||""}function he(n){if(!("undefined"!=typeof n&&"sources"in n&&n.sources.length))return void F("Invalid source format",!0);if(Q(),Ee.buttons.seek&&(Ee.buttons.seek.value=0),"youtube"===Ee.type?(Ee.embed.destroy(),e.clearInterval(Ee.timer.buffering),e.clearInterval(Ee.timer.playing)):"video"===Ee.type&&Ee.videoContainer&&u(Ee.videoContainer),Ee.embed=null,xe(),u(Ee.media),"type"in n&&(Ee.type=n.type,"video"===Ee.type)){var a=n.sources[0];"type"in a&&s(x.types.embed,a.type)&&(Ee.type=a.type)}switch(Ee.supported=S.supported(Ee.type),Ee.type){case"video":Ee.media=t.createElement("video");break;case"audio":Ee.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Ee.media=t.createElement("div"),Ee.embedId=n.sources[0].src}c(Ee.container,Ee.media),"undefined"!=typeof n.autoplay&&(x.autoplay=n.autoplay),s(x.types.html5,Ee.type)&&(x.crossorigin&&Ee.media.setAttribute("crossorigin",""),x.autoplay&&Ee.media.setAttribute("autoplay",""),"poster"in n&&Ee.media.setAttribute("poster",n.poster),x.loop&&Ee.media.setAttribute("loop","")),Ee.container.className=Ee.originalClassName,f(Ee.container,x.classes.fullscreen.active,Ee.isFullscreen),f(Ee.container,x.classes.captions.active,Ee.captionsEnabled),D(),s(x.types.html5,Ee.type)&&j("source",n.sources),$(),s(x.types.html5,Ee.type)&&("tracks"in n&&j("track",n.tracks),Ee.media.load(),Fe(),fe()),x.title=n.title,B(),Ee.container.plyr.media=Ee.media}function ke(e){"video"===Ee.type&&Ee.media.setAttribute("poster",e)}function we(){function n(){var e=Ee.media.paused;e?G():Q();var t=Ee.buttons[e?"play":"pause"],n=Ee.buttons[e?"pause":"play"];if(n){var a=y(t,x.classes.tabFocus);setTimeout(function(){n.focus(),a&&(f(t,x.classes.tabFocus,!1),f(n,x.classes.tabFocus,!0))},100)}}function a(){var e=t.activeElement;e&&e!=t.body?t.querySelector&&(e=t.querySelector(":focus")):e=null;for(var n in Ee.buttons){var a=Ee.buttons[n];f(a,x.classes.tabFocus,a===e)}}var r="IE"==Ee.browser.name?"change":"input";b(e,"keyup",function(e){var t=e.keyCode?e.keyCode:e.which;9==t&&a()}),b(t.body,"click",function(){f(V("."+x.classes.tabFocus),x.classes.tabFocus,!1)});for(var s in Ee.buttons){var o=Ee.buttons[s];b(o,"blur",function(){f(o,"tab-focus",!1)})}g(Ee.buttons.play,"click",x.listeners.play,n),g(Ee.buttons.pause,"click",x.listeners.pause,n),g(Ee.buttons.restart,"click",x.listeners.restart,ne),g(Ee.buttons.rewind,"click",x.listeners.rewind,ee),g(Ee.buttons.forward,"click",x.listeners.forward,te),g(Ee.buttons.seek,r,x.listeners.seek,ne),g(Ee.volume,r,x.listeners.volume,function(){le(Ee.volume.value)}),g(Ee.buttons.mute,"click",x.listeners.mute,ie),g(Ee.buttons.fullscreen,"click",x.listeners.fullscreen,se),E.supportsFullScreen&&b(t,E.fullScreenEventName,se),b(Ee.buttons.captions,"click",ce),b(Ee.progress.container,"mouseenter mouseleave mousemove",be),x.hideControls&&(b(Ee.container,"mouseenter mouseleave mousemove",ve),b(Ee.container,"enterfullscreen",ve),b(Ee.controls,"mouseenter mouseleave",function(e){Ee.controls.active="mouseenter"===e.type}))}function Te(){b(Ee.media,"timeupdate seeking",ye),b(Ee.media,"timeupdate",L),b(Ee.media,"durationchange loadedmetadata",fe),b(Ee.media,"ended",function(){"video"===Ee.type&&I(),re()}),b(Ee.media,"progress playing",de),b(Ee.media,"volumechange",ue),b(Ee.media,"play pause",re),b(Ee.media,"waiting canplay seeked",pe),x.clickToPlay&&(Ee.videoContainer.style.cursor="pointer",b(Ee.media,"click",function(){Ee.media.paused?G():Ee.media.ended?(ne(),G()):Q()})),b(Ee.media,x.events.join(" "),function(e){k(Ee.container,e.type)})}function xe(){if(s(x.types.html5,Ee.type)){Ee.media.setAttribute("src","");for(var e=Ee.media.querySelectorAll("source"),t=0;t \ No newline at end of file + \ No newline at end of file diff --git a/docs/dist/docs.css b/docs/dist/docs.css index 9eecd4e3..1de7278b 100644 --- a/docs/dist/docs.css +++ b/docs/dist/docs.css @@ -1 +1 @@ -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */a.logo,img,legend{border:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,small,summary{display:block}[hidden],template{display:none}body,figure,li,ul{margin:0}body,h1,h2{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}body,small{padding:0 10px}li,nav ul,ul{list-style:none;padding:0}legend,li,nav ul,ul{padding:0}.btn__bar,sub,sup{position:relative}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:0 0;text-decoration:none;color:#3498db;border-bottom:1px dotted currentColor;transition:background .3s ease,color .3s ease,border .3s ease}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}.btn__bar,nav li{white-space:nowrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}.btn__bar::before,.btn__count::before{content:"";top:50%}sub{bottom:-.25em}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@-webkit-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-medium.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-medium.woff) format("woff");font-style:normal;font-weight:400}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-bold.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-bold.woff) format("woff");font-style:normal;font-weight:600}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2}h1{font-size:64px;font-size:4rem;color:#3498DB}p,small{margin:0 0 20px}small{font-size:14px;font-size:.875rem}a:focus,a:hover{color:#343f4a;border-bottom-color:transparent}a:focus{outline:#343f4a dotted thin;outline-offset:1px}.color--vimeo{color:#19b7ed}.color--youtube{color:#cc181e}*,::after,::before{box-sizing:border-box}.btn__bar ul,nav li{display:inline-block}html{height:100%;font-size:100%;background:linear-gradient(#fff,#f2f5f7) fixed}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.5;text-align:center;color:#55646b}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.125rem}section{padding-bottom:20px}@media (min-width:480px){header{padding-top:60px;padding-bottom:60px}section{padding-bottom:40px}}.icon{fill:currentColor;width:18px;height:18px;vertical-align:-3px}a svg,button svg,label svg{pointer-events:none}.btn .icon,a .icon{margin-right:10px}.btn:not(.btn-large) .icon{width:16px;height:16px}nav ul{margin:0;font-size:0}nav li{margin-top:10px;font-size:16px;font-size:1rem}nav li+li{margin-left:20px}.btn__bar{margin:0 auto 20px;max-width:1200px}.btn__bar::before{position:absolute;left:0;right:0;height:1px;background:#dbe3e8}.btn__bar ul{position:relative;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn__bar li{margin:0}.btn__bar li:first-child .btn{border-radius:4px 0 0 4px}.btn__bar li:last-child .btn{border-radius:0 4px 4px 0}.btn__bar li+li .btn{margin-left:-1px}.btn__bar li.active .btn{position:relative;z-index:1}.btn__bar li.active .btn .icon{color:inherit}.btn__bar li.active+li .btn:hover{z-index:0}.btn__bar .btn{position:relative;display:block;border-radius:0}.btn__bar .btn:focus,.btn__bar .btn:hover{z-index:1}@media (min-width:560px){.btn__bar{margin-bottom:40px}}.btn,.btn__count{display:inline-block;vertical-align:middle;border-radius:4px;font-weight:600;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn{padding:10px 12px;background:linear-gradient(#f8fafb,#e9eef1);border:1px solid #cbd0d3;box-shadow:0 1px 1px rgba(0,0,0,.05);text-shadow:0 1px 1px #fff;color:#55646b;transition:background .1s ease,color .1s ease;font-size:14px;font-size:.875rem}.btn:focus,.btn:hover{border-color:#b5bcc0;color:#55646b;outline:0}.btn--large{padding:10px 20px;font-size:16px;font-size:1rem}.btn--primary,.btn__bar li.active .btn{background-image:linear-gradient(#3498db,#258cd1);background-color:#3498db;border-color:#217dbb;box-shadow:0 1px 1px rgba(0,0,0,.15);text-shadow:0 1px 1px rgba(0,0,0,.1);color:#fff}.btn--primary:focus,.btn--primary:hover{color:#fff;border-color:#196090}.btn--youtube .icon{color:#cc181e}.btn--vimeo .icon{color:#19b7ed}.btn--twitter .icon{color:#4BAAF4}.btn__count{position:relative;margin-left:10px;padding:10px 15px;background:#fff;border:1px solid #cbd0d3}.btn__count::before{position:absolute;display:block;width:8px;height:8px;left:1px;margin-top:-4px;background:inherit;border:inherit;border-width:1px 0 0 1px;-webkit-transform:rotate(-45deg) translate(-50%,-50%);transform:rotate(-45deg) translate(-50%,-50%)}.error body,html.error{height:100%}.error body{width:100%;display:table;table-layout:fixed}.error main{display:table-cell;width:100%;vertical-align:middle}section{margin:0 auto 20px;max-width:1200px}.plyr__video-embed,video{border-radius:4px;max-width:100%;vertical-align:middle}.plyr__video-embed{-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.plyr{margin:0 auto}.plyr__controls{border-radius:0 0 4px 4px}.plyr .plyr__video-embed,.plyr video{border-radius:4px 4px 0 0}.plyr--fullscreen,.plyr--fullscreen-active{max-width:none}.plyr--fullscreen .plyr-controls,.plyr--fullscreen iframe,.plyr--fullscreen video,.plyr--fullscreen-active .plyr-controls,.plyr--fullscreen-active iframe,.plyr--fullscreen-active video{border-radius:0}.plyr--fullscreen iframe,.plyr--fullscreen-active iframe{-webkit-mask-image:none}.plyr--audio{max-width:520px}.plyr--audio .plyr__controls{border-radius:4px}.plyr--audio .plyr__progress{border-radius:4px 4px 0 0}.plyr--audio .plyr__progress [type=range],.plyr--audio .plyr__progress progress{border-radius:4px 4px 0 0;overflow:hidden}.plyr__cite{display:none;margin-top:20px}.plyr__cite .icon{margin-right:5px}.plyr--audio~ul .plyr__cite--audio,.plyr--video~ul .plyr__cite--video,.plyr--vimeo~ul .plyr__cite--vimeo,.plyr--youtube~ul .plyr__cite--youtube{display:block} \ No newline at end of file +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */a.logo,img,legend{border:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,small,summary{display:block}body,small{padding:0 10px}body,figure,li,ul{margin:0}[hidden],template{display:none}li,nav ul,ul{list-style:none;padding:0}legend,li,nav ul,ul{padding:0}.btn__bar,sub,sup{position:relative}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:0 0;text-decoration:none;color:#3498db;border-bottom:1px dotted currentColor;transition:background .3s ease,color .3s ease,border .3s ease}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}.btn__bar,nav li{white-space:nowrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}.btn__bar::before,.btn__count::before{content:"";top:50%}sub{bottom:-.25em}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@-webkit-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}html{font-size:100%;height:100%;background:linear-gradient(#fff,#f2f5f7) fixed}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.5;text-align:center;color:#55646b;font-weight:500}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:700}h1{font-size:64px;font-size:4rem;color:#3498DB}p,small{margin:0 0 20px}small{font-size:14px;font-size:.875rem}a:focus,a:hover{color:#343f4a;border-bottom-color:transparent}a:focus{outline:#343f4a dotted thin;outline-offset:1px}.color--vimeo{color:#19b7ed}.color--youtube{color:#cc181e}*,::after,::before{box-sizing:border-box}.btn__bar ul,nav li{display:inline-block}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.125rem}section{padding-bottom:20px}@media (min-width:480px){header{padding-top:60px;padding-bottom:60px}section{padding-bottom:40px}}.icon{fill:currentColor;width:18px;height:18px;vertical-align:-3px}a svg,button svg,label svg{pointer-events:none}.btn .icon,a .icon{margin-right:10px}.btn:not(.btn-large) .icon{width:16px;height:16px}nav ul{margin:0;font-size:0}nav li{margin-top:10px;font-size:16px;font-size:1rem}nav li+li{margin-left:20px}.btn__bar{margin:0 auto 20px;max-width:1200px}.btn__bar::before{position:absolute;left:0;right:0;height:1px;background:#dbe3e8}.btn__bar ul{position:relative;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn__bar li{margin:0}.btn__bar li:first-child .btn{border-radius:4px 0 0 4px}.btn__bar li:last-child .btn{border-radius:0 4px 4px 0}.btn__bar li+li .btn{margin-left:-1px}.btn__bar li.active .btn{position:relative;z-index:1}.btn__bar li.active .btn .icon{color:inherit}.btn__bar li.active+li .btn:hover{z-index:0}.btn__bar .btn{position:relative;display:block;border-radius:0}.btn__bar .btn:focus,.btn__bar .btn:hover{z-index:1}@media (min-width:560px){.btn__bar{margin-bottom:40px}}.btn,.btn__count{display:inline-block;vertical-align:middle;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn{padding:10px 12px;background:linear-gradient(#f8fafb,#e9eef1);border:1px solid #cbd0d3;box-shadow:0 1px 1px rgba(0,0,0,.05);text-shadow:0 1px 1px #fff;color:#55646b;transition:background .1s ease,color .1s ease;font-size:14px;font-size:.875rem}.btn:focus,.btn:hover{border-color:#b5bcc0;color:#55646b;outline:0}.btn--large{padding:10px 20px;font-size:16px;font-size:1rem}.btn--primary,.btn__bar li.active .btn{background-image:linear-gradient(#3498db,#258cd1);background-color:#3498db;border-color:#217dbb;box-shadow:0 1px 1px rgba(0,0,0,.15);text-shadow:0 1px 1px rgba(0,0,0,.1);color:#fff}.btn--primary:focus,.btn--primary:hover{color:#fff;border-color:#196090}.btn--youtube .icon{color:#cc181e}.btn--vimeo .icon{color:#19b7ed}.btn--twitter .icon{color:#4BAAF4}.btn__count{position:relative;margin-left:10px;padding:10px 15px;background:#fff;border:1px solid #cbd0d3}.btn__count::before{position:absolute;display:block;width:8px;height:8px;left:1px;margin-top:-4px;background:inherit;border:inherit;border-width:1px 0 0 1px;-webkit-transform:rotate(-45deg) translate(-50%,-50%);transform:rotate(-45deg) translate(-50%,-50%)}.error body,html.error{height:100%}.error body{width:100%;display:table;table-layout:fixed}.error main{display:table-cell;width:100%;vertical-align:middle}section{margin:0 auto 20px;max-width:1200px}.plyr__video-embed,video{max-width:100%;vertical-align:middle}.plyr__video-embed{-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.plyr{margin:0 auto;border-radius:4px}.plyr--fullscreen,.plyr--fullscreen-active{max-width:none}.plyr--fullscreen .plyr-controls,.plyr--fullscreen iframe,.plyr--fullscreen video,.plyr--fullscreen-active .plyr-controls,.plyr--fullscreen-active iframe,.plyr--fullscreen-active video{border-radius:0}.plyr--fullscreen iframe,.plyr--fullscreen-active iframe{-webkit-mask-image:none}.plyr--audio{max-width:520px}.plyr__cite{display:none;margin-top:20px}.plyr__cite .icon{margin-right:5px}.plyr--audio~ul .plyr__cite--audio,.plyr--video~ul .plyr__cite--video,.plyr--vimeo~ul .plyr__cite--vimeo,.plyr--youtube~ul .plyr__cite--youtube{display:block} \ No newline at end of file diff --git a/docs/dist/docs.js b/docs/dist/docs.js index 4f99df3d..3cc174d5 100644 --- a/docs/dist/docs.js +++ b/docs/dist/docs.js @@ -1 +1 @@ -"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,n=arguments.length;for(i=0;n>i;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",n=e.Element[i],s=Object,o=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=o.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],n=0,s=i.length;s>n;n++)this.push(i[n]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,i=0,n=t.length,s=!1;do e=t[i]+"",-1===c(this,e)&&(this.push(e),s=!0);while(++i=0;a--)e(i[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}for(var i=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},s=window.location.hash.replace("#",""),o=window.history&&window.history.pushState,r=i.length-1;r>=0;r--)i[r].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),o&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),o){var a=!s.length;a&&(s=n.video),s in n&&history.replaceState({type:s},"",a?"":"#"+s),s!==n.video&&t(s,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,n,s,o,r){e.GoogleAnalyticsObject=s,e[s]=e[s]||function(){(e[s].q=e[s].q||[]).push(arguments)},e[s].l=1*new Date,o=t.createElement(i),r=t.getElementsByTagName(i)[0],o.async=1,o.src=n,r.parentNode.insertBefore(o,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview")); \ No newline at end of file +"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,n=arguments.length;for(i=0;n>i;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",n=e.Element[i],s=Object,o=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=o.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],n=0,s=i.length;s>n;n++)this.push(i[n]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,i=0,n=t.length,s=!1;do e=t[i]+"",-1===c(this,e)&&(this.push(e),s=!0);while(++i=0;a--)e(i[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}for(var i=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},s=window.location.hash.replace("#",""),o=window.history&&window.history.pushState,r=i.length-1;r>=0;r--)i[r].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),o&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),o){var a=!s.length;a&&(s=n.video),s in n&&history.replaceState({type:s},"",a?"":"#"+s),s!==n.video&&t(s,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,n,s,o,r){e.GoogleAnalyticsObject=s,e[s]=e[s]||function(){(e[s].q=e[s].q||[]).push(arguments)},e[s].l=1*new Date,o=t.createElement(i),r=t.getElementsByTagName(i)[0],o.async=1,o.src=n,r.parentNode.insertBefore(o,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview")); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e518e692..2e6dbde0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -118,10 +118,11 @@ - - - + + + + diff --git a/docs/src/js/docs.js b/docs/src/js/docs.js index 8ec66bb4..11cd6ac6 100644 --- a/docs/src/js/docs.js +++ b/docs/src/js/docs.js @@ -2,7 +2,7 @@ // Docs example // ========================================================================== -/*global plyr, shr*/ +/*global plyr*/ // Setup the player plyr.setup('.js-media-player', { @@ -16,13 +16,6 @@ plyr.setup('.js-media-player', { } }); -// Setup shr -shr.setup({ - count: { - classname: 'btn__count' - } -}); - // General functions (function() { var buttons = document.querySelectorAll('[data-source]'), diff --git a/docs/src/less/components/base.less b/docs/src/less/components/base.less index b4e5ddf1..05b5fb52 100644 --- a/docs/src/less/components/base.less +++ b/docs/src/less/components/base.less @@ -16,15 +16,9 @@ // Base html { height: 100%; - font-size: 100%; background: linear-gradient(#fff, @body-background) fixed; } body { - font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif; - line-height: 1.5; - text-align: center; - color: @gray; - .font-smoothing(on); padding: 0 (@padding-base / 2); } diff --git a/docs/src/less/components/buttons.less b/docs/src/less/components/buttons.less index 26c9fcd2..7970a861 100644 --- a/docs/src/less/components/buttons.less +++ b/docs/src/less/components/buttons.less @@ -92,7 +92,6 @@ nav { display: inline-block; vertical-align: middle; border-radius: @border-radius-base; - font-weight: 600; user-select: none; } diff --git a/docs/src/less/components/examples.less b/docs/src/less/components/examples.less index 174a294a..b57763fd 100644 --- a/docs/src/less/components/examples.less +++ b/docs/src/less/components/examples.less @@ -9,7 +9,6 @@ section { video, .plyr__video-embed { - border-radius: @border-radius-base; max-width: 100%; vertical-align: middle; } @@ -20,14 +19,8 @@ video, // Example players .plyr { margin: 0 auto; + border-radius: @border-radius-base; - &__controls { - border-radius: 0 0 @border-radius-base @border-radius-base; - } - video, - .plyr__video-embed { - border-radius: @border-radius-base @border-radius-base 0 0; - } &--fullscreen, &--fullscreen-active { max-width: none; @@ -45,7 +38,7 @@ video, .plyr--audio { max-width: @example-width-audio; - .plyr__controls { + /*.plyr__controls { border-radius: @border-radius-base; } .plyr__progress { @@ -56,7 +49,7 @@ video, border-radius: @border-radius-base @border-radius-base 0 0; overflow: hidden; } - } + }*/ } // Style full supported player diff --git a/docs/src/less/components/type.less b/docs/src/less/components/type.less index a040a022..d16a8865 100644 --- a/docs/src/less/components/type.less +++ b/docs/src/less/components/type.less @@ -2,6 +2,18 @@ // Typography // ========================================================================== +// Base +html { + font-size: 100%; +} +body { + font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif; + line-height: 1.5; + text-align: center; + color: @gray; + font-weight: @font-weight-base; +} + // Headings h1, h2 { @@ -10,6 +22,7 @@ h2 { margin: 0 0 (@padding-base / 2); line-height: 1.2; .font-smoothing(); + font-weight: @font-weight-bold; } h1 { .font-size(@font-size-h1); diff --git a/docs/src/less/lib/fontface.less b/docs/src/less/lib/fontface.less index 9442f17d..7372023c 100644 --- a/docs/src/less/lib/fontface.less +++ b/docs/src/less/lib/fontface.less @@ -2,17 +2,17 @@ // Fonts // ========================================================================== -@font-face { +/*@font-face { font-family: "Avenir"; src: url("//cdn.plyr.io/fonts/avenir-medium.woff2") format("woff2"), url("//cdn.plyr.io/fonts/avenir-medium.woff") format("woff"); font-style: normal; - font-weight: 400; + font-weight: @font-weight-base; } @font-face { font-family: "Avenir"; src: url("//cdn.plyr.io/fonts/avenir-bold.woff2") format("woff2"), url("//cdn.plyr.io/fonts/avenir-bold.woff") format("woff"); font-style: normal; - font-weight: 600; -} \ No newline at end of file + font-weight: @font-weight-bold; +}*/ \ No newline at end of file diff --git a/docs/src/less/variables.less b/docs/src/less/variables.less index 78c812d3..4629d98d 100644 --- a/docs/src/less/variables.less +++ b/docs/src/less/variables.less @@ -22,6 +22,8 @@ @font-size-base: 16; @font-size-small: 14; @font-size-h1: 64; +@font-weight-base: 500; +@font-weight-bold: 700; // Elements @link-color: @blue; diff --git a/readme.md b/readme.md index 4c6695c8..60191e30 100644 --- a/readme.md +++ b/readme.md @@ -389,7 +389,7 @@ A `plyr` object is added to any element that Plyr is initialized on. You can the There are two ways to access the instance, firstly you re-query the element container you used for setup (e.g. `.js-plyr`) like so: ```javascript -var player = document.querySelector('.js-plyr'); +var player = document.querySelector('.js-plyr').plyr; ``` Or you can use the returned object from your call to the setup method: @@ -488,20 +488,8 @@ Here's a list of the methods supported: Get/Set the media source.

- array
-
.source([
-      	{
-      		src: "/path/to/video.webm",
-      		type: "video/webm",
-      		...more attributes...
-      	},
-      	{
-      		src: "/path/to/video.mp4",
-      		type: "video/mp4",
-      		...more attributes...
-      	}
-      ])`

- This will inject a child `source` element for every element in the array with the specified attributes. `src` is the only required attribute although adding `type` is recommended as it helps the browser decide which file to download and play. + Object
+ See below

YouTube
Currently this API method only accepts a YouTube ID when used with a YouTube player. I will add URL support soon, along with being able to swap between types (e.g. YouTube to Audio or Video and vice versa.) diff --git a/src/js/plyr.js b/src/js/plyr.js index 9e3fd6dd..c34a1070 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -39,8 +39,9 @@ duration: null, displayDuration: true, iconPrefix: 'icon', - click: true, - tooltips: { + clickToPlay: true, + hideControls: true, + tooltips: { controls: false, seek: true }, @@ -83,6 +84,7 @@ hover: 'plyr--hover', tooltip: 'plyr__tooltip', hidden: 'plyr__sr-only', + hideControls: 'plyr--hide-controls', isIos: 'plyr--is-ios', isTouch: 'plyr--is-touch', captions: { @@ -91,8 +93,7 @@ }, fullscreen: { enabled: 'plyr--fullscreen-enabled', - active: 'plyr--fullscreen-active', - hideControls: 'plyr--fullscreen--hide-controls' + active: 'plyr--fullscreen-active' }, tabFocus: 'tab-focus' }, @@ -102,14 +103,13 @@ fullscreen: { enabled: true, fallback: true, - hideControls: true, allowAudio: false }, storage: { enabled: true, key: 'plyr' }, - controls: ['restart', 'rewind', 'play', 'fast-forward', 'current-time', 'duration', 'mute', 'volume', 'captions', 'fullscreen'], + controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'fullscreen'], i18n: { restart: 'Restart', rewind: 'Rewind {seektime} secs', @@ -393,6 +393,30 @@ return false; } + // Debounce + // deBouncer by hnldesign.nl + // based on code by Paul Irish and the original debouncing function from John Hann + // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ + function _debounce(func, threshold, execAsap) { + var timeout; + return function debounced () { + var obj = this, args = arguments; + function delayed () { + if (!execAsap) { + func.apply(obj, args); + } + timeout = null; + } + if (timeout) { + clearTimeout(timeout); + } + else if (execAsap) { + func.apply(obj, args); + } + timeout = setTimeout(delayed, threshold || 100); + }; + } + // Bind event function _on(element, events, callback) { if (element) { @@ -637,27 +661,20 @@ // Build the default HTML function _buildControls() { - // Open and add the progress and seek elements - var html = [ - '
', - '
', - '', - '', - '', - '0% ' + config.i18n.played, - '', - '', - '0% ' + config.i18n.buffered, - '']; + // Create html array + var html = []; - // Seek tooltip - if (config.tooltips.seek) { - html.push('00:00'); + // Larger overlaid play button + if (_inArray(config.controls, 'play-large')) { + html.push( + '' + ); } - // Close progress - html.push('
', - ''); + html.push('
'); // Restart button if (_inArray(config.controls, 'restart')) { @@ -679,7 +696,8 @@ ); } - // Play/pause button + // Play Pause button + // TODO: This should be a toggle button really? if (_inArray(config.controls, 'play')) { html.push( '
' - ); + html.push('
'); return html.join(''); } @@ -804,11 +835,6 @@ // Setup focus trap _focusTrap(); - - // Set control hide class hook - if (config.fullscreen.hideControls) { - _toggleClass(plyr.container, config.classes.fullscreen.hideControls, true); - } } } @@ -1174,7 +1200,7 @@ // Setup tooltips if (config.tooltips.controls) { - var labels = _getElements(config.selectors.labels + ' .' + config.classes.hidden); + var labels = _getElements([config.selectors.controls.wrapper, ' ', config.selectors.labels, ' .', config.classes.hidden].join('')); for (var i = labels.length - 1; i >= 0; i--) { var label = labels[i]; @@ -1193,7 +1219,7 @@ // Buttons plyr.buttons = {}; plyr.buttons.seek = _getElement(config.selectors.buttons.seek); - plyr.buttons.play = _getElement(config.selectors.buttons.play); + plyr.buttons.play = _getElements(config.selectors.buttons.play); plyr.buttons.pause = _getElement(config.selectors.buttons.pause); plyr.buttons.restart = _getElement(config.selectors.buttons.restart); plyr.buttons.rewind = _getElement(config.selectors.buttons.rewind); @@ -1237,7 +1263,7 @@ _log('It looks like there is a problem with your controls html', true); // Restore native video controls - _toggleControls(true); + _toggleNativeControls(true); return false; } @@ -1249,7 +1275,7 @@ } // Toggle native controls - function _toggleControls(toggle) { + function _toggleNativeControls(toggle) { if(toggle) { plyr.media.setAttribute('controls', ''); } @@ -1270,7 +1296,9 @@ // If there's a play button, set label if (plyr.supported.full && plyr.buttons.play) { - plyr.buttons.play.setAttribute('aria-label', label); + for (var i = plyr.buttons.play.length - 1; i >= 0; i--) { + plyr.buttons.play[i].setAttribute('aria-label', label); + } } // Set iframe title @@ -1292,6 +1320,12 @@ // Add type class _toggleClass(plyr.container, config.classes.type.replace('{0}', plyr.type), true); + // Add video class for embeds + // This will require changes if audio embeds are added + if (_inArray(config.types.embed, plyr.type)) { + _toggleClass(plyr.container, config.classes.type.replace('{0}', 'video'), true); + } + // If there's no autoplay attribute, assume the video is stopped and add state class _toggleClass(plyr.container, config.classes.stopped, config.autoplay); @@ -1869,6 +1903,8 @@ function _checkPlaying() { _toggleClass(plyr.container, config.classes.playing, !plyr.media.paused); _toggleClass(plyr.container, config.classes.stopped, plyr.media.paused); + + _toggleControls(plyr.media.paused); } // Toggle fullscreen @@ -1926,12 +1962,6 @@ // Set button state _toggleState(plyr.buttons.fullscreen, plyr.isFullscreen); - // Hide on entering full screen - if (config.fullscreen.hideControls) { - //_toggleClass(plyr.controls, config.classes.hover, false); - _showControls(true); - } - // Trigger an event _triggerEvent(plyr.container, plyr.isFullscreen ? 'enterfullscreen' : 'exitfullscreen'); } @@ -2273,24 +2303,51 @@ } // Show the player controls in fullscreen mode - function _showControls(force) { - // We're only worried about fullscreen - if (!plyr.isFullscreen) { + function _toggleControls(toggle) { + if (!config.hideControls || plyr.type === 'audio') { return; } + var delay = false, + isEnterFullscreen = false, + show = toggle; - // Set shown class - _toggleClass(plyr.container, config.classes.hover, true); + // Default to false if no boolean + if(typeof toggle !== "boolean") { + if(toggle && toggle.type) { + delay = (toggle.type === 'mousemove'); + isEnterFullscreen = (toggle.type === 'enterfullscreen'); + show = _inArray(['mousemove','mouseenter'], toggle.type); + } + else { + show = false; + } + } // Clear timer every movement window.clearTimeout(plyr.timers.hover); // If the mouse is not over the controls, set a timeout to hide them - plyr.timers.hover = window.setTimeout(function() { - if (!plyr.controls.mouseover || (force === true)) { - _toggleClass(plyr.container, config.classes.hover, false); + if(show || plyr.media.paused) { + _toggleClass(plyr.container, config.classes.hideControls, false); + + // Always show controls when paused + if(plyr.media.paused) { + return; } - }, 2000); + } + + // If toggle is false or if we're playing (regardless of toggle), then + // set the timer to hide the controls + if(!show || !plyr.media.paused) { + plyr.timers.hover = window.setTimeout(function() { + // If the mouse is over the controls, bail + if(plyr.controls.active && !isEnterFullscreen) { + return; + } + + _toggleClass(plyr.container, config.classes.hideControls, true); + }, delay ? 2000 : 0); + } } // Add common function to retrieve media source @@ -2339,6 +2396,11 @@ // Pause playback _pause(); + // Set seek input to 0 + if(plyr.buttons.seek) { + plyr.buttons.seek.value = 0; + } + // Clean up YouTube stuff if (plyr.type === 'youtube') { // Destroy the embed instance @@ -2578,13 +2640,15 @@ // Seek tooltip _on(plyr.progress.container, 'mouseenter mouseleave mousemove', _updateSeekTooltip); - // Toggle controls visibility based on mouse movement and location - var hoverTimer, isMouseOver = false; + // Toggle controls visibility based on mouse movement + if (config.hideControls) { + _on(plyr.container, 'mouseenter mouseleave mousemove', _toggleControls); + //_on(plyr.container, 'mousemove', _debounce(_toggleControls, 200, true)); + _on(plyr.container, 'enterfullscreen', _toggleControls); - if (config.fullscreen.hideControls) { - // Keep an eye on the mouse location in relation to controls - _on(plyr.controls, 'mouseenter mouseleave', function(event) { - plyr.controls.mouseover = (event.type === 'mouseenter'); + // 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'); }); } } @@ -2624,7 +2688,10 @@ _on(plyr.media, 'waiting canplay seeked', _checkLoading); // Click video - if (config.click) { + if (config.clickToPlay) { + // Set cursor + plyr.videoContainer.style.cursor = "pointer"; + _on(plyr.media, 'click', function() { if (plyr.media.paused) { _play(); @@ -2639,12 +2706,6 @@ }); } - // Listen for mouse move to show controls - if (config.fullscreen.hideControls) { - // Show the controls on mouse move - _on(plyr.media, 'mousemove', _showControls); - } - // Proxy events to container _on(plyr.media, config.events.join(' '), function(event) { _triggerEvent(plyr.container, event.type); @@ -2710,7 +2771,7 @@ } // Restore native video controls - _toggleControls(true); + _toggleNativeControls(true); // Clone the media element to remove listeners // http://stackoverflow.com/questions/19469881/javascript-remove-all-event-listeners-of-specific-type @@ -2808,7 +2869,7 @@ _remove(_getElement(config.selectors.controls.wrapper)); // Restore native controls - _toggleControls(true); + _toggleNativeControls(true); // Bail return; @@ -2835,7 +2896,7 @@ _mediaListeners(); // Remove native controls - _toggleControls(); + _toggleNativeControls(); // Setup fullscreen _setupFullscreen(); diff --git a/src/less/plyr.less b/src/less/plyr.less index f27023bc..99df1115 100644 --- a/src/less/plyr.less +++ b/src/less/plyr.less @@ -7,12 +7,7 @@ // ------------------------------- // Colors -@plyr-blue: #3498DB; -@plyr-gray-dark: #343F4A; -@plyr-gray: #565D64; -@plyr-gray-light: #6B7D86; -@plyr-gray-lighter: #CBD0D3; -@plyr-off-white: #D6DADD; +@plyr-color-main: #63B4E1; // Font sizes @plyr-font-size-small: 14px; @@ -24,37 +19,45 @@ @plyr-font-size-captions-large: (@plyr-font-size-base * 2); // Controls +// #C6D6DB @plyr-control-spacing: 10px; -@plyr-controls-bg: #fff; -@plyr-control-bg-hover: @plyr-blue; -.contrast-control-color(@plyr-controls-bg); -.contrast-control-color-hover(@plyr-control-bg-hover); +@plyr-video-controls-bg: #000; +@plyr-video-control-color: #fff; +@plyr-video-control-color-hover: #fff; +@plyr-video-control-bg-hover: @plyr-color-main; +@plyr-audio-controls-bg: transparent; +@plyr-audio-control-color: #565D64; +@plyr-audio-control-color-hover: #fff; +@plyr-audio-control-bg-hover: @plyr-color-main; // Tooltips -@plyr-tooltip-bg: @plyr-controls-bg; -@plyr-tooltip-border-color: fade(darken(@plyr-controls-bg, 75%), 10%); -@plyr-tooltip-arrow-border-color: fade(darken(@plyr-controls-bg, 75%), 20%); +@plyr-tooltip-bg: @plyr-video-controls-bg; +@plyr-tooltip-border-color: fade(darken(@plyr-video-controls-bg, 75%), 10%); +@plyr-tooltip-arrow-border-color: fade(darken(@plyr-video-controls-bg, 75%), 20%); @plyr-tooltip-border-width: 1px; @plyr-tooltip-shadow: 0 0 5px @plyr-tooltip-border-color, 0 0 0 @plyr-tooltip-border-width @plyr-tooltip-border-color; -@plyr-tooltip-color: @plyr-control-color; -@plyr-tooltip-padding: @plyr-control-spacing; -@plyr-tooltip-arrow-size: 6px; +@plyr-tooltip-color: @plyr-video-control-color; +@plyr-tooltip-padding: (@plyr-control-spacing / 2); +@plyr-tooltip-arrow-size: 4px; @plyr-tooltip-radius: 3px; // Progress -@plyr-progress-bg: fade(@plyr-gray, 20%); -@plyr-progress-playing-bg: @plyr-blue; -@plyr-progress-buffered-bg: fade(@plyr-gray, 25%); -@plyr-progress-loading-size: 40px; +@plyr-progress-bg: fade(@plyr-video-control-color, 25%); +@plyr-progress-playing-bg: @plyr-color-main; +@plyr-progress-buffered-bg: fade(@plyr-video-control-color, 25%); +@plyr-progress-loading-size: 25px; @plyr-progress-loading-bg: fade(#000, 15%); -// Volume -@plyr-volume-track-height: 6px; -@plyr-volume-track-bg: darken(@plyr-controls-bg, 10%); -@plyr-volume-thumb-height: (@plyr-volume-track-height * 2); -@plyr-volume-thumb-width: (@plyr-volume-track-height * 2); -@plyr-volume-thumb-bg: @plyr-control-color; -@plyr-volume-thumb-bg-focus: @plyr-control-bg-hover; +// Range sliders +@range-track-height: 8px; +@range-track-bg: fade(#fff, 25%); +@range-thumb-height: floor(@range-track-height * 2); +@range-thumb-width: floor(@range-track-height * 2); +@range-thumb-bg: #fff; +@range-thumb-border: 2px solid transparent; +@range-thumb-active-border-color: #fff; +@range-thumb-active-bg: @plyr-video-control-bg-hover; +@range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%); // Breakpoints @plyr-bp-control-split: 560px; // When controls split into left/right @@ -68,59 +71,29 @@ // Mixins // ------------------------------- -// Contrast -.contrast-control-color(@plyr-color: "") when (lightness(@plyr-color) >= 65%) { - @plyr-control-color: @plyr-gray-light; -} -.contrast-control-color(@plyr-color: "") when (lightness(@plyr-color) < 65%) { - @plyr-control-color: @plyr-gray-lighter; -} -.contrast-control-color-hover(@plyr-color: "") when (lightness(@plyr-color) >= 65%) { - @plyr-control-color-hover: @plyr-gray; -} -.contrast-control-color-hover(@plyr-color: "") when (lightness(@plyr-color) < 65%) { - @plyr-control-color-hover: #fff; -} - -// Font smoothing -.font-smoothing(@mode: on) when (@mode = on) { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; -} -.font-smoothing(@mode: on) when (@mode = off) { - -moz-osx-font-smoothing: auto; - -webkit-font-smoothing: subpixel-antialiased; -} - // styling -.volume-thumb() { - height: @plyr-volume-thumb-height; - width: @plyr-volume-thumb-width; - background: @plyr-volume-thumb-bg; +.range-track() { + height: @range-track-height; + background: @range-track-bg; border: 0; + border-radius: (@range-track-height / 2); + user-select: none; +} +.range-thumb() { + position: relative; + height: @range-thumb-height; + width: @range-thumb-width; + background: @range-thumb-bg; + border: @range-thumb-border; border-radius: 100%; - transition: background .3s ease; - cursor: ew-resize; + transition: background .2s ease, border .2s ease, transform .2s ease; + box-shadow: @range-thumb-shadow; + box-sizing: border-box; } -.volume-track() { - height: @plyr-volume-track-height; - background: @plyr-volume-track-bg; - border: 0; - border-radius: (@plyr-volume-track-height / 2); -} -.seek-thumb() { - background: transparent; - border: 0; - width: 1px; - height: @plyr-control-spacing; -} -.seek-thumb-touch() { - width: (@plyr-control-spacing * 4); - transform: translateX(-50%); -} -.seek-track() { - background: none; - border: 0; +.range-thumb-active() { + background: @range-thumb-active-bg; + border-color: @range-thumb-active-border-color; + transform: scale(1.25); } // Styles @@ -146,579 +119,593 @@ touch-action: manipulation; } - // Screen reader only elements - &__sr-only { - position: absolute !important; - clip: rect(1px, 1px, 1px, 1px); - padding: 0 !important; - border: 0 !important; - height: 1px !important; - width: 1px !important; - overflow: hidden; - } - - // For video - &__video-wrapper { - position: relative; - } + // Media elements video, audio { width: 100%; height: auto; vertical-align: middle; + border-radius: inherit; } - // Hide default captions - video::-webkit-media-text-track-container { - display: none; - } - - // Container for embeds - &__video-embed { - padding-bottom: 56.25%; /* 16:9 */ - height: 0; - overflow: hidden; - background: #000; - - iframe { - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - border: 0; - user-select: none; - } - - // Vimeo hack - > div { - position: relative; - padding-bottom: 200%; - transform: translateY(-35.95%); - } - - // To allow mouse events to be captured if full support - &.plyr iframe { - pointer-events: none; - } - } - - // Captions - &__captions { - display: none; - position: absolute; - bottom: 0; - left: 0; - width: 100%; - padding: (@plyr-control-spacing * 2) (@plyr-control-spacing * 2) (@plyr-control-spacing * 3); - color: #fff; - font-size: @plyr-font-size-captions-base; - text-align: center; - .font-smoothing(); - - span { - border-radius: 2px; - padding: 3px 10px; - background: fade(#000, 90%); - } - span:empty { - display: none; - } - - @media (min-width: @plyr-bp-captions-large) { - font-size: @plyr-font-size-captions-medium; - } - } - &--captions-active &__captions { - display: block; - } - &--fullscreen-active &__captions { - font-size: @plyr-font-size-captions-large; - } - - // Playback controls - &__controls { - .font-smoothing(); - position: relative; - padding: @plyr-control-spacing; - background: @plyr-controls-bg; - line-height: 1; - text-align: center; - box-shadow: 0 1px 1px fade(@plyr-gray-dark, 20%); - - // Clear floats - &::after { - content: ''; - display: table; - clear: both; - } - - // Layout - &--right { - display: block; - margin: @plyr-control-spacing auto 0; - } - @media (min-width: @plyr-bp-control-split) { - &--left { - float: left; - } - &--right { - float: right; - margin-top: 0; - } - } - - // Buttons - button { - display: inline-block; - vertical-align: middle; - margin: 0 2px; - padding: (@plyr-control-spacing / 2) @plyr-control-spacing; - overflow: hidden; - border: 0; - background: transparent; - border-radius: 3px; - cursor: pointer; - color: @plyr-control-color; - transition: background .3s ease, color .3s ease, opacity .3s ease; - - svg { - width: 18px; - height: 18px; - display: block; - fill: currentColor; - transition: fill .3s ease; - } - - // Hover and tab focus - &.tab-focus:focus, - &:hover { - background: @plyr-control-bg-hover; - color: @plyr-control-color-hover; - } - // Default focus - &:focus { - outline: 0; - } - } - - // Hide toggle icons by default - .icon--exit-fullscreen, - .icon--muted, - .icon--captions-on { - display: none; - } - - // plyr time - .plyr__time { - display: inline-block; - vertical-align: middle; - margin-left: @plyr-control-spacing; - color: @plyr-control-color; - font-weight: 600; - font-size: @plyr-font-size-small; - } - - // Media duration hidden on small screens - .plyr__time + .plyr__time { - display: none; - - @media (min-width: @plyr-bp-control-split) { - display: inline-block; - } - - // Add a slash in before - &::before { - content: '\2044'; - margin-right: @plyr-control-spacing; - } - } - } - - // Tooltips - &__tooltip { - visibility: hidden; - position: absolute; - z-index: 2; - bottom: 100%; - margin-bottom: @plyr-tooltip-padding; - padding: @plyr-tooltip-padding (@plyr-tooltip-padding * 1.5); - pointer-events: none; - - opacity: 0; - background: @plyr-tooltip-bg; - box-shadow: @plyr-tooltip-shadow; - border-radius: @plyr-tooltip-radius; - color: @plyr-tooltip-color; - font-size: @plyr-font-size-small; - line-height: 1.5; - font-weight: 600; - - transform: translate(-50%, 10px) scale(.8); - transform-origin: 50% 100%; - transition: transform .2s .1s ease, opacity .2s .1s ease, visibility .3s ease; - - // Arrows - &::after, - &::before { - content: ''; - position: absolute; - width: 0; - height: 0; - top: 100%; - left: 50%; - transform: translateX(-50%); - } - // The border triangle - &::after { - @plyr-border-arrow-size: (@plyr-tooltip-arrow-size + (@plyr-tooltip-border-width * 1)); - bottom: -(@plyr-border-arrow-size + @plyr-tooltip-border-width); - border-right: @plyr-border-arrow-size solid transparent; - border-top: @plyr-border-arrow-size solid @plyr-tooltip-arrow-border-color; - border-left: @plyr-border-arrow-size solid transparent; - z-index: 1; - } - // The background triangle - &::before { - bottom: -@plyr-tooltip-arrow-size; - border-right: @plyr-tooltip-arrow-size solid transparent; - border-top: @plyr-tooltip-arrow-size solid @plyr-tooltip-bg; - border-left: @plyr-tooltip-arrow-size solid transparent; - z-index: 2; - } - } - button:hover .plyr__tooltip, - button.tab-focus:focus .plyr__tooltip, - &__tooltip--visible { - visibility: visible; - opacity: 1; - transform: translate(-50%, 0) scale(1); - } - button:hover .plyr__tooltip { - z-index: 3; - } - - // Common range styles - input[type='range'] { - &::-ms-tooltip { - display: none; - } - &.tab-focus:focus { - outline: 1px dotted fade(@plyr-gray-dark, 80%); - outline-offset: 3px; - } - } - - // Playback progress - // element - &__progress { - position: absolute; - bottom: 100%; - left: 0; - right: 0; - width: 100%; - height: @plyr-control-spacing; - background: @plyr-progress-bg; - - &--buffer[value], - &--played[value], - &--seek[type='range'] { - position: absolute; - left: 0; - top: 0; - width: 100%; - height: @plyr-control-spacing; - margin: 0; - padding: 0; - vertical-align: top; - - -webkit-appearance: none; - -moz-appearance: none; - border: none; - background: transparent; - } - &--buffer[value], - &--played[value] { - &::-webkit-progress-bar { - background: transparent; - transition: width .2s ease; - } - - // Inherit from currentColor; - &::-webkit-progress-value { - background: currentColor; - transition: width .2s ease; - } - &::-moz-progress-bar { - background: currentColor; - transition: width .2s ease; - } - } - &--played[value] { - z-index: 2; - color: @plyr-progress-playing-bg; - } - &--buffer[value] { - color: @plyr-progress-buffered-bg; - } - - // Seek control - // element - // Specificity is for bootstrap compatibility - &--seek[type='range'] { - z-index: 4; - cursor: pointer; - outline: 0; - - // Webkit - &::-webkit-slider-runnable-track { - .seek-track(); - } - &::-webkit-slider-thumb { - -webkit-appearance: none; - .seek-thumb(); - } - - // Mozilla - &::-moz-range-track { - .seek-track(); - } - &::-moz-range-thumb { - -moz-appearance: none; - .seek-thumb(); - } - - // Microsoft - &::-ms-track { - color: transparent; - .seek-track(); - } - &::-ms-fill-lower, - &::-ms-fill-upper { - .seek-track(); - } - &::-ms-thumb { - .seek-thumb(); - } - - &:focus { - outline: 0; - } - &::-moz-focus-outer { - border: 0; - } - } - - // Seek tooltip to show time - .plyr__tooltip { - left: 0; - } - } - - // Touch seek wider handle - &--is-touch &--seek[type='range'] { - &::-webkit-slider-thumb { - .seek-thumb-touch(); - } - // Mozilla - &::-moz-range-thumb { - .seek-thumb-touch(); - } - // Microsoft - &::-ms-thumb { - .seek-thumb-touch(); - } - } - - // Loading state - &--loading .plyr__progress--buffer { - animation: plyr-progress 1s linear infinite; - background-size: @plyr-progress-loading-size @plyr-progress-loading-size; - background-repeat: repeat-x; - background-color: @plyr-progress-buffered-bg; - background-image: linear-gradient( - -45deg, - @plyr-progress-loading-bg 25%, - transparent 25%, - transparent 50%, - @plyr-progress-loading-bg 50%, - @plyr-progress-loading-bg 75%, - transparent 75%, - transparent); - color: transparent; - } - - // States - &__controls [data-plyr='pause'], - &--playing .plyr__controls [data-plyr='play'] { - display: none; - } - &--playing .plyr__controls [data-plyr='pause'] { - display: inline-block; - } - - // Volume control - // element + // Range inputs // Specificity is for bootstrap compatibility - &__volume[type='range'] { - display: inline-block; + input[type='range'] { + display: block; + height: @range-thumb-height; + width: 100%; + margin: 0; + padding: 0; vertical-align: middle; - -webkit-appearance: none; - -moz-appearance: none; - width: 100px; - margin: 0 @plyr-control-spacing 0 0; - padding: 0; + + appearance: none; cursor: pointer; - background: transparent; border: none; - + background: transparent; + // Webkit &::-webkit-slider-runnable-track { - .volume-track(); + .range-track(); } &::-webkit-slider-thumb { -webkit-appearance: none; - margin-top: -((@plyr-volume-thumb-height - @plyr-volume-track-height) / 2); - .volume-thumb(); + margin-top: -((@range-thumb-height - @range-track-height) / 2); + .range-thumb(); } // Mozilla &::-moz-range-track { - .volume-track(); + .range-track(); } &::-moz-range-thumb { - .volume-thumb(); + .range-thumb(); } - + &::-moz-focus-outer { + border: 0; + } + // Microsoft &::-ms-track { - height: @plyr-volume-track-height; + height: @range-track-height; background: transparent; - border-color: transparent; - border-width: ((@plyr-volume-thumb-height - @plyr-volume-track-height) / 2) 0; + border: 0; color: transparent; } &::-ms-fill-lower, &::-ms-fill-upper { - .volume-track(); + .range-track(); } &::-ms-thumb { - .volume-thumb(); + .range-thumb(); + + // For some reason, Edge uses the -webkit margin above + margin-top: 0; } - &:focus { - outline: 0; - - &::-webkit-slider-thumb { - background: @plyr-volume-thumb-bg-focus; - } - &::-moz-range-thumb { - background: @plyr-volume-thumb-bg-focus; - } - &::-ms-thumb { - background: @plyr-volume-thumb-bg-focus; - } - } - } - - // Hide sound controls on iOS - // It's not supported to change volume using JavaScript: - // https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html - &--is-ios &__volume, - &--is-ios [data-plyr='mute'], - &--is-ios.plyr--audio &__controls--right { - display: none; - } - // Center buttons so it looks less odd - &--is-ios.plyr--audio &__controls--left { - float: none; - } - - // Audio specific styles - // Position the progress within the container - &--audio .plyr__controls { - padding-top: (@plyr-control-spacing * 2); - } - &--audio .plyr__progress { - bottom: auto; - top: 0; - background: @plyr-off-white; - } - - // Full screen mode - &.plyr--fullscreen, - &--fullscreen-active { - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - height: 100%; - width: 100%; - z-index: 10000000; - background: #000; - - video { - height: 100%; - } - .plyr__video-wrapper { - height: 100%; - width: 100%; - } - .plyr__controls { - position: absolute; - bottom: 0; - left: 0; - right: 0; - } - } - - // Hide controls when playing in full screen - &--fullscreen-active.plyr--fullscreen--hide-controls.plyr--playing, - &.plyr--fullscreen.plyr--fullscreen--hide-controls.plyr--playing { - .plyr__controls { - transform: translateY(100%) translateY(@plyr-control-spacing / 2); - transition: transform .3s .2s ease; - } - .plyr__captions { - bottom: (@plyr-control-spacing / 2); - transition: bottom .3s .2s ease; - } - &.plyr--hover .plyr__controls { - transform: translateY(0); - } - } - - // Captions - &.plyr--fullscreen .plyr__captions, - &--fullscreen-active .plyr__captions, - &--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions { - top: auto; - bottom: 90px; - - @media (min-width: @plyr-bp-control-split) { - bottom: 60px; - } - } - - // Change icons on state change - &--fullscreen-active .icon--exit-fullscreen, - &--muted .plyr__controls .icon--muted, - &--captions-active .plyr__controls .icon--captions-on { - display: block; - - & + svg { + &::-ms-tooltip { display: none; } - } - // Some options are hidden by default - [data-plyr='captions'], - [data-plyr='fullscreen'] { - display: none; - } - &--captions-enabled [data-plyr='captions'], - &--fullscreen-enabled [data-plyr='fullscreen'] { - display: inline-block; + // Focus styles + &:focus { + outline: 0; + } + &::-moz-focus-outer { + border: 0; + } + &.tab-focus:focus { + outline: 1px dotted fade(@plyr-video-control-color, 50%); + outline-offset: 3px; + } + + // Pressed styles + &:active { + &::-webkit-slider-thumb { + .range-thumb-active(); + } + &::-moz-range-thumb { + .range-thumb-active(); + } + &::-ms-thumb { + .range-thumb-active(); + } + } + } +} + +// Screen reader only elements +.plyr__sr-only { + position: absolute !important; + clip: rect(1px, 1px, 1px, 1px); + padding: 0 !important; + border: 0 !important; + height: 1px !important; + width: 1px !important; + overflow: hidden; +} + +// Video +.plyr__video-wrapper { + position: relative; + background: #000; + border-radius: inherit; +} + +// Container for embeds +.plyr__video-embed { + padding-bottom: 56.25%; /* 16:9 */ + height: 0; + overflow: hidden; + border-radius: inherit; + + iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; + user-select: none; + } + + // Vimeo hack + > div { + position: relative; + padding-bottom: 200%; + transform: translateY(-35.95%); + } +} +// To allow mouse events to be captured if full support +.plyr .plyr__video-embed iframe { + pointer-events: none; +} + +// Captions +// -------------------------------------------------------------- +// Hide default captions +.plyr video::-webkit-media-text-track-container { + display: none; +} +.plyr__captions { + display: none; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + padding: (@plyr-control-spacing * 2) (@plyr-control-spacing * 2) (@plyr-control-spacing * 8); + color: #fff; + font-size: @plyr-font-size-captions-base; + text-align: center; + font-weight: 400; + + span { + border-radius: 2px; + padding: floor(@plyr-control-spacing / 3) @plyr-control-spacing; + background: fade(#000, 85%); + } + span:empty { + display: none; + } + + @media (min-width: @plyr-bp-captions-large) { + font-size: @plyr-font-size-captions-medium; + } +} +.plyr--captions-active .plyr__captions { + display: block; +} +.plyr--fullscreen-active .plyr__captions { + font-size: @plyr-font-size-captions-large; +} + +// Controls +// -------------------------------------------------------------- +// Shared +.plyr__controls, +.plyr__play-large { + transition: visibility .3s ease, opacity .3s ease; +} + +// Playback controls +.plyr__controls { + display: flex; + align-items: center; + + line-height: 1; + text-align: center; + + // Spacing + > button, + .plyr__progress, + .plyr__time { + margin-left: @plyr-control-spacing; + + &:first-child { + margin-left: 0; + } + } + .plyr__volume[type="range"] { + margin-left: (@plyr-control-spacing / 2); + } + [data-plyr="pause"] { + margin-left: 0; + } + + // Buttons + button { + position: relative; + display: inline-block; + flex-shrink: 0; + vertical-align: middle; + padding: (@plyr-control-spacing / 2) @plyr-control-spacing; + border: 0; + background: transparent; + border-radius: 3px; + cursor: pointer; + transition: background .3s ease, color .3s ease, opacity .3s ease; + color: inherit; + + svg { + width: 18px; + height: 18px; + display: block; + fill: currentColor; + } + + // Default focus + &:focus { + outline: 0; + } + } + + // Hide toggle icons by default + .icon--exit-fullscreen, + .icon--muted, + .icon--captions-on { + display: none; + } +} + +// Video controls +.plyr--video .plyr__controls { + position: absolute; + left: 0; + right: 0; + bottom: 0; + padding: (@plyr-control-spacing * 5) (@plyr-control-spacing * 1.5) @plyr-control-spacing; + background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%)); + border-bottom-left-radius: inherit; + border-bottom-right-radius: inherit; + color: @plyr-video-control-color; + + button { + // Hover and tab focus + &.tab-focus:focus, + &:hover { + background: @plyr-video-control-bg-hover; + color: @plyr-video-control-color-hover; + } + } +} +.plyr--audio .plyr__controls { + padding: @plyr-control-spacing; + border-radius: inherit; + background: @plyr-audio-controls-bg; + color: @plyr-audio-control-color; + + button { + // Hover and tab focus + &.tab-focus:focus, + &:hover { + background: @plyr-audio-control-bg-hover; + color: @plyr-audio-control-color-hover; + } + } +} + +// Large play button +.plyr__play-large { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + padding: @plyr-control-spacing; + background: @plyr-video-control-bg-hover; + border: 4px solid @plyr-video-control-color; + border-radius: 100%; + color: @plyr-video-control-color; + + svg { + position: relative; + left: 2px; + width: 20px; + height: 20px; + display: block; + fill: currentColor; + } + + &:focus { + outline: 1px dotted fade(@plyr-video-control-color, 50%); + } +} +.plyr--audio .plyr__play-large { + display: none; +} + +// States +.plyr__controls [data-plyr='pause'], +.plyr--playing .plyr__controls [data-plyr='play'] { + display: none; +} +.plyr--playing .plyr__controls [data-plyr='pause'] { + display: inline-block; +} + +// Hide controls +.plyr--hide-controls .plyr__controls, +.plyr--playing .plyr__play-large { + visibility: hidden; + opacity: 0; +} + +// Change icons on state change +.plyr--fullscreen-active .icon--exit-fullscreen, +.plyr--muted .plyr__controls .icon--muted, +.plyr--captions-active .plyr__controls .icon--captions-on { + display: block; + + & + svg { + display: none; + } +} + +// Some options are hidden by default +.plyr [data-plyr='captions'], +.plyr [data-plyr='fullscreen'] { + display: none; +} +.plyr--captions-enabled [data-plyr='captions'], +.plyr--fullscreen-enabled [data-plyr='fullscreen'] { + display: inline-block; +} + +// Tooltips +// -------------------------------------------------------------- +.plyr__tooltip { + visibility: hidden; + position: absolute; + z-index: 2; + bottom: 100%; + margin-bottom: (@plyr-tooltip-padding * 2); + padding: @plyr-tooltip-padding (@plyr-tooltip-padding * 1.5); + pointer-events: none; + + opacity: 0; + background: @plyr-tooltip-bg; + box-shadow: @plyr-tooltip-shadow; + border-radius: @plyr-tooltip-radius; + + color: @plyr-tooltip-color; + font-size: @plyr-font-size-small; + line-height: 1.3; + + transform: translate(-50%, 10px) scale(.8); + transform-origin: 50% 100%; + transition: transform .2s .1s ease, opacity .2s .1s ease, visibility .3s ease; + + // Arrows + &::before { + content: ''; + position: absolute; + width: 0; + height: 0; + left: 50%; + transform: translateX(-50%); + } + // The background triangle + &::before { + bottom: -@plyr-tooltip-arrow-size; + border-right: @plyr-tooltip-arrow-size solid transparent; + border-top: @plyr-tooltip-arrow-size solid @plyr-tooltip-bg; + border-left: @plyr-tooltip-arrow-size solid transparent; + z-index: 2; + } +} +.plyr button:hover .plyr__tooltip, +.plyr button.tab-focus:focus .plyr__tooltip, +.plyr__tooltip--visible { + visibility: visible; + opacity: 1; + transform: translate(-50%, 0) scale(1); +} +.plyr button:hover .plyr__tooltip { + z-index: 3; +} + +// Playback progress +// -------------------------------------------------------------- +// element +.plyr__progress { + position: relative; + flex: 1; + + input[type="range"] { + position: relative; + z-index: 2; + + &::-webkit-slider-runnable-track { + background: transparent; + } + &::-moz-range-track { + background: transparent; + } + &::-ms-fill-lower, + &::-ms-fill-upper { + background: transparent; + } + } + + // Seek tooltip to show time + .plyr__tooltip { + left: 0; + } +} + +.plyr__progress--buffer[value], +.plyr__progress--played[value] { + position: absolute; + left: 0; + top: 50%; + width: 100%; + height: @range-track-height; + margin: -(@range-track-height / 2) 0 0; + padding: 0; + vertical-align: top; + appearance: none; + border: none; + border-radius: 100px; + + &::-webkit-progress-bar { + background: transparent; + } + &::-webkit-progress-value { + background: currentColor; + border-radius: 100px; + min-width: @range-track-height; + } + &::-moz-progress-bar { + background: currentColor; + border-radius: 100px; + min-width: @range-track-height; + } + &::-ms-fill { + border-radius: 100px; + } +} +.plyr__progress--played[value] { + z-index: 1; + color: @plyr-progress-playing-bg; + background: transparent; + + &::-webkit-progress-value { + min-width: @range-track-height; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + &::-moz-progress-bar { + min-width: @range-track-height; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + &::-ms-fill { + min-width: @range-track-height; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } +} +.plyr__progress--buffer[value] { + color: @plyr-progress-buffered-bg; + background: @range-track-bg; + + &::-webkit-progress-value { + transition: width .2s ease; + } + &::-moz-progress-bar { + transition: width .2s ease; + } + &::-ms-fill { + transition: width .2s ease; + } +} + +// Loading state +.plyr--loading .plyr__progress--buffer { + animation: plyr-progress 1s linear infinite; + background-size: @plyr-progress-loading-size @plyr-progress-loading-size; + background-repeat: repeat-x; + background-color: @plyr-progress-buffered-bg; + background-image: linear-gradient( + -45deg, + @plyr-progress-loading-bg 25%, + transparent 25%, + transparent 50%, + @plyr-progress-loading-bg 50%, + @plyr-progress-loading-bg 75%, + transparent 75%, + transparent); + color: transparent; +} + +// Time +// -------------------------------------------------------------- +.plyr__time { + display: inline-block; + vertical-align: middle; + font-size: @plyr-font-size-small; + line-height: .95; +} + +// Media duration hidden on small screens +.plyr__time + .plyr__time { + display: none; + + @media (min-width: @plyr-bp-control-split) { + display: inline-block; + } + + // Add a slash in before + &::before { + content: '\2044'; + margin-right: @plyr-control-spacing; + } +} + +// Volume +// -------------------------------------------------------------- +// element +// Specificity is for bootstrap compatibility +.plyr__volume[type='range'] { + max-width: 100px; +} + +// Hide sound controls on iOS +// It's not supported to change volume using JavaScript: +// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html +.plyr--is-ios .plyr__volume, +.plyr--is-ios [data-plyr='mute'], +.plyr--is-ios.plyr--audio .plyr__controls--right { + display: none; +} +// Center buttons so it looks less odd +.plyr--is-ios.plyr--audio .plyr__controls--left { + float: none; +} + +// Fullscreen +// -------------------------------------------------------------- +.plyr--fullscreen, +.plyr--fullscreen-active { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + height: 100%; + width: 100%; + z-index: 10000000; + background: #000; + + video { + height: 100%; + } + .plyr__video-wrapper { + height: 100%; + width: 100%; + } + .plyr__controls { + position: absolute; + bottom: 0; + left: 0; + right: 0; } } diff --git a/src/sprite/icon-fast-forward.svg b/src/sprite/icon-fast-forward.svg old mode 100755 new mode 100644 index 1cc67199..3ae96af6 --- a/src/sprite/icon-fast-forward.svg +++ b/src/sprite/icon-fast-forward.svg @@ -1,4 +1,7 @@ - - - - + + + + + + diff --git a/src/sprite/icon-pause.svg b/src/sprite/icon-pause.svg index 7fb41105..db51a807 100644 --- a/src/sprite/icon-pause.svg +++ b/src/sprite/icon-pause.svg @@ -1,7 +1,8 @@ - - - - - - - + + + + + + + diff --git a/src/sprite/icon-play.svg b/src/sprite/icon-play.svg old mode 100755 new mode 100644 index 056b9f79..069af73c --- a/src/sprite/icon-play.svg +++ b/src/sprite/icon-play.svg @@ -1,4 +1,7 @@ - - - - + + + + + + diff --git a/src/sprite/icon-rewind.svg b/src/sprite/icon-rewind.svg index 661df0fd..fbc252d2 100644 --- a/src/sprite/icon-rewind.svg +++ b/src/sprite/icon-rewind.svg @@ -1,4 +1,7 @@ - - - - + + + + + +