diff --git a/bower.json b/bower.json index 2c142ddf..1511e44e 100644 --- a/bower.json +++ b/bower.json @@ -29,5 +29,5 @@ "type": "git", "url": "git://github.com/selz/plyr.git" }, - "license": "BSD" + "license": "MIT" } \ No newline at end of file diff --git a/changelog.md b/changelog.md index b23b7c14..73748a0f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,11 +1,20 @@ # Changelog +## v1.0.20 +- Default controls included (Fixes #45) +- Volume changes on `input` as well as `change` (Fixes #43) +- Fix for undefined Play text +- License changed to MIT + +## v1.0.19 +- Fixed firefox fullscreen issue (#38) + ## v1.0.18 - Added CDN references ## v1.0.17 - SASS support added (thanks to @brunowego) -- Docs completely seperated to avoid any confusion +- Docs completely separated to avoid any confusion - New gulp tasks (will add more documentation for this) ## v1.0.16 diff --git a/controls.md b/controls.md index f6bb1420..b231acb1 100644 --- a/controls.md +++ b/controls.md @@ -1,8 +1,8 @@ # Controls HTML -This is the markup that is rendered for the Plyr controls. The reason it's a seperate option is to allow full customization of markup based on your needs. It's a pet hate of other libraries that use `` or ``s as buttons! +This is the markup that is rendered for the Plyr controls. You can use the default controls or provide a customized version of markup based on your needs. -The default Plyr setup uses a Hogan template. The reason being to allow for localization at a later date. Check out `controls.html` in `/src/templates` to get an idea of how the default html is structured. Alternatively just use the vanilla HTML below. +The demo Plyr setup uses a Hogan template. This purely to allow for localization at a later date. Check out `controls.html` in `/src/templates` to get an idea of how the default html is structured. Alternatively check out the `plyr.js` source. ## Requirements @@ -15,67 +15,68 @@ You need to add several placeholders to your html template that are replaced whe Currently all buttons and inputs need to be present for Plyr to work but later we'll make it more dynamic so if you omit a button or input, it'll still work. -## Vanilla HTML template +## Default -You can of course, just specify vanilla HTML. Here's an example snippet: +This is the default `html` option from `plyr.js`. -```html -var controls = [ -'
', - '
', - '', - '0% played', - '', - '', - '0% buffered', - '', - '
', - '', - '', - '', - '', - '', - '', - '', - 'Time', - '00:00', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', - '', -'
' -].join("\n"); +```javascript +["
", + "
", + "", + "", + "", + "0% played", + "", + "", + "0% buffered", + "", + "
", + "", + "", + "", + "", + "", + "", + "", + "Time", + "00:00", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", +"
"].join("\n"); ``` \ No newline at end of file diff --git a/design/IcoMoon/PNG/bubble.png b/design/IcoMoon/PNG/bubble.png deleted file mode 100755 index 5139f8c8..00000000 Binary files a/design/IcoMoon/PNG/bubble.png and /dev/null differ diff --git a/design/IcoMoon/PNG/fast-forward.png b/design/IcoMoon/PNG/fast-forward.png deleted file mode 100755 index 07f2fd1b..00000000 Binary files a/design/IcoMoon/PNG/fast-forward.png and /dev/null differ diff --git a/design/IcoMoon/PNG/film.png b/design/IcoMoon/PNG/film.png deleted file mode 100755 index 3481891e..00000000 Binary files a/design/IcoMoon/PNG/film.png and /dev/null differ diff --git a/design/IcoMoon/PNG/monitor.png b/design/IcoMoon/PNG/monitor.png deleted file mode 100755 index 4e6f77d6..00000000 Binary files a/design/IcoMoon/PNG/monitor.png and /dev/null differ diff --git a/design/IcoMoon/PNG/play.png b/design/IcoMoon/PNG/play.png deleted file mode 100755 index cc842331..00000000 Binary files a/design/IcoMoon/PNG/play.png and /dev/null differ diff --git a/design/IcoMoon/PNG/refresh.png b/design/IcoMoon/PNG/refresh.png deleted file mode 100755 index f745a60a..00000000 Binary files a/design/IcoMoon/PNG/refresh.png and /dev/null differ diff --git a/design/IcoMoon/PNG/sound.png b/design/IcoMoon/PNG/sound.png deleted file mode 100755 index 5358f3fc..00000000 Binary files a/design/IcoMoon/PNG/sound.png and /dev/null differ diff --git a/design/IcoMoon/PNG/up.png b/design/IcoMoon/PNG/up.png deleted file mode 100755 index ea9b39d5..00000000 Binary files a/design/IcoMoon/PNG/up.png and /dev/null differ diff --git a/design/IcoMoon/Read Me.txt b/design/IcoMoon/Read Me.txt deleted file mode 100755 index 968528f9..00000000 --- a/design/IcoMoon/Read Me.txt +++ /dev/null @@ -1,7 +0,0 @@ -The *SVG* folder contains the icons you selected as separate SVG files. - -The *demo.html* lists the icons that you selected. To learn how to insert your icons as inline SVGs (with the element), refer to the source of this HTML file. If you prefer to reference an external SVG instead of embedding it in the HTML, you will need to use javascript to fetch the SVG in order to make sure your SVGs will work fine in IE. IcoMoon's Quick Usage mode can take care of that and host your SVGs too. - -You can ignore the *svgdefs.svg* file. It contains the same SVG definitions as the ones you can find in the demo.html file. - -If you prefer using PNGs or CSS sprites, refer to the Preferences panel of the IcoMoon app before downloading your zip pack. diff --git a/design/IcoMoon/SVG/bubble.svg b/design/IcoMoon/SVG/bubble.svg deleted file mode 100755 index a8120497..00000000 --- a/design/IcoMoon/SVG/bubble.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/design/IcoMoon/SVG/fast-forward.svg b/design/IcoMoon/SVG/fast-forward.svg deleted file mode 100755 index 13670b17..00000000 --- a/design/IcoMoon/SVG/fast-forward.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/design/IcoMoon/SVG/film.svg b/design/IcoMoon/SVG/film.svg deleted file mode 100755 index 538a30b6..00000000 --- a/design/IcoMoon/SVG/film.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/design/IcoMoon/SVG/monitor.svg b/design/IcoMoon/SVG/monitor.svg deleted file mode 100755 index 28625055..00000000 --- a/design/IcoMoon/SVG/monitor.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/design/IcoMoon/SVG/play.svg b/design/IcoMoon/SVG/play.svg deleted file mode 100755 index 65db2254..00000000 --- a/design/IcoMoon/SVG/play.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/design/IcoMoon/SVG/refresh.svg b/design/IcoMoon/SVG/refresh.svg deleted file mode 100755 index 90ad4431..00000000 --- a/design/IcoMoon/SVG/refresh.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/design/IcoMoon/SVG/sound.svg b/design/IcoMoon/SVG/sound.svg deleted file mode 100755 index 58db4ded..00000000 --- a/design/IcoMoon/SVG/sound.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/design/IcoMoon/SVG/up.svg b/design/IcoMoon/SVG/up.svg deleted file mode 100755 index ee57849b..00000000 --- a/design/IcoMoon/SVG/up.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/design/IcoMoon/demo-files/demo.css b/design/IcoMoon/demo-files/demo.css deleted file mode 100755 index b6189ee8..00000000 --- a/design/IcoMoon/demo-files/demo.css +++ /dev/null @@ -1,147 +0,0 @@ -body { - padding: 0; - margin: 0; - font-family: sans-serif; - font-size: 1em; - line-height: 1.5; - color: #555; - background: #fff; -} -h1 { - font-size: 1.5em; - font-weight: normal; - box-shadow: 0 1px #ddd, 0 2px #fff, 0 3px #ddd; -} -small { - font-size: .66666667em; -} -a { - color: #e74c3c; - text-decoration: none; -} -a:hover, a:focus { - box-shadow: 0 1px #e74c3c; -} -.bshadow0, input { - box-shadow: inset 0 -2px #e7e7e7; -} -input:hover { - box-shadow: inset 0 -2px #ccc; -} -input, fieldset { - font-size: 1em; - margin: 0; - padding: 0; - border: 0; -} -input { - color: inherit; - line-height: 1.5; - height: 1.5em; - padding: .25em 0; -} -input:focus { - outline: none; - box-shadow: inset 0 -2px #449fdb; -} -.glyph { - font-size: 16px; - width: 17em; - margin-right: 1.5em; - float: left; - overflow: hidden; -} -.glyph svg { - color: #444444; -} -.liga { - width: 80%; - width: calc(100% - 2.5em); -} -.talign-right { - text-align: right; -} -.talign-center { - text-align: center; -} -.bgc1 { - background: #f1f1f1; -} -.fgc0 { - color: #000; -} -.fgc1 { - color: #999; -} -p { - margin-top: 1em; - margin-bottom: 1em; -} -.mvm { - margin-top: .75em; - margin-bottom: .75em; -} -.mtn { - margin-top: 0; -} -.mtl, .mal { - margin-top: 1.5em; -} -.mbl, .mal { - margin-bottom: 1.5em; -} -.mal, .mhl { - margin-left: 1.5em; - margin-right: 1.5em; -} -.mhmm { - margin-left: 1em; - margin-right: 1em; -} -.mls { - margin-left: .25em; -} -.ptl { - padding-top: 1.5em; -} -.pbs, .pvs { - padding-bottom: .25em; -} -.pvs, .pts { - padding-top: .25em; -} -.unit { - float: left; -} -.unitRight { - float: right; -} -.size1of2 { - width: 50%; -} -.size1of1 { - width: 100%; -} -.clearfix:before, .clearfix:after { - content: " "; - display: table; -} -.clearfix:after { - clear: both; -} -.hidden-true { - display: none; -} -.textbox0 { - width: 3em; - background: #f1f1f1; - padding: .25em .5em; - line-height: 1.5; - height: 1.5em; -} -.fs0 { - font-size: 16px; -} -.fs1 { - font-size: 18px; -} diff --git a/design/IcoMoon/demo.html b/design/IcoMoon/demo.html deleted file mode 100755 index 0156120b..00000000 --- a/design/IcoMoon/demo.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - IcoMoon - SVG Icons - - - - - - - - - - bubble - - - - sound - - - - - monitor - - - - up - - - - - play - - - - fast-forward - - - - refresh - - - - - film - - - - - -
-

SVG Icons - Generated by IcoMoon

-
-
-

Grid Size: 18

-
-
- icon-bubble -
-
-
-
- icon-sound -
-
-
-
- icon-monitor -
-
-
-
- icon-up -
-
-
-
- icon-play -
-
-
-
- icon-fast-forward -
-
-
-
- icon-refresh -
-
-
-
- icon-film -
-
-
- - - diff --git a/design/IcoMoon/style.css b/design/IcoMoon/style.css deleted file mode 100755 index c0b7744f..00000000 --- a/design/IcoMoon/style.css +++ /dev/null @@ -1,6 +0,0 @@ -.icon { - display: inline-block; - width: 1em; - height: 1em; - fill: currentColor; -} diff --git a/design/IcoMoon/svgdefs.svg b/design/IcoMoon/svgdefs.svg deleted file mode 100755 index 8b0944cd..00000000 --- a/design/IcoMoon/svgdefs.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - bubble - - - - sound - - - - - monitor - - - - up - - - - - play - - - - fast-forward - - - - refresh - - - - - film - - - - diff --git a/design/captions.sketch b/design/captions.sketch deleted file mode 100644 index 02d2a95a..00000000 Binary files a/design/captions.sketch and /dev/null differ diff --git a/design/collapse.sketch b/design/collapse.sketch deleted file mode 100644 index 3efc91f4..00000000 Binary files a/design/collapse.sketch and /dev/null differ diff --git a/design/expand.sketch b/design/expand.sketch deleted file mode 100644 index e1f83eff..00000000 Binary files a/design/expand.sketch and /dev/null differ diff --git a/design/muted.sketch b/design/muted.sketch deleted file mode 100644 index 2dd42441..00000000 Binary files a/design/muted.sketch and /dev/null differ diff --git a/design/pause.sketch b/design/pause.sketch deleted file mode 100644 index 4d840ad1..00000000 Binary files a/design/pause.sketch and /dev/null differ diff --git a/design/rewind.sketch b/design/rewind.sketch deleted file mode 100644 index 8bf121f1..00000000 Binary files a/design/rewind.sketch and /dev/null differ diff --git a/dist/plyr.css b/dist/plyr.css index bcb209d1..b72d8c25 100644 --- a/dist/plyr.css +++ b/dist/plyr.css @@ -1 +1 @@ -.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}.player{position:relative;max-width:100%;min-width:290px;overflow:hidden}.player,.player *,.player ::after,.player ::before{box-sizing:border-box}.player-video-wrapper{position:relative}.player video{width:100%;height:auto;vertical-align:middle}.player-captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px;min-height:2.5em;color:#fff;font-size:16px;font-weight:600;text-shadow:-1px -1px 0 #565d64,1px -1px 0 #565d64,-1px 1px 0 #565d64,1px 1px 0 #565d64;text-align:center;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}@media (min-width:768px){.player-captions{font-size:24px}}.player.captions-active .player-captions{display:block}.player-controls{zoom:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;position:relative;padding:20px 10px 10px;background:#343f4a;line-height:1;text-align:center}.player-controls:after,.player-controls:before{content:"";display:table}.player-controls:after{clear:both}.player-controls-sound{display:block;margin:10px auto 0}@media (min-width:560px){.player-controls-playback{float:left}.player-controls-sound{float:right;margin-top:0}}.player-controls button,.player-controls input+label{display:inline-block;vertical-align:middle;margin:0 2px;padding:5px 10px;transition:background .3s ease;border-radius:3px;cursor:pointer}.player-controls button svg,.player-controls input+label svg{width:18px;height:18px;display:block;fill:currentColor;transition:fill .3s ease}.player-controls input+label,.player-controls input.inverted:checked+label{color:#565d64}.player-controls button,.player-controls input.inverted+label,.player-controls input:checked+label{color:#cbd0d3}.player-controls button{border:0;background:0 0;overflow:hidden}.player-controls button:focus,.player-controls input:focus+label{outline:#000 dotted thin;outline-offset:1px;color:#fff}.player-controls button:hover,.player-controls input+label:hover{background:#3498db;color:#fff}.player-controls .icon-exit-fullscreen,.player-controls .icon-muted{display:none}.player-controls .player-time{display:inline-block;vertical-align:middle;margin-left:10px;color:#cbd0d3;font-weight:600;font-size:14px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.player-progress{position:absolute;top:0;left:0;right:0;width:100%;height:10px;background:#6e777f}.player-progress-buffer,.player-progress-played{position:absolute;left:0;top:0;width:100%;height:100%;margin:0;vertical-align:top}.player-progress-buffer[value],.player-progress-played[value]{-webkit-appearance:none;border:none;background:0 0}.player-progress-buffer[value]::-webkit-progress-bar,.player-progress-played[value]::-webkit-progress-bar{background:0 0}.player-progress-buffer[value]::-webkit-progress-value,.player-progress-played[value]::-webkit-progress-value{background:currentColor}.player-progress-buffer[value]::-moz-progress-bar,.player-progress-played[value]::-moz-progress-bar{background:currentColor}.player-progress-played{z-index:2}.player-progress-played[value]{cursor:pointer;color:#3498db}.player-progress-buffer[value]{color:#565d64}.player-controls [data-player=pause],.player.playing .player-controls [data-player=play]{display:none}.player.playing .player-controls [data-player=pause]{display:inline-block}.player.muted .player-controls .icon-muted{display:block}.player.muted .player-controls .icon-muted+svg{display:none}.player-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}.player-volume[type=range]::-webkit-slider-runnable-track{height:6px;background:#565d64;border:0;border-radius:3px}.player-volume[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-3px;height:12px;width:12px;background:#cbd0d3;border:0;border-radius:6px;transition:background .3s ease;cursor:ew-resize}.player-volume[type=range]::-moz-range-track{height:6px;background:#565d64;border:0;border-radius:3px}.player-volume[type=range]::-moz-range-thumb{height:12px;width:12px;background:#cbd0d3;border:0;border-radius:6px;transition:background .3s ease;cursor:ew-resize}.player-volume[type=range]::-ms-track{height:6px;background:0 0;border-color:transparent;border-width:3px 0;color:transparent}.player-volume[type=range]::-ms-fill-lower,.player-volume[type=range]::-ms-fill-upper{height:6px;background:#565d64;border:0;border-radius:3px}.player-volume[type=range]::-ms-thumb{height:12px;width:12px;background:#cbd0d3;border:0;border-radius:6px;transition:background .3s ease;cursor:ew-resize}.player-volume[type=range]:focus{outline:0}.player-volume[type=range]:focus::-webkit-slider-thumb{background:#3498db}.player-volume[type=range]:focus::-moz-range-thumb{background:#3498db}.player-volume[type=range]:focus::-ms-thumb{background:#3498db}.player-fullscreen,.player.fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000}.player-fullscreen .player-video-wrapper,.player.fullscreen-active .player-video-wrapper{height:100%;width:100%}.player-fullscreen .player-video-wrapper video,.player.fullscreen-active .player-video-wrapper video{height:100%}.player-fullscreen .player-video-wrapper .player-captions,.player.fullscreen-active .player-video-wrapper .player-captions{top:auto;bottom:90px}@media (min-width:560px) and (max-width:767px){.player-fullscreen .player-video-wrapper .player-captions,.player.fullscreen-active .player-video-wrapper .player-captions{bottom:60px}}@media (min-width:768px){.player-fullscreen .player-video-wrapper .player-captions,.player.fullscreen-active .player-video-wrapper .player-captions{bottom:80px}}.player-fullscreen .player-controls,.player.fullscreen-active .player-controls{position:absolute;bottom:0;left:0;right:0}.player.fullscreen-active .icon-exit-fullscreen{display:block}.player [data-player=captions],.player [data-player=captions]+label,.player [data-player=fullscreen],.player [data-player=fullscreen]+label,.player.fullscreen-active .icon-exit-fullscreen+svg{display:none}.player.captions-enabled [data-player=captions],.player.captions-enabled [data-player=captions]+label,.player.fullscreen-enabled [data-player=fullscreen],.player.fullscreen-enabled [data-player=fullscreen]+label{display:inline-block}.player-fullscreen [data-player=fullscreen],.player-fullscreen [data-player=fullscreen]+label{display:none!important} \ No newline at end of file +.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}.player{position:relative;max-width:100%;min-width:290px;overflow:hidden}.player,.player *,.player ::after,.player ::before{box-sizing:border-box}.player-video-wrapper{position:relative}.player video{width:100%;height:auto;vertical-align:middle}.player-captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px;min-height:2.5em;color:#fff;font-size:16px;font-weight:600;text-shadow:-1px -1px 0 #565d64,1px -1px 0 #565d64,-1px 1px 0 #565d64,1px 1px 0 #565d64;text-align:center;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}@media (min-width:768px){.player-captions{font-size:24px}}.player.captions-active .player-captions{display:block}.player-controls{zoom:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;position:relative;padding:20px 10px 10px;background:#343f4a;line-height:1;text-align:center}.player-controls:after,.player-controls:before{content:"";display:table}.player-controls:after{clear:both}.player-controls-sound{display:block;margin:10px auto 0}@media (min-width:560px){.player-controls-playback{float:left}.player-controls-sound{float:right;margin-top:0}}.player-controls button,.player-controls input+label{display:inline-block;vertical-align:middle;margin:0 2px;padding:5px 10px;transition:background .3s ease;border-radius:3px;cursor:pointer}.player-controls button svg,.player-controls input+label svg{width:18px;height:18px;display:block;fill:currentColor;transition:fill .3s ease}.player-controls .inverted:checked+label,.player-controls [type=checkbox]+label{color:#565d64}.player-controls .inverted+label,.player-controls [type=checkbox]:checked+label,.player-controls button{color:#cbd0d3}.player-controls button{border:0;background:0 0;overflow:hidden}.player-controls [type=checkbox]+label:hover,.player-controls [type=checkbox]:focus+label,.player-controls button:focus,.player-controls button:hover{background:#3498db;color:#fff}.player-controls [type=checkbox]:focus+label,.player-controls button:focus{outline:0}.player-controls .icon-captions-on,.player-controls .icon-exit-fullscreen,.player-controls .icon-muted{display:none}.player-controls .player-time{display:inline-block;vertical-align:middle;margin-left:10px;color:#cbd0d3;font-weight:600;font-size:14px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.player-progress{position:absolute;top:0;left:0;right:0;width:100%;height:10px;background:#6e777f}.player-progress-buffer,.player-progress-played,.player-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}.player-progress-buffer::-webkit-progress-bar,.player-progress-played::-webkit-progress-bar{background:0 0}.player-progress-buffer::-webkit-progress-value,.player-progress-played::-webkit-progress-value{background:currentColor}.player-progress-buffer::-moz-progress-bar,.player-progress-played::-moz-progress-bar{background:currentColor}.player-progress-played{z-index:2;color:#3498db}.player-progress-buffer{color:#565d64}.player-progress-seek[type=range]{z-index:3;cursor:pointer;outline:0}.player-progress-seek[type=range]::-webkit-slider-runnable-track{background:0 0;border:0}.player-progress-seek[type=range]::-webkit-slider-thumb{-webkit-appearance:none;background:0 0;border:0;width:2px;height:10px}.player-progress-seek[type=range]::-moz-range-track{background:0 0;border:0}.player-progress-seek[type=range]::-moz-range-thumb{-moz-appearance:none;background:0 0;border:0;width:2px;height:10px}.player-progress-seek[type=range]::-ms-track{color:transparent;background:0 0;border:0}.player-progress-seek[type=range]::-ms-fill-lower,.player-progress-seek[type=range]::-ms-fill-upper{background:0 0;border:0}.player-progress-seek[type=range]::-ms-thumb{background:0 0;border:0;width:2px;height:10px}.player-progress-seek[type=range]:focus{outline:0}.player-progress-seek[type=range]::-moz-focus-outer{border:0}.player-controls [data-player=pause],.player.playing .player-controls [data-player=play]{display:none}.player.playing .player-controls [data-player=pause]{display:inline-block}.player-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}.player-volume[type=range]::-webkit-slider-runnable-track{height:6px;background:#565d64;border:0;border-radius:3px}.player-volume[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-3px;height:12px;width:12px;background:#cbd0d3;border:0;border-radius:6px;transition:background .3s ease;cursor:ew-resize}.player-volume[type=range]::-moz-range-track{height:6px;background:#565d64;border:0;border-radius:3px}.player-volume[type=range]::-moz-range-thumb{height:12px;width:12px;background:#cbd0d3;border:0;border-radius:6px;transition:background .3s ease;cursor:ew-resize}.player-volume[type=range]::-ms-track{height:6px;background:0 0;border-color:transparent;border-width:3px 0;color:transparent}.player-volume[type=range]::-ms-fill-lower,.player-volume[type=range]::-ms-fill-upper{height:6px;background:#565d64;border:0;border-radius:3px}.player-volume[type=range]::-ms-thumb{height:12px;width:12px;background:#cbd0d3;border:0;border-radius:6px;transition:background .3s ease;cursor:ew-resize}.player-volume[type=range]:focus{outline:0}.player-volume[type=range]:focus::-webkit-slider-thumb{background:#3498db}.player-volume[type=range]:focus::-moz-range-thumb{background:#3498db}.player-volume[type=range]:focus::-ms-thumb{background:#3498db}.player-fullscreen,.player.fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000}.player-fullscreen .player-video-wrapper,.player.fullscreen-active .player-video-wrapper{height:100%;width:100%}.player-fullscreen .player-video-wrapper video,.player.fullscreen-active .player-video-wrapper video{height:100%}.player-fullscreen .player-video-wrapper .player-captions,.player.fullscreen-active .player-video-wrapper .player-captions{top:auto;bottom:90px}@media (min-width:560px) and (max-width:767px){.player-fullscreen .player-video-wrapper .player-captions,.player.fullscreen-active .player-video-wrapper .player-captions{bottom:60px}}@media (min-width:768px){.player-fullscreen .player-video-wrapper .player-captions,.player.fullscreen-active .player-video-wrapper .player-captions{bottom:80px}}.player-fullscreen .player-controls,.player.fullscreen-active .player-controls{position:absolute;bottom:0;left:0;right:0}.player.captions-active .player-controls .icon-captions-on,.player.fullscreen-active .icon-exit-fullscreen,.player.muted .player-controls .icon-muted{display:block}.player [data-player=captions],.player [data-player=captions]+label,.player [data-player=fullscreen],.player [data-player=fullscreen]+label,.player.captions-active .player-controls .icon-captions-on+svg,.player.fullscreen-active .icon-exit-fullscreen+svg,.player.muted .player-controls .icon-muted+svg{display:none}.player.captions-enabled [data-player=captions],.player.captions-enabled [data-player=captions]+label,.player.fullscreen-enabled [data-player=fullscreen],.player.fullscreen-enabled [data-player=fullscreen]+label{display:inline-block}.player-fullscreen [data-player=fullscreen],.player-fullscreen [data-player=fullscreen]+label{display:none!important} \ No newline at end of file diff --git a/dist/plyr.js b/dist/plyr.js index 200c18b4..16995914 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -1 +1 @@ -!function(e){"use strict";function t(e,t){g.debug&&window.console&&console[t?"error":"log"](e)}function n(){var e,t,n,r=navigator.userAgent,s=navigator.appName,o=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",o="11;"):-1!==(t=r.indexOf("MSIE"))?(s="IE",o=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(s="Chrome",o=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(s="Safari",o=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(o=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(s="Firefox",o=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(s=r.substring(e,t),o=r.substring(t+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(n=o.indexOf(";"))&&(o=o.substring(0,n)),-1!==(n=o.indexOf(" "))&&(o=o.substring(0,n)),a=parseInt(""+o,10),isNaN(a)&&(o=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10)),[s,a]}function r(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function s(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,s=e[n],o=s.parentNode,a=s.nextSibling;r.appendChild(s),a?o.insertBefore(r,a):o.appendChild(r)}}function o(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 a(e,t,n,r){t=t.split(" ");for(var s=0;sn;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return"webkit"===e.prefix&&navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&(e.supportsFullScreen=!1),e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!==document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]("webkit"===this.prefix?e.ALLOW_KEYBOARD_INPUT:null)},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function m(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function b(e){function a(){for(U.subcount=0;b(U.captions[U.subcount][0])U.captions.length-1){U.subcount=U.captions.length-1;break}}function p(){o(U.container,g.classes.captions.enabled,!0),g.captions.defaultActive&&(o(U.container,g.classes.captions.active,!0),U.buttons.captions.setAttribute("checked","checked"))}function d(e){var t=[];return t=e.split(" --> "),y(t[0])}function b(e){var t=[];return t=e.split(" --> "),y(t[1])}function y(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function h(e){return U.container.querySelectorAll(e)}function x(e){return h(e)[0]}function T(){try{return window.self!==window.top}catch(e){return!0}}function k(){t("Injecting custom controls.");var e=g.html;e=r(e,"{seektime}",g.seekTime),e=r(e,"{id}",U.random),U.container.insertAdjacentHTML("beforeend",e)}function w(){try{return U.controls=x(g.selectors.controls),U.buttons={},U.buttons.play=x(g.selectors.buttons.play),U.buttons.pause=x(g.selectors.buttons.pause),U.buttons.restart=x(g.selectors.buttons.restart),U.buttons.rewind=x(g.selectors.buttons.rewind),U.buttons.forward=x(g.selectors.buttons.forward),U.buttons.mute=x(g.selectors.buttons.mute),U.buttons.captions=x(g.selectors.buttons.captions),U.buttons.fullscreen=x(g.selectors.buttons.fullscreen),U.progress={},U.progress.container=x(g.selectors.progress.container),U.progress.buffer={},U.progress.buffer.bar=x(g.selectors.progress.buffer),U.progress.buffer.text=U.progress.buffer.bar.getElementsByTagName("span")[0],U.progress.played={},U.progress.played.bar=x(g.selectors.progress.played),U.progress.played.text=U.progress.played.bar.getElementsByTagName("span")[0],U.volume=x(g.selectors.buttons.volume),U.duration=x(g.selectors.duration),U.seekTime=h(g.selectors.seekTime),!0}catch(e){return t("It looks like there's a problem with your controls html. Bailing.",!0),!1}}function S(){var e=U.buttons.play.innerText;"undefined"!=typeof g.title&&g.title.length&&(e=U.buttons.play.innerText+", "+g.title),U.buttons.play.setAttribute("aria-label",e)}function F(){if(U.media=U.container.querySelectorAll("audio, video")[0],!U.media)return t("No audio or video element found!",!0),!1;if(U.media.removeAttribute("controls"),U.type="video"==U.media.tagName.toLowerCase()?"video":"audio",o(U.container,g.classes[U.type],!0),o(U.container,g.classes.stopped,null===U.media.getAttribute("autoplay")),"video"===U.type){var e=document.createElement("div");e.setAttribute("class",g.classes.videoWrapper),s(U.media,e),U.videoContainer=e}}function N(){if("video"===U.type){U.videoContainer.insertAdjacentHTML("afterbegin","
"),U.captionsContainer=x(g.selectors.captions),U.isTextTracks=!1,U.media.textTracks&&(U.isTextTracks=!0);for(var e,n="",r=U.media.childNodes,s=0;s=31||"Safari"===U.browserName&&U.browserMajorVersion>=7)&&(t("Detected IE 10/11 or Firefox 31+ or Safari 7+."),U.isTextTracks=!1),U.isTextTracks){t("TextTracks supported.");for(var u=0;ud(U.captions[U.subcount][0])&&U.media.currentTime.toFixed(1)b(U.captions[U.subcount][0])&&U.subcount=7){t("Safari 7+ detected; removing track from DOM."),a=U.media.getElementsByTagName("track");for(var m=0;mt?0:t,U.isTextTracks||"video"!==U.type||a(U)}function V(e){"number"!=typeof e&&(e=g.seekTime);var t=U.media.currentTime+e;U.media.currentTime=t>U.media.duration?U.media.duration:t,U.isTextTracks||"video"!==U.type||a(U)}function O(){o(U.container,g.classes.playing,!U.media.paused),o(U.container,g.classes.stopped,U.media.paused)}function j(){var e=v.supportsFullScreen;event.type===v.fullScreenEventName?g.fullscreen.active=v.isFullScreen():e?(v.isFullScreen()?v.cancelFullScreen():v.requestFullScreen(U.container),g.fullscreen.active=v.isFullScreen()):(g.fullscreen.active=!g.fullscreen.active,g.fullscreen.active?(i(document,"keyup",q),document.body.style.overflow="hidden"):(c(document,"keyup",q),document.body.style.overflow="")),o(U.container,g.classes.fullscreen.active,g.fullscreen.active)}function q(e){27===(e.which||e.charCode||e.keyCode)&&g.fullscreen.active&&j()}function H(e){"undefined"==typeof e&&(e=g.storage.enabled&&m().supported?window.localStorage.plyr_volume||g.volume:g.volume),e>10&&(e=10),U.volume.value=e,U.media.volume=parseFloat(e/10),W(),g.storage.enabled&&m().supported&&(window.localStorage.plyr_volume=e)}function B(e){"undefined"==typeof active&&(e=!U.media.muted,U.buttons.mute.checked=e),U.media.muted=e,W()}function R(e){"undefined"==typeof e&&(e=-1===U.container.className.indexOf(g.classes.captions.active),U.buttons.captions.checked=e),e?o(U.container,g.classes.captions.active,!0):o(U.container,g.classes.captions.active)}function W(){o(U.container,g.classes.muted,0===U.media.volume||U.media.muted)}function X(e){var t,n,r=0;switch(e.type){case"timeupdate":t=U.progress.played.bar,n=U.progress.played.text,r=u(U.media.currentTime,U.media.duration);break;case"playing":case"progress":t=U.progress.buffer.bar,n=U.progress.buffer.text,r=function(){var e=U.media.buffered;return e.length?u(e.end(0),U.media.duration):0}()}t&&r>0&&(t.value=r,n.innerHTML=r)}function _(){U.secs=parseInt(U.media.currentTime%60),U.mins=parseInt(U.media.currentTime/60%60),U.secs=("0"+U.secs).slice(-2),U.mins=("0"+U.mins).slice(-2),U.duration.innerHTML=U.mins+":"+U.secs}function D(){i(U.buttons.play,"click",function(){E(),setTimeout(function(){U.buttons.pause.focus()},100)}),i(U.buttons.pause,"click",function(){A(),setTimeout(function(){U.buttons.play.focus()},100)}),i(U.buttons.restart,"click",I),i(U.buttons.rewind,"click",L),i(U.buttons.forward,"click",V),i(U.volume,"change",function(){H(this.value)}),i(U.buttons.mute,"change",function(){B(this.checked)}),i(U.buttons.fullscreen,"click",j),i(document,v.fullScreenEventName,j),"video"===U.type&&g.click&&i(U.videoContainer,"click",function(){U.media.paused?E():U.media.ended?I():A()}),i(U.media,"timeupdate",_),i(U.media,"timeupdate",X),i(U.progress.played.bar,"click",function(e){U.pos=l(e).x/this.offsetWidth,U.media.currentTime=U.pos*U.media.duration,U.isTextTracks||"video"!==U.type||a(U)}),i(U.buttons.captions,"click",function(){R(this.checked)}),i(U.media,"ended",function(){"video"===U.type&&(U.captionsContainer.innerHTML=""),O()}),i(U.media,"progress",X),i(U.media,"playing",X),i(U.media,"volumechange",W),i(U.media,"play pause",O)}function P(){return v=f(),U.browserInfo=n(),U.browserName=U.browserInfo[0],U.browserMajorVersion=U.browserInfo[1],t(U.browserName+" "+U.browserMajorVersion),"IE"!==U.browserName||8!==U.browserMajorVersion&&9!==U.browserMajorVersion?(F(),U.random=Math.floor(1e4*Math.random()),k(),w()?(S(),N(),H(),M(),C(),D(),void 0):!1):(t("Browser not suppported.",!0),!1)}var U=this;return U.container=e,P(),{media:U.media,play:E,pause:A,restart:I,rewind:L,forward:V,setVolume:H,toggleMute:B,toggleCaptions:R}}var v,g,y={enabled:!0,debug:!1,seekTime:10,volume:5,click:!0,selectors:{container:".player",controls:".player-controls",buttons:{play:"[data-player='play']",pause:"[data-player='pause']",restart:"[data-player='restart']",rewind:"[data-player='rewind']",forward:"[data-player='fast-forward']",mute:"[data-player='mute']",volume:"[data-player='volume']",captions:"[data-player='captions']",fullscreen:"[data-player='fullscreen']"},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",duration:".player-duration",seekTime:".player-seek-time"},classes:{video:"player-video",videoWrapper:"player-video-wrapper",audio:"player-audio",stopped:"stopped",playing:"playing",muted:"muted",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0},storage:{enabled:!0}};e.setup=function(e){if(g=d(y,e),!g.enabled)return!1;for(var t=document.querySelectorAll(g.selectors.container),n=[],r=t.length-1;r>=0;r--){var s=t[r];"undefined"==typeof s.plyr&&(s.plyr=new b(s)),n.push(s.plyr)}return n}}(this.plyr=this.plyr||{}); \ No newline at end of file +!function(e){"use strict";function t(e,t){b.debug&&window.console&&console[t?"error":"log"](e)}function n(){var e,t,n,s=navigator.userAgent,r=navigator.appName,a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(r="IE",a="11;"):-1!==(t=s.indexOf("MSIE"))?(r="IE",a=s.substring(t+5)):-1!==(t=s.indexOf("Chrome"))?(r="Chrome",a=s.substring(t+7)):-1!==(t=s.indexOf("Safari"))?(r="Safari",a=s.substring(t+7),-1!==(t=s.indexOf("Version"))&&(a=s.substring(t+8))):-1!==(t=s.indexOf("Firefox"))?(r="Firefox",a=s.substring(t+8)):(e=s.lastIndexOf(" ")+1)<(t=s.lastIndexOf("/"))&&(r=s.substring(e,t),a=s.substring(t+1),r.toLowerCase()==r.toUpperCase()&&(r=navigator.appName)),-1!==(n=a.indexOf(";"))&&(a=a.substring(0,n)),-1!==(n=a.indexOf(" "))&&(a=a.substring(0,n)),o=parseInt(""+a,10),isNaN(o)&&(a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),[r,o]}function s(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function r(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var s=n>0?t.cloneNode(!0):t,r=e[n],a=r.parentNode,o=r.nextSibling;s.appendChild(r),o?a.insertBefore(s,o):a.appendChild(s)}}function a(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=s+(n?" "+t:"")}}function o(e,t,n,s){t=t.split(" ");for(var r=0;rn;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return"webkit"===e.prefix&&navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&(e.supportsFullScreen=!1),e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!==document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]("webkit"===this.prefix?e.ALLOW_KEYBOARD_INPUT:null)},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function d(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function f(e){function o(){for(D.subcount=0;v(D.captions[D.subcount][0])D.captions.length-1){D.subcount=D.captions.length-1;break}}function u(){a(D.container,b.classes.captions.enabled,!0),b.captions.defaultActive&&(a(D.container,b.classes.captions.active,!0),D.buttons.captions.setAttribute("checked","checked"))}function f(e){var t=[];return t=e.split(" --> "),g(t[0])}function v(e){var t=[];return t=e.split(" --> "),g(t[1])}function g(e){if(null===e||void 0===e)return 0;var t,n=[],s=[];return n=e.split(","),s=n[0].split(":"),t=Math.floor(60*s[0]*60)+Math.floor(60*s[1])+Math.floor(s[2])}function y(e){return D.container.querySelectorAll(e)}function h(e){return y(e)[0]}function k(){try{return window.self!==window.top}catch(e){return!0}}function x(){t("Injecting custom controls.");var e=b.html;e=s(e,"{seektime}",b.seekTime),e=s(e,"{id}",D.random),D.container.insertAdjacentHTML("beforeend",e)}function w(){try{return D.controls=h(b.selectors.controls),D.buttons={},D.buttons.seek=h(b.selectors.buttons.seek),D.buttons.play=h(b.selectors.buttons.play),D.buttons.pause=h(b.selectors.buttons.pause),D.buttons.restart=h(b.selectors.buttons.restart),D.buttons.rewind=h(b.selectors.buttons.rewind),D.buttons.forward=h(b.selectors.buttons.forward),D.buttons.mute=h(b.selectors.buttons.mute),D.buttons.captions=h(b.selectors.buttons.captions),D.buttons.fullscreen=h(b.selectors.buttons.fullscreen),D.progress={},D.progress.container=h(b.selectors.progress.container),D.progress.buffer={},D.progress.buffer.bar=h(b.selectors.progress.buffer),D.progress.buffer.text=D.progress.buffer.bar.getElementsByTagName("span")[0],D.progress.played={},D.progress.played.bar=h(b.selectors.progress.played),D.progress.played.text=D.progress.played.bar.getElementsByTagName("span")[0],D.volume=h(b.selectors.buttons.volume),D.duration=h(b.selectors.duration),D.seekTime=y(b.selectors.seekTime),!0}catch(e){return t("It looks like there's a problem with your controls html. Bailing.",!0),!1}}function T(){var e=D.buttons.play.innerText||"Play";"undefined"!=typeof b.title&&b.title.length&&(e+=", "+b.title),D.buttons.play.setAttribute("aria-label",e)}function S(){if(D.media=D.container.querySelectorAll("audio, video")[0],!D.media)return t("No audio or video element found!",!0),!1;if(D.media.removeAttribute("controls"),D.type="video"==D.media.tagName.toLowerCase()?"video":"audio",a(D.container,b.classes[D.type],!0),a(D.container,b.classes.stopped,null===D.media.getAttribute("autoplay")),"video"===D.type){var e=document.createElement("div");e.setAttribute("class",b.classes.videoWrapper),r(D.media,e),D.videoContainer=e}}function F(){if("video"===D.type){D.videoContainer.insertAdjacentHTML("afterbegin","
"),D.captionsContainer=h(b.selectors.captions),D.isTextTracks=!1,D.media.textTracks&&(D.isTextTracks=!0);for(var e,n="",s=D.media.childNodes,r=0;r=31||"Safari"===D.browserName&&D.browserMajorVersion>=7)&&(t("Detected IE 10/11 or Firefox 31+ or Safari 7+."),D.isTextTracks=!1),D.isTextTracks){t("TextTracks supported.");for(var c=0;cf(D.captions[D.subcount][0])&&D.media.currentTime.toFixed(1)v(D.captions[D.subcount][0])&&D.subcount=7){t("Safari 7+ detected; removing track from DOM."),o=D.media.getElementsByTagName("track");for(var m=0;mt?0:t,D.isTextTracks||"video"!==D.type||o(D)}function I(e){"number"!=typeof e&&(e=b.seekTime);var t=D.media.currentTime+e;D.media.currentTime=t>D.media.duration?D.media.duration:t,D.isTextTracks||"video"!==D.type||o(D)}function V(){a(D.container,b.classes.playing,!D.media.paused),a(D.container,b.classes.stopped,D.media.paused)}function L(e){var t=m.supportsFullScreen;e&&e.type===m.fullScreenEventName?b.fullscreen.active=m.isFullScreen():t?(m.isFullScreen()?m.cancelFullScreen():m.requestFullScreen(D.container),b.fullscreen.active=m.isFullScreen()):(b.fullscreen.active=!b.fullscreen.active,b.fullscreen.active?(i(document,"keyup",O),document.body.style.overflow="hidden"):(l(document,"keyup",O),document.body.style.overflow="")),a(D.container,b.classes.fullscreen.active,b.fullscreen.active)}function O(e){27===(e.which||e.charCode||e.keyCode)&&b.fullscreen.active&&L()}function j(e){"undefined"==typeof e&&(e=b.storage.enabled&&d().supported?window.localStorage.plyr_volume||b.volume:b.volume),e>10&&(e=10),D.volume.value=e,D.media.volume=parseFloat(e/10),R(),b.storage.enabled&&d().supported&&(window.localStorage.plyr_volume=e)}function q(e){"undefined"==typeof active&&(e=!D.media.muted,D.buttons.mute.checked=e),D.media.muted=e,R()}function H(e){"undefined"==typeof e&&(e=-1===D.container.className.indexOf(b.classes.captions.active),D.buttons.captions.checked=e),e?a(D.container,b.classes.captions.active,!0):a(D.container,b.classes.captions.active)}function R(){a(D.container,b.classes.muted,0===D.media.volume||D.media.muted)}function B(e){var t,n,s=0;switch(e.type){case"timeupdate":t=D.progress.played.bar,n=D.progress.played.text,s=c(D.media.currentTime,D.media.duration),D.buttons.seek.value=s;break;case"change":case"input":t=D.progress.played.bar,n=D.progress.played.text,s=e.target.value;break;case"playing":case"progress":t=D.progress.buffer.bar,n=D.progress.buffer.text,s=function(){var e=D.media.buffered;return e.length?c(e.end(0),D.media.duration):0}()}t&&s>0&&(t.value=s,n.innerHTML=s)}function P(){D.secs=parseInt(D.media.currentTime%60),D.mins=parseInt(D.media.currentTime/60%60),D.secs=("0"+D.secs).slice(-2),D.mins=("0"+D.mins).slice(-2),D.duration.innerHTML=D.mins+":"+D.secs}function W(){i(D.buttons.play,"click",function(){C(),setTimeout(function(){D.buttons.pause.focus()},100)}),i(D.buttons.pause,"click",function(){E(),setTimeout(function(){D.buttons.play.focus()},100)}),i(D.buttons.restart,"click",M),i(D.buttons.rewind,"click",A),i(D.buttons.forward,"click",I),i(D.volume,"change input",function(){j(this.value)}),i(D.buttons.mute,"change",function(){q(this.checked)}),i(D.buttons.fullscreen,"click",L),i(document,m.fullScreenEventName,L),"video"===D.type&&b.click&&i(D.videoContainer,"click",function(){D.media.paused?C():D.media.ended?M():E()}),i(D.media,"timeupdate",function(e){P(),B(e)}),i(D.buttons.seek,"change input",function(e){B(e),P(),D.media.currentTime=this.value/this.max*D.media.duration,D.isTextTracks||"video"!==D.type||o(D)}),i(D.buttons.captions,"click",function(){H(this.checked)}),i(D.media,"ended",function(){"video"===D.type&&(D.captionsContainer.innerHTML=""),V()}),i(D.media,"progress",B),i(D.media,"playing",B),i(D.media,"volumechange",R),i(D.media,"play pause",V)}function _(){return m=p(),D.browserInfo=n(),D.browserName=D.browserInfo[0],D.browserMajorVersion=D.browserInfo[1],t(D.browserName+" "+D.browserMajorVersion),"IE"!==D.browserName||8!==D.browserMajorVersion&&9!==D.browserMajorVersion?(S(),D.random=Math.floor(1e4*Math.random()),x(),w()?(T(),F(),j(),N(),W(),void 0):!1):(t("Browser not suppported.",!0),!1)}var D=this;return D.container=e,_(),{media:D.media,play:C,pause:E,restart:M,rewind:A,forward:I,setVolume:j,toggleMute:q,toggleCaptions:H}}var m,b,v={enabled:!0,debug:!1,seekTime:10,volume:5,click:!0,selectors:{container:".player",controls:".player-controls",buttons:{seek:"[data-player='seek']",play:"[data-player='play']",pause:"[data-player='pause']",restart:"[data-player='restart']",rewind:"[data-player='rewind']",forward:"[data-player='fast-forward']",mute:"[data-player='mute']",volume:"[data-player='volume']",captions:"[data-player='captions']",fullscreen:"[data-player='fullscreen']"},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",duration:".player-duration"},classes:{video:"player-video",videoWrapper:"player-video-wrapper",audio:"player-audio",stopped:"stopped",playing:"playing",muted:"muted",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0},storage:{enabled:!0},html:function(){return["
","
","","0% played","","","0% buffered","","
","","","","","","","","Time","00:00","","","","","","","","","","","","
"].join("\n")}()};e.setup=function(e){if(b=u(v,e),!b.enabled)return!1;for(var t=document.querySelectorAll(b.selectors.container),n=[],s=t.length-1;s>=0;s--){var r=t[s];"undefined"==typeof r.plyr&&(r.plyr=new f(r)),n.push(r.plyr)}return n}}(this.plyr=this.plyr||{}); \ No newline at end of file diff --git a/dist/sprite.svg b/dist/sprite.svg index 1c3e7031..a1de7ec8 100644 --- a/dist/sprite.svg +++ b/dist/sprite.svg @@ -1 +1 @@ -collapseexpandmutedpauserewind \ No newline at end of file +icon-captions-officon-captions-onexpandcollapsemutedpauseicon-restartrewind \ No newline at end of file diff --git a/docs/dist/docs.css b/docs/dist/docs.css index 19f19fb1..7737f4d8 100644 --- a/docs/dist/docs.css +++ b/docs/dist/docs.css @@ -1 +1 @@ -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:0 0}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}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}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}@font-face{font-family:Avenir;src:url(//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Medium.woff2) format("woff2"),url(//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Medium.woff) format("woff"),url(//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Medium.ttf) format("truetype");font-style:normal;font-weight:400}@font-face{font-family:Avenir;src:url(//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Heavy.woff2) format("woff2"),url(//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Heavy.woff) format("woff"),url(//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Heavy.ttf) format("truetype");font-style:normal;font-weight:600}*,::after,::before{box-sizing:border-box}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;background:#fff;line-height:1.5;text-align:center;color:#6D797F}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}h1{font-size:64px;font-size:4rem;color:#3498DB}p,small{margin:0 0 20px}small{display:block;padding:0 10px;font-size:14px;font-size:.9rem}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.1rem}@media (min-width:560px){header{padding-top:60px;padding-bottom:60px}}section{padding-bottom:20px}@media (min-width:560px){section{padding-bottom:40px}}a{text-decoration:none;color:#3498db;border-bottom:1px solid currentColor;transition:all .3s ease}a:focus,a:hover{color:#000}a:focus{outline:#343f4a dotted thin;outline-offset:1px}a.logo{border:0}.btn{display:inline-block;padding:10px 30px;background:#3498db;border:0;color:#fff;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:600;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:hover{color:#fff;background:#258cd1}.example-audio .player{max-width:480px}.example-video .player{max-width:1200px}.example-audio .player,.example-video .player{margin:0 auto 20px}.example-audio .player-fullscreen,.example-audio .player.fullscreen-active,.example-video .player-fullscreen,.example-video .player.fullscreen-active{max-width:none}footer{margin-bottom:20px}footer p{margin-bottom:10px} \ No newline at end of file +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:0 0}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}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}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}@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"),url(//cdn.plyr.io/fonts/avenir-medium.ttf) format("truetype");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"),url(//cdn.plyr.io/fonts/avenir-bold.ttf) format("truetype");font-style:normal;font-weight:600}*,::after,::before{box-sizing:border-box}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;background:#fff;line-height:1.5;text-align:center;color:#6D797F}.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}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}h1{font-size:64px;font-size:4rem;color:#3498DB}p,small{margin:0 0 20px}small{display:block;padding:0 10px;font-size:14px;font-size:.9rem}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.1rem}@media (min-width:560px){header{padding-top:60px;padding-bottom:60px}}section{padding-bottom:20px}@media (min-width:560px){section{padding-bottom:40px}}a{text-decoration:none;color:#3498db;border-bottom:1px solid currentColor;transition:all .3s ease}a:focus,a:hover{color:#000}a:focus{outline:#343f4a dotted thin;outline-offset:1px}a.logo{border:0}.btn{display:inline-block;padding:10px 30px;background:#3498db;border:0;color:#fff;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:600;border-radius:3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:hover{color:#fff;background:#258cd1}.example-audio .player{max-width:480px}.example-video .player{max-width:1200px}.example-audio .player,.example-video .player{margin:0 auto 20px}.example-audio .player-fullscreen,.example-audio .player.fullscreen-active,.example-video .player-fullscreen,.example-video .player.fullscreen-active{max-width:none}footer{margin-bottom:20px}footer p{margin-bottom:10px} \ No newline at end of file diff --git a/docs/dist/docs.js b/docs/dist/docs.js index 7c72517b..273c26e5 100644 --- a/docs/dist/docs.js +++ b/docs/dist/docs.js @@ -1 +1 @@ -var Hogan={};!function(t){function n(t,n,e){var s;return n&&"object"==typeof n&&(void 0!==n[t]?s=n[t]:e&&n.get&&"function"==typeof n.get&&(s=n.get(t))),s}function e(t,n,e,s,a,r){function i(){}function o(){}i.prototype=t,o.prototype=t.subs;var l,u=new i;u.subs=new o,u.subsText={},u.buf="",s=s||{},u.stackSubs=s,u.subsText=r;for(l in n)s[l]||(s[l]=n[l]);for(l in s)u.subs[l]=s[l];a=a||{},u.stackPartials=a;for(l in e)a[l]||(a[l]=e[l]);for(l in a)u.partials[l]=a[l];return u}function s(t){return String(null===t||void 0===t?"":t)}function a(t){return t=s(t),c.test(t)?t.replace(r,"&").replace(i,"<").replace(o,">").replace(l,"'").replace(u,"""):t}t.Template=function(t,n,e,s){t=t||{},this.r=t.code||this.r,this.c=e,this.options=s||{},this.text=n||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(){return""},v:a,t:s,render:function(t,n,e){return this.ri([t],n||{},e)},ri:function(t,n,e){return this.r(t,n,e)},ep:function(t,n){var s=this.partials[t],a=n[s.name];if(s.instance&&s.base==a)return s.instance;if("string"==typeof a){if(!this.c)throw new Error("No compiler available.");a=this.c.compile(a,this.options)}if(!a)return null;if(this.partials[t].base=a,s.subs){n.stackText||(n.stackText={});for(key in s.subs)n.stackText[key]||(n.stackText[key]=void 0!==this.activeSub&&n.stackText[this.activeSub]?n.stackText[this.activeSub]:this.text);a=e(a,s.subs,s.partials,this.stackSubs,this.stackPartials,n.stackText)}return this.partials[t].instance=a,a},rp:function(t,n,e,s){var a=this.ep(t,e);return a?a.ri(n,e,s):""},rs:function(t,n,e){var s=t[t.length-1];if(!p(s))return e(t,n,this),void 0;for(var a=0;a=0;u--)if(i=e[u],r=n(t,i,l),void 0!==r){o=!0;break}return o?(a||"function"!=typeof r||(r=this.mv(r,e,s)),r):a?!1:""},ls:function(t,n,e,a,r){var i=this.options.delimiters;return this.options.delimiters=r,this.b(this.ct(s(t.call(n,a)),n,e)),this.options.delimiters=i,!1},ct:function(t,n,e){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(n,e)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,n,e,s,a,r,i){var o,l=n[n.length-1],u=t.call(l);return"function"==typeof u?s?!0:(o=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,l,e,o.substring(a,r),i)):u},mv:function(t,n,e){var a=n[n.length-1],r=t.call(a);return"function"==typeof r?this.ct(s(r.call(a)),a,e):r},sub:function(t,n,e,s){var a=this.subs[t];a&&(this.activeSub=t,a(n,e,this,s),this.activeSub=!1)}};var r=/&/g,i=//g,l=/\'/g,u=/\"/g,c=/[&<>\"\']/,p=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}("undefined"!=typeof exports?exports:Hogan),function(t){function n(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function e(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function s(t,n,e){if(n.charAt(e)!=t.charAt(0))return!1;for(var s=1,a=t.length;a>s;s++)if(n.charAt(e+s)!=t.charAt(s))return!1;return!0}function a(n,e,s,o){var l=[],u=null,c=null,p=null;for(c=s[s.length-1];n.length>0;){if(p=n.shift(),c&&"<"==c.tag&&!(p.tag in w))throw new Error("Illegal content in < super tag.");if(t.tags[p.tag]<=t.tags.$||r(p,o))s.push(p),p.nodes=a(n,p.tag,s,o);else{if("/"==p.tag){if(0===s.length)throw new Error("Closing tag without opener: /"+p.n);if(u=s.pop(),p.n!=u.n&&!i(p.n,u.n,o))throw new Error("Nesting error: "+u.n+" vs. "+p.n);return u.end=p.i,l}"\n"==p.tag&&(p.last=0==n.length||"\n"==n[0].tag)}l.push(p)}if(s.length>0)throw new Error("missing closing tag: "+s.pop().n);return l}function r(t,n){for(var e=0,s=n.length;s>e;e++)if(n[e].o==t.n)return t.tag="#",!0}function i(t,n,e){for(var s=0,a=e.length;a>s;s++)if(e[s].c==t&&e[s].o==n)return!0}function o(t){var n=[];for(var e in t)n.push('"'+u(e)+'": function(c,p,t,i) {'+t[e]+"}");return"{ "+n.join(",")+" }"}function l(t){var n=[];for(var e in t.partials)n.push('"'+u(e)+'":{name:"'+u(t.partials[e].name)+'", '+l(t.partials[e])+"}");return"partials: {"+n.join(",")+"}, subs: "+o(t.subs)}function u(t){return t.replace(m,"\\\\").replace(g,'\\"').replace(d,"\\n").replace(v,"\\r").replace(y,"\\u2028").replace(x,"\\u2029")}function c(t){return~t.indexOf(".")?"d":"f"}function p(t,n){var e="<"+(n.prefix||""),s=e+t.n+k++;return n.partials[s]={name:t.n,partials:{}},n.code+='t.b(t.rp("'+u(s)+'",c,p,"'+(t.indent||"")+'"));',s}function b(t,n){n.code+="t.b(t.t(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'}function f(t){return"t.b("+t+");"}var h=/\S/,g=/\"/g,d=/\n/g,v=/\r/g,m=/\\/g,y=/\u2028/,x=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(a,r){function i(){m.length>0&&(y.push({tag:"_t",text:new String(m)}),m="")}function o(){for(var n=!0,e=k;e"==e.tag&&(e.indent=y[s].text.toString()),y.splice(s,1));else n||y.push({tag:"\n"});x=!1,k=y.length}function u(t,n){var s="="+S,a=t.indexOf(s,n),r=e(t.substring(t.indexOf("=",n)+1,a)).split(" ");return T=r[0],S=r[r.length-1],a+s.length-1}var c=a.length,p=0,b=1,f=2,g=p,d=null,v=null,m="",y=[],x=!1,w=0,k=0,T="{{",S="}}";for(r&&(r=r.split(" "),T=r[0],S=r[1]),w=0;c>w;w++)g==p?s(T,a,w)?(--w,i(),g=b):"\n"==a.charAt(w)?l(x):m+=a.charAt(w):g==b?(w+=T.length-1,v=t.tags[a.charAt(w+1)],d=v?a.charAt(w+1):"_v","="==d?(w=u(a,w),g=p):(v&&w++,g=f),x=w):s(S,a,w)?(y.push({tag:d,n:e(m),otag:T,ctag:S,i:"/"==d?x-T.length:w+S.length}),m="",w+=S.length-1,g=p,"{"==d&&("}}"==S?w++:n(y[y.length-1]))):m+=a.charAt(w);return l(x,!0),y};var w={_t:!0,"\n":!0,$:!0,"/":!0};t.stringify=function(n){return"{code: function (c,p,i) { "+t.wrapMain(n.code)+" },"+l(n)+"}"};var k=0;t.generate=function(n,e,s){k=0;var a={code:"",subs:{},partials:{}};return t.walk(n,a),s.asString?this.stringify(a,e,s):this.makeTemplate(a,e,s)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,n,e){var s=this.makePartials(t);return s.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(s,n,this,e)},t.makePartials=function(t){var n,e={subs:{},partials:t.partials,name:t.name};for(n in e.partials)e.partials[n]=this.makePartials(e.partials[n]);for(n in t.subs)e.subs[n]=new Function("c","p","t","i",t.subs[n]);return e},t.codegen={"#":function(n,e){e.code+="if(t.s(t."+c(n.n)+'("'+u(n.n)+'",c,p,1),c,p,0,'+n.i+","+n.end+',"'+n.otag+" "+n.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(n.nodes,e),e.code+="});c.pop();}"},"^":function(n,e){e.code+="if(!t.s(t."+c(n.n)+'("'+u(n.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(n.nodes,e),e.code+="};"},">":p,"<":function(n,e){var s={partials:{},code:"",subs:{},inPartial:!0};t.walk(n.nodes,s);var a=e.partials[p(n,e)];a.subs=s.subs,a.partials=s.partials},$:function(n,e){var s={subs:{},code:"",partials:e.partials,prefix:n.n};t.walk(n.nodes,s),e.subs[n.n]=s.code,e.inPartial||(e.code+='t.sub("'+u(n.n)+'",c,p,i);')},"\n":function(t,n){n.code+=f('"\\n"'+(t.last?"":" + i"))},_v:function(t,n){n.code+="t.b(t.v(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'},_t:function(t,n){n.code+=f('"'+u(t.text)+'"')},"{":b,"&":b},t.walk=function(n,e){for(var s,a=0,r=n.length;r>a;a++)s=t.codegen[n[a].tag],s&&s(n[a],e);return e},t.parse=function(t,n,e){return e=e||{},a(t,"",[],e.sectionTags||[])},t.cache={},t.cacheKey=function(t,n){return[t,!!n.asString,!!n.disableLambda,n.delimiters,!!n.modelGet].join("||")},t.compile=function(n,e){e=e||{};var s=t.cacheKey(n,e),a=this.cache[s];if(a){var r=a.partials;for(var i in r)delete r[i].instance;return a}return a=this.generate(this.parse(this.scan(n,e.delimiters),n,e),n,e),this.cache[s]=a}}("undefined"!=typeof exports?exports:Hogan);var Mustache=function(t){function n(n,e,s,a){var r=this.f(n,e,s,0),i=e;return r&&(i=i.concat(r)),t.Template.prototype.rp.call(this,n,i,s,a)}var e=function(e,s,a){this.rp=n,t.Template.call(this,e,s,a)};e.prototype=t.Template.prototype;var s,a=function(){this.cache={},this.generate=function(t,n){return new e(new Function("c","p","i",t),n,s)}};return a.prototype=t,s=new a,{to_html:function(t,n,e,a){var r=s.compile(t),i=r.render(n,e);return a?(a(i),void 0):i}}}(Hogan),templates={};templates.controls=new Hogan.Template({code:function(t,n,e){var s=this;return s.b(e=e||""),s.b('
'),s.b("\n"+e),s.b('
'),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(" 0% played"),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(" 0% buffered"),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b("
"),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' Time'),s.b("\n"+e),s.b(' 00:00'),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' "),s.b("\n"),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' '),s.b("\n"),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' "),s.b("\n"),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b("
"),s.fl()},partials:{},subs:{}}),plyr.setup({debug:!0,title:"Video demo",html:templates.controls.render({}),captions:{defaultActive:!0}}),"plyr.io"===document.domain&&(!function(t,n,e,s,a,r,i){t.GoogleAnalyticsObject=a,t[a]=t[a]||function(){(t[a].q=t[a].q||[]).push(arguments)},t[a].l=1*new Date,r=n.createElement(e),i=n.getElementsByTagName(e)[0],r.async=1,r.src=s,i.parentNode.insertBefore(r,i)}(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 +var Hogan={};!function(t){function n(t,n,e){var s;return n&&"object"==typeof n&&(void 0!==n[t]?s=n[t]:e&&n.get&&"function"==typeof n.get&&(s=n.get(t))),s}function e(t,n,e,s,a,r){function i(){}function o(){}i.prototype=t,o.prototype=t.subs;var l,u=new i;u.subs=new o,u.subsText={},u.buf="",s=s||{},u.stackSubs=s,u.subsText=r;for(l in n)s[l]||(s[l]=n[l]);for(l in s)u.subs[l]=s[l];a=a||{},u.stackPartials=a;for(l in e)a[l]||(a[l]=e[l]);for(l in a)u.partials[l]=a[l];return u}function s(t){return String(null===t||void 0===t?"":t)}function a(t){return t=s(t),c.test(t)?t.replace(r,"&").replace(i,"<").replace(o,">").replace(l,"'").replace(u,"""):t}t.Template=function(t,n,e,s){t=t||{},this.r=t.code||this.r,this.c=e,this.options=s||{},this.text=n||"",this.partials=t.partials||{},this.subs=t.subs||{},this.buf=""},t.Template.prototype={r:function(){return""},v:a,t:s,render:function(t,n,e){return this.ri([t],n||{},e)},ri:function(t,n,e){return this.r(t,n,e)},ep:function(t,n){var s=this.partials[t],a=n[s.name];if(s.instance&&s.base==a)return s.instance;if("string"==typeof a){if(!this.c)throw new Error("No compiler available.");a=this.c.compile(a,this.options)}if(!a)return null;if(this.partials[t].base=a,s.subs){n.stackText||(n.stackText={});for(key in s.subs)n.stackText[key]||(n.stackText[key]=void 0!==this.activeSub&&n.stackText[this.activeSub]?n.stackText[this.activeSub]:this.text);a=e(a,s.subs,s.partials,this.stackSubs,this.stackPartials,n.stackText)}return this.partials[t].instance=a,a},rp:function(t,n,e,s){var a=this.ep(t,e);return a?a.ri(n,e,s):""},rs:function(t,n,e){var s=t[t.length-1];if(!p(s))return e(t,n,this),void 0;for(var a=0;a=0;u--)if(i=e[u],r=n(t,i,l),void 0!==r){o=!0;break}return o?(a||"function"!=typeof r||(r=this.mv(r,e,s)),r):a?!1:""},ls:function(t,n,e,a,r){var i=this.options.delimiters;return this.options.delimiters=r,this.b(this.ct(s(t.call(n,a)),n,e)),this.options.delimiters=i,!1},ct:function(t,n,e){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(t,this.options).render(n,e)},b:function(t){this.buf+=t},fl:function(){var t=this.buf;return this.buf="",t},ms:function(t,n,e,s,a,r,i){var o,l=n[n.length-1],u=t.call(l);return"function"==typeof u?s?!0:(o=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(u,l,e,o.substring(a,r),i)):u},mv:function(t,n,e){var a=n[n.length-1],r=t.call(a);return"function"==typeof r?this.ct(s(r.call(a)),a,e):r},sub:function(t,n,e,s){var a=this.subs[t];a&&(this.activeSub=t,a(n,e,this,s),this.activeSub=!1)}};var r=/&/g,i=//g,l=/\'/g,u=/\"/g,c=/[&<>\"\']/,p=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}}("undefined"!=typeof exports?exports:Hogan),function(t){function n(t){"}"===t.n.substr(t.n.length-1)&&(t.n=t.n.substring(0,t.n.length-1))}function e(t){return t.trim?t.trim():t.replace(/^\s*|\s*$/g,"")}function s(t,n,e){if(n.charAt(e)!=t.charAt(0))return!1;for(var s=1,a=t.length;a>s;s++)if(n.charAt(e+s)!=t.charAt(s))return!1;return!0}function a(n,e,s,o){var l=[],u=null,c=null,p=null;for(c=s[s.length-1];n.length>0;){if(p=n.shift(),c&&"<"==c.tag&&!(p.tag in k))throw new Error("Illegal content in < super tag.");if(t.tags[p.tag]<=t.tags.$||r(p,o))s.push(p),p.nodes=a(n,p.tag,s,o);else{if("/"==p.tag){if(0===s.length)throw new Error("Closing tag without opener: /"+p.n);if(u=s.pop(),p.n!=u.n&&!i(p.n,u.n,o))throw new Error("Nesting error: "+u.n+" vs. "+p.n);return u.end=p.i,l}"\n"==p.tag&&(p.last=0==n.length||"\n"==n[0].tag)}l.push(p)}if(s.length>0)throw new Error("missing closing tag: "+s.pop().n);return l}function r(t,n){for(var e=0,s=n.length;s>e;e++)if(n[e].o==t.n)return t.tag="#",!0}function i(t,n,e){for(var s=0,a=e.length;a>s;s++)if(e[s].c==t&&e[s].o==n)return!0}function o(t){var n=[];for(var e in t)n.push('"'+u(e)+'": function(c,p,t,i) {'+t[e]+"}");return"{ "+n.join(",")+" }"}function l(t){var n=[];for(var e in t.partials)n.push('"'+u(e)+'":{name:"'+u(t.partials[e].name)+'", '+l(t.partials[e])+"}");return"partials: {"+n.join(",")+"}, subs: "+o(t.subs)}function u(t){return t.replace(y,"\\\\").replace(g,'\\"').replace(d,"\\n").replace(v,"\\r").replace(m,"\\u2028").replace(x,"\\u2029")}function c(t){return~t.indexOf(".")?"d":"f"}function p(t,n){var e="<"+(n.prefix||""),s=e+t.n+w++;return n.partials[s]={name:t.n,partials:{}},n.code+='t.b(t.rp("'+u(s)+'",c,p,"'+(t.indent||"")+'"));',s}function b(t,n){n.code+="t.b(t.t(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'}function f(t){return"t.b("+t+");"}var h=/\S/,g=/\"/g,d=/\n/g,v=/\r/g,y=/\\/g,m=/\u2028/,x=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(a,r){function i(){y.length>0&&(m.push({tag:"_t",text:new String(y)}),y="")}function o(){for(var n=!0,e=w;e"==e.tag&&(e.indent=m[s].text.toString()),m.splice(s,1));else n||m.push({tag:"\n"});x=!1,w=m.length}function u(t,n){var s="="+S,a=t.indexOf(s,n),r=e(t.substring(t.indexOf("=",n)+1,a)).split(" ");return T=r[0],S=r[r.length-1],a+s.length-1}var c=a.length,p=0,b=1,f=2,g=p,d=null,v=null,y="",m=[],x=!1,k=0,w=0,T="{{",S="}}";for(r&&(r=r.split(" "),T=r[0],S=r[1]),k=0;c>k;k++)g==p?s(T,a,k)?(--k,i(),g=b):"\n"==a.charAt(k)?l(x):y+=a.charAt(k):g==b?(k+=T.length-1,v=t.tags[a.charAt(k+1)],d=v?a.charAt(k+1):"_v","="==d?(k=u(a,k),g=p):(v&&k++,g=f),x=k):s(S,a,k)?(m.push({tag:d,n:e(y),otag:T,ctag:S,i:"/"==d?x-T.length:k+S.length}),y="",k+=S.length-1,g=p,"{"==d&&("}}"==S?k++:n(m[m.length-1]))):y+=a.charAt(k);return l(x,!0),m};var k={_t:!0,"\n":!0,$:!0,"/":!0};t.stringify=function(n){return"{code: function (c,p,i) { "+t.wrapMain(n.code)+" },"+l(n)+"}"};var w=0;t.generate=function(n,e,s){w=0;var a={code:"",subs:{},partials:{}};return t.walk(n,a),s.asString?this.stringify(a,e,s):this.makeTemplate(a,e,s)},t.wrapMain=function(t){return'var t=this;t.b(i=i||"");'+t+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(t,n,e){var s=this.makePartials(t);return s.code=new Function("c","p","i",this.wrapMain(t.code)),new this.template(s,n,this,e)},t.makePartials=function(t){var n,e={subs:{},partials:t.partials,name:t.name};for(n in e.partials)e.partials[n]=this.makePartials(e.partials[n]);for(n in t.subs)e.subs[n]=new Function("c","p","t","i",t.subs[n]);return e},t.codegen={"#":function(n,e){e.code+="if(t.s(t."+c(n.n)+'("'+u(n.n)+'",c,p,1),c,p,0,'+n.i+","+n.end+',"'+n.otag+" "+n.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(n.nodes,e),e.code+="});c.pop();}"},"^":function(n,e){e.code+="if(!t.s(t."+c(n.n)+'("'+u(n.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(n.nodes,e),e.code+="};"},">":p,"<":function(n,e){var s={partials:{},code:"",subs:{},inPartial:!0};t.walk(n.nodes,s);var a=e.partials[p(n,e)];a.subs=s.subs,a.partials=s.partials},$:function(n,e){var s={subs:{},code:"",partials:e.partials,prefix:n.n};t.walk(n.nodes,s),e.subs[n.n]=s.code,e.inPartial||(e.code+='t.sub("'+u(n.n)+'",c,p,i);')},"\n":function(t,n){n.code+=f('"\\n"'+(t.last?"":" + i"))},_v:function(t,n){n.code+="t.b(t.v(t."+c(t.n)+'("'+u(t.n)+'",c,p,0)));'},_t:function(t,n){n.code+=f('"'+u(t.text)+'"')},"{":b,"&":b},t.walk=function(n,e){for(var s,a=0,r=n.length;r>a;a++)s=t.codegen[n[a].tag],s&&s(n[a],e);return e},t.parse=function(t,n,e){return e=e||{},a(t,"",[],e.sectionTags||[])},t.cache={},t.cacheKey=function(t,n){return[t,!!n.asString,!!n.disableLambda,n.delimiters,!!n.modelGet].join("||")},t.compile=function(n,e){e=e||{};var s=t.cacheKey(n,e),a=this.cache[s];if(a){var r=a.partials;for(var i in r)delete r[i].instance;return a}return a=this.generate(this.parse(this.scan(n,e.delimiters),n,e),n,e),this.cache[s]=a}}("undefined"!=typeof exports?exports:Hogan);var Mustache=function(t){function n(n,e,s,a){var r=this.f(n,e,s,0),i=e;return r&&(i=i.concat(r)),t.Template.prototype.rp.call(this,n,i,s,a)}var e=function(e,s,a){this.rp=n,t.Template.call(this,e,s,a)};e.prototype=t.Template.prototype;var s,a=function(){this.cache={},this.generate=function(t,n){return new e(new Function("c","p","i",t),n,s)}};return a.prototype=t,s=new a,{to_html:function(t,n,e,a){var r=s.compile(t),i=r.render(n,e);return a?(a(i),void 0):i}}}(Hogan),templates={};templates.controls=new Hogan.Template({code:function(t,n,e){var s=this;return s.b(e=e||""),s.b('
'),s.b("\n"+e),s.b('
'),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(" 0% played"),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(" 0% buffered"),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b("
"),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' Time'),s.b("\n"+e),s.b(' 00:00'),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' "),s.b("\n"),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' '),s.b("\n"),s.b("\n"+e),s.b(' '),s.b("\n"+e),s.b(' "),s.b("\n"),s.b("\n"+e),s.b(' "),s.b("\n"+e),s.b(" "),s.b("\n"+e),s.b("
"),s.fl()},partials:{},subs:{}}),plyr.setup({debug:!0,title:"Video demo",html:templates.controls.render({}),captions:{defaultActive:!0}}),document.domain.indexOf("plyr.io")>-1&&(!function(t,n,e,s,a,r,i){t.GoogleAnalyticsObject=a,t[a]=t[a]||function(){(t[a].q=t[a].q||[]).push(arguments)},t[a].l=1*new Date,r=n.createElement(e),i=n.getElementsByTagName(e)[0],r.async=1,r.src=s,i.parentNode.insertBefore(r,i)}(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/dist/templates.js b/docs/dist/templates.js index 9526688b..af0e5f97 100644 --- a/docs/dist/templates.js +++ b/docs/dist/templates.js @@ -1,2 +1,2 @@ var templates = {}; - templates['controls'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
");t.b("\n" + i);t.b("
");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" 0% played");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" 0% buffered");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" Time");t.b("\n" + i);t.b(" 00:00");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
");return t.fl(); },partials: {}, subs: { }}); \ No newline at end of file + templates['controls'] = new Hogan.Template({code: function (c,p,i) { var t=this;t.b(i=i||"");t.b("
");t.b("\n" + i);t.b("
");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" 0% played");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" 0% buffered");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" Time");t.b("\n" + i);t.b(" 00:00");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b(" ");t.b("\n" + i);t.b("
");return t.fl(); },partials: {}, subs: { }}); \ No newline at end of file diff --git a/docs/error.html b/docs/error.html new file mode 100644 index 00000000..39175daa --- /dev/null +++ b/docs/error.html @@ -0,0 +1,18 @@ + + + + + Doh. Looks like something went wrong. + + + + + + +
+

Doh.

+

Looks like something went wrong.

+ Back to plyr.io +
+ + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 5dada606..45289a68 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,16 +8,16 @@ - + - +

Plyr

A simple HTML5 media player with custom controls and WebVTT captions.

- Download on Github + Download on GitHub
@@ -67,13 +67,13 @@ - + - + \ No newline at end of file diff --git a/docs/src/js/docs.js b/docs/src/js/docs.js index fa19a5b6..fd988ce3 100644 --- a/docs/src/js/docs.js +++ b/docs/src/js/docs.js @@ -15,8 +15,8 @@ plyr.setup({ }); // Google analytics -// For demo site (http://plyr.io) only -if(document.domain === "plyr.io") { +// For demo site (http://[www.]plyr.io) only +if(document.domain.indexOf("plyr.io") > -1) { (function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) diff --git a/docs/src/less/docs.less b/docs/src/less/docs.less index 8e08546f..7cb191d7 100644 --- a/docs/src/less/docs.less +++ b/docs/src/less/docs.less @@ -31,9 +31,6 @@ } // Base -html { - //font-size: 62.5%; -} body { font-family: "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif; background: #fff; @@ -42,6 +39,22 @@ body { color: #6D797F; } +// Error page +html.error, +.error body { + height: 100%; +} +.error body { + width: 100%; + display: table; + table-layout: fixed; +} +.error main { + display: table-cell; + width: 100%; + vertical-align: middle; +} + // Type h1, h2 { diff --git a/docs/src/less/lib/fontface.less b/docs/src/less/lib/fontface.less index e4375177..704503d1 100644 --- a/docs/src/less/lib/fontface.less +++ b/docs/src/less/lib/fontface.less @@ -1,16 +1,16 @@ @font-face { font-family: "Avenir"; - src: url("//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Medium.woff2") format("woff2"), - url("//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Medium.woff") format("woff"), - url("//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Medium.ttf") format("truetype"); + src: url("//cdn.plyr.io/fonts/avenir-medium.woff2") format("woff2"), + url("//cdn.plyr.io/fonts/avenir-medium.woff") format("woff"), + url("//cdn.plyr.io/fonts/avenir-medium.ttf") format("truetype"); font-style: normal; font-weight: 400; } @font-face { font-family: "Avenir"; - src: url("//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Heavy.woff2") format("woff2"), - url("//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Heavy.woff") format("woff"), - url("//cdn.sampotts.me/plyr/fonts/AvenirLTStd-Heavy.ttf") format("truetype"); + src: url("//cdn.plyr.io/fonts/avenir-bold.woff2") format("woff2"), + url("//cdn.plyr.io/fonts/avenir-bold.woff") format("woff"), + url("//cdn.plyr.io/fonts/avenir-bold.ttf") format("truetype"); font-style: normal; font-weight: 600; } \ No newline at end of file diff --git a/docs/src/templates/controls.html b/docs/src/templates/controls.html index 3970d143..afe8091b 100644 --- a/docs/src/templates/controls.html +++ b/docs/src/templates/controls.html @@ -1,5 +1,7 @@
+ + 0% played @@ -9,12 +11,12 @@
Time @@ -37,22 +39,23 @@ - + diff --git a/gulpfile.js b/gulpfile.js index 302d9d79..7b530d25 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ // Gulp build script // ========================================================================== /*global require, __dirname*/ +/*jshint -W079 */ var fs = require("fs"), path = require("path"), @@ -20,7 +21,8 @@ var fs = require("fs"), rename = require("gulp-rename"), s3 = require("gulp-s3"), gzip = require("gulp-gzip"), - replace = require("gulp-replace"); + replace = require("gulp-replace"), + open = require("gulp-open"); var root = __dirname, paths = { @@ -190,13 +192,12 @@ gulp.task("watch", function () { gulp.watch(paths.docs.src.templates, "js"); }); -// Publish the docs site -try { - var aws = loadJSON(path.join(root, "aws.json")); -} -catch (e) { } +// Publish a version to CDN and docs +// -------------------------------------------- -var version = package.version, +// Some options +var aws = loadJSON(path.join(root, "aws.json")), +version = package.version, maxAge = 31536000, // seconds 1 year options = { cdn: { @@ -216,6 +217,7 @@ options = { }, cdnpath = new RegExp(aws.cdn.bucket + "\/(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)","gi"); +// Publish version to CDN bucket gulp.task("cdn", function () { console.log("Uploading " + version + " to " + aws.cdn.bucket); @@ -228,16 +230,37 @@ gulp.task("cdn", function () { .pipe(s3(aws.cdn, options.cdn)); }); +// Publish to Docs bucket gulp.task("docs", function () { console.log("Uploading " + version + " docs to " + aws.docs.bucket); - // Replace versioned files in index.html - gulp.src([paths.docs.root + "index.html"]) + // Replace versioned files in *.html + gulp.src([paths.docs.root + "*.html"]) .pipe(replace(cdnpath, aws.cdn.bucket + "/" + version)) + .pipe(gulp.dest(paths.docs.root)) .pipe(gzip()) .pipe(s3(aws.docs, options.docs)); + + // Upload error.html to cdn using docs options + gulp.src([paths.docs.root + "error.html"]) + .pipe(gzip()) + .pipe(s3(aws.cdn, options.docs)); }); +// Open the docs site to check it's sweet +gulp.task("open", function () { + console.log("Opening " + aws.docs.bucket + "..."); + + // A file must be specified or gulp will skip the task + // Doesn't matter which file since we set the URL above + // Weird, I know... + gulp.src([paths.docs.root + "index.html"]) + .pipe(open("", { + url: "http://" + aws.docs.bucket + })); +}); + +// Do everything gulp.task("publish", function () { - run("templates", tasks.js, tasks.less, "sprite", "cdn", "docs"); + run("templates", tasks.js, tasks.less, "sprite", "cdn", "docs", "open"); }); \ No newline at end of file diff --git a/license.md b/license.md index 89bc0851..8531b2bb 100644 --- a/license.md +++ b/license.md @@ -1,12 +1,21 @@ -Copyright (c) 2015, Selz.com -All rights reserved. +The MIT License (MIT) -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Copyright (c) 2015 Selz.com -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/package.json b/package.json index 64a4de64..c6eef3da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plyr", - "version": "1.0.18", + "version": "1.0.20", "description": "A simple HTML5 media player using custom controls", "homepage": "http://plyr.io", "main": "gulpfile.js", @@ -13,6 +13,7 @@ "gulp-hogan-compile": "^0.4.1", "gulp-less": "~1.3.1", "gulp-minify-css": "~0.3.6", + "gulp-open": "^0.3.2", "gulp-rename": "^1.2.0", "gulp-replace": "^0.5.3", "gulp-s3": "^0.3.0", @@ -38,5 +39,5 @@ "authors": [ "Sam Potts " ], - "license": "BSD" + "license": "MIT" } diff --git a/readme.md b/readme.md index ae42d22c..353f022c 100644 --- a/readme.md +++ b/readme.md @@ -3,19 +3,21 @@ A simple, accessible HTML5 media player. [Checkout the demo](http://plyr.io) +[![Image of Plyr](https://cdn.plyr.io/static/plyr.png)](http://plyr.io) + ## Why? We wanted a lightweight, accessible and customisable media player that just supports *modern* browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job. ## Features - **Accessible** - full support for captions and screen readers. -- **Lightweight** - just 4.8KB minified and gzipped. +- **Lightweight** - just 5.3KB minified and gzipped. - **Customisable** - make the player look how you want with the markup you want. -- **Semantic** - uses HTML5 form inputs for volume (range) and progress element for playback progress. -- **Responsive** - any screen size. -- **No dependencies** - written in vanilla JavaScript. -- **API** - easy to use API. -- **Fallback** - if there's no support, the native players are used. -- **Fullscreen** - options to run the player full browser or the user can toggle fullscreen. +- **Semantic** - uses the *right* elements. `` for volume and `` for progress and well, `