diff options
author | Sam <me@sampotts.me> | 2015-12-13 22:49:02 +1100 |
---|---|---|
committer | Sam <me@sampotts.me> | 2015-12-13 22:49:02 +1100 |
commit | ee2cdb2c9b2dd10b0e638ff45247c55276e1bc66 (patch) | |
tree | 4feca9ae1fabe2d449184c44de109aa87876143b | |
parent | cd2532867c2976bcc61dc3fa2084a9e77bf59abf (diff) | |
parent | 1371c1341fcc95d52394dc3f69900ae5041a5701 (diff) | |
download | plyr-ee2cdb2c9b2dd10b0e638ff45247c55276e1bc66.tar.lz plyr-ee2cdb2c9b2dd10b0e638ff45247c55276e1bc66.tar.xz plyr-ee2cdb2c9b2dd10b0e638ff45247c55276e1bc66.zip |
Merge branch 'master' into develop
# Conflicts:
# dist/plyr.css
# dist/plyr.js
# docs/dist/docs.css
# docs/dist/docs.js
# docs/index.html
# docs/src/js/docs.js
# docs/src/less/components/icons.less
# docs/src/less/components/type.less
# docs/src/less/docs.less
# gulpfile.js
# package.json
# src/js/plyr.js
-rw-r--r-- | bundles.json | 2 | ||||
-rw-r--r-- | controls.md | 12 | ||||
-rw-r--r-- | dist/plyr.css | 2 | ||||
-rw-r--r-- | docs/error.html | 2 | ||||
-rw-r--r-- | docs/index.html | 55 | ||||
-rw-r--r-- | docs/index.master.html | 130 | ||||
-rw-r--r-- | docs/src/js/docs.js | 8 | ||||
-rw-r--r-- | docs/src/less/components/buttons.less | 8 | ||||
-rw-r--r-- | docs/src/less/components/icons.less | 2 | ||||
-rw-r--r-- | docs/src/less/components/type.less | 4 | ||||
-rw-r--r-- | docs/src/less/docs.less | 2 | ||||
-rw-r--r-- | docs/src/less/variables.less | 2 | ||||
-rw-r--r-- | gulpfile.js | 34 | ||||
-rw-r--r-- | package.json | 14 | ||||
-rw-r--r-- | readme.md | 18 |
15 files changed, 223 insertions, 72 deletions
diff --git a/bundles.json b/bundles.json index 1d92e632..850a0b55 100644 --- a/bundles.json +++ b/bundles.json @@ -21,4 +21,4 @@ ] } } -}
\ No newline at end of file +} diff --git a/controls.md b/controls.md index bc536f0a..c58c966b 100644 --- a/controls.md +++ b/controls.md @@ -1,10 +1,10 @@ # Controls -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. +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. ## Internationalization using default controls -You can provide an `i18n` object as one of your options when initialising the plugin which we be used when rendering the controls. +You can provide an `i18n` object as one of your options when initialising the plugin which we be used when rendering the controls. ### Example @@ -30,16 +30,16 @@ Note: `{seektime}` will be replaced with your configured seek time or the defaul ## Using custom HTML -The example on [plyr.io](http://plyr.io) setup uses a Hogan template. Check out `controls.html` in `/src/templates` to get an idea of how the default html is structured. +You can specify the HTML for the controls using the `html` option. -The classes and data attributes used in your template should match the `selectors` option. +The classes and data attributes used in your template should match the `selectors` option. You need to add several placeholders to your html template that are replaced when rendering: - `{id}` - the dynamically generated ID for the player (for form controls) - `{seektime}` - the seek time specified in options for fast forward and rewind -You can include only the controls you need when specifying custom html. +You can include only the controls you need when specifying custom html. ### Example @@ -107,4 +107,4 @@ This is an example `html` option with all controls. "</button>", "</span>", "</div>"].join("\n"); -```
\ No newline at end of file +``` diff --git a/dist/plyr.css b/dist/plyr.css index 4ad9ac55..00f2191d 100644 --- a/dist/plyr.css +++ b/dist/plyr.css @@ -1 +1 @@ -.plyr-captions,.plyr-controls,.plyr-controls .plyr-time{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.plyr-controls button:focus,.plyr-progress-seek[type=range]:focus,.plyr-volume[type=range]:focus{outline:0}@-webkit-keyframes progress{to{background-position:40px 0}}@keyframes progress{to{background-position:40px 0}}.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,.plyr-video-wrapper{position:relative}.plyr{max-width:100%;min-width:290px}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle}.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;text-align:center}.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{zoom:1;position:relative;padding:10px;background:#fff;line-height:1;text-align:center;box-shadow:0 1px 1px rgba(52,63,74,.2)}.plyr-controls:after,.plyr-controls:before{content:"";display:table}.plyr-controls:after{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,.plyr-controls button:hover{background:#3498DB;color:#fff}.plyr-controls .plyr-time,.plyr-tooltip{color:#6B7D86;font-size:14px;font-weight:600}.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{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:10px 15px;opacity:0;background:#fff;box-shadow:0 0 5px rgba(52,63,74,.1),0 0 0 1px rgba(52,63,74,.1);border-radius:3px;line-height:1.5;-webkit-transform:translate(-50%,30px) scale(.8);transform:translate(-50%,30px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:-webkit-transform .2s .1s ease,opacity .2s .1s ease;transition:transform .2s .1s ease,opacity .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(52,63,74,.1);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{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: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}.plyr-progress-buffer[value]::-webkit-progress-value,.plyr-progress-played[value]::-webkit-progress-value{background:currentColor}.plyr-progress-buffer[value]::-moz-progress-bar,.plyr-progress-played[value]::-moz-progress-bar{background:currentColor}.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:20px;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:20px;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:20px;height:10px}.plyr-progress-seek[type=range]::-moz-focus-outer{border:0}.plyr.loading .plyr-progress-buffer{-webkit-animation:progress 1s linear infinite;animation: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-controls [data-plyr=pause],.plyr.playing .plyr-controls [data-plyr=play]{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:6px;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:6px;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:6px;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-audio.ios .plyr-controls-right,.plyr.ios .plyr-volume,.plyr.ios [data-plyr=mute]{display:none}.plyr-audio.ios .plyr-controls-left{float:none}.plyr-audio .plyr-controls{padding-top:20px}.plyr-audio .plyr-progress{bottom:auto;top:0;background:#D6DADD}.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}.plyr-fullscreen.fullscreen-hide-controls.playing .plyr-controls,.plyr.fullscreen-active.fullscreen-hide-controls.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}.plyr-fullscreen.fullscreen-hide-controls.playing.plyr-hover .plyr-controls,.plyr.fullscreen-active.fullscreen-hide-controls.playing.plyr-hover .plyr-controls{-webkit-transform:translateY(0);transform:translateY(0)}.plyr-fullscreen.fullscreen-hide-controls.playing .plyr-captions,.plyr.fullscreen-active.fullscreen-hide-controls.playing .plyr-captions{bottom:5px;transition:bottom .3s .2s ease}.plyr-fullscreen .plyr-captions,.plyr-fullscreen.fullscreen-hide-controls.playing.plyr-hover .plyr-captions,.plyr.fullscreen-active .plyr-captions,.plyr.fullscreen-active.fullscreen-hide-controls.playing.plyr-hover .plyr-captions{top:auto;bottom:90px}@media (min-width:560px){.plyr-fullscreen .plyr-captions,.plyr-fullscreen.fullscreen-hide-controls.playing.plyr-hover .plyr-captions,.plyr.fullscreen-active .plyr-captions,.plyr.fullscreen-active.fullscreen-hide-controls.playing.plyr-hover .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=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]{display:inline-block}
\ No newline at end of file +.plyr-captions,.plyr-controls,.plyr-controls .plyr-time{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.plyr-controls button:focus,.plyr-progress-seek[type=range]:focus,.plyr-volume[type=range]:focus{outline:0}@-webkit-keyframes progress{to{background-position:40px 0}}@keyframes progress{to{background-position:40px 0}}.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,.plyr-video-wrapper{position:relative}.plyr{max-width:100%;min-width:290px}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle}.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;text-align:center}.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{zoom:1;position:relative;padding:10px;background:#fff;line-height:1;text-align:center;box-shadow:0 1px 1px rgba(52,63,74,.2)}.plyr-controls:after,.plyr-controls:before{content:"";display:table}.plyr-controls:after{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,.plyr-controls button:hover{background:#3498DB;color:#fff}.plyr-controls .plyr-time,.plyr-tooltip{color:#6B7D86;font-size:14px;font-weight:600}.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{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:10px 15px;opacity:0;background:#fff;box-shadow:0 0 5px rgba(52,63,74,.1),0 0 0 1px rgba(52,63,74,.1);border-radius:3px;line-height:1.5;-webkit-transform:translate(-50%,30px) scale(.8);transform:translate(-50%,30px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:opacity .2s .1s ease,-webkit-transform .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s 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(52,63,74,.1);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{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: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}.plyr-progress-buffer[value]::-webkit-progress-value,.plyr-progress-played[value]::-webkit-progress-value{background:currentColor}.plyr-progress-buffer[value]::-moz-progress-bar,.plyr-progress-played[value]::-moz-progress-bar{background:currentColor}.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:20px;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:20px;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:20px;height:10px}.plyr-progress-seek[type=range]::-moz-focus-outer{border:0}.plyr.loading .plyr-progress-buffer{-webkit-animation:progress 1s linear infinite;animation: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-controls [data-plyr=pause],.plyr.playing .plyr-controls [data-plyr=play]{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:6px;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:6px;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:6px;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-audio.ios .plyr-controls-right,.plyr.ios .plyr-volume,.plyr.ios [data-plyr=mute]{display:none}.plyr-audio.ios .plyr-controls-left{float:none}.plyr-audio .plyr-controls{padding-top:20px}.plyr-audio .plyr-progress{bottom:auto;top:0;background:#D6DADD}.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}.plyr-fullscreen.fullscreen-hide-controls.playing .plyr-controls,.plyr.fullscreen-active.fullscreen-hide-controls.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.fullscreen-hide-controls.playing.plyr-hover .plyr-controls,.plyr.fullscreen-active.fullscreen-hide-controls.playing.plyr-hover .plyr-controls{-webkit-transform:translateY(0);transform:translateY(0)}.plyr-fullscreen.fullscreen-hide-controls.playing .plyr-captions,.plyr.fullscreen-active.fullscreen-hide-controls.playing .plyr-captions{bottom:5px;transition:bottom .3s .2s ease}.plyr-fullscreen .plyr-captions,.plyr-fullscreen.fullscreen-hide-controls.playing.plyr-hover .plyr-captions,.plyr.fullscreen-active .plyr-captions,.plyr.fullscreen-active.fullscreen-hide-controls.playing.plyr-hover .plyr-captions{top:auto;bottom:90px}@media (min-width:560px){.plyr-fullscreen .plyr-captions,.plyr-fullscreen.fullscreen-hide-controls.playing.plyr-hover .plyr-captions,.plyr.fullscreen-active .plyr-captions,.plyr.fullscreen-active.fullscreen-hide-controls.playing.plyr-hover .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=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]{display:inline-block}
\ No newline at end of file diff --git a/docs/error.html b/docs/error.html index de0428d7..8f5086ef 100644 --- a/docs/error.html +++ b/docs/error.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Docs styles --> - <link rel="stylesheet" href="//cdn.plyr.io/1.3.5/docs.css"> + <link rel="stylesheet" href="//cdn.plyr.io/1.3.7/docs.css"> </head> <body> <main> diff --git a/docs/index.html b/docs/index.html index d9c5f9f9..cd4248a0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,10 +8,10 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Styles --> - <link rel="stylesheet" href="https://cdn.plyr.io/1.3.5/plyr.css"> + <link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/plyr.css"> <!-- Docs styles --> - <link rel="stylesheet" href="https://cdn.plyr.io/1.3.5/docs.css"> + <link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/docs.css"> </head> <body> <header> @@ -21,12 +21,12 @@ <ul> <li> <a href="https://github.com/selz/plyr" target="_blank" class="btn btn-primary" data-shr-network="github"> - <svg class="icon"><use xlink:href="#icon-github"/></svg>Download on GitHub + <svg class="icon"><use xlink:href="#shr-github"/></svg>Download on GitHub </a> </li> <li> <a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn btn-twitter" data-shr-network="twitter"> - <svg class="icon"><use xlink:href="#icon-twitter"/></svg>Tweet + <svg class="icon"><use xlink:href="#shr-twitter"/></svg>Tweet </a> </li> </ul> @@ -56,9 +56,11 @@ <!-- Video files --> <source src="https://cdn.selz.com/plyr/1.0/movie.mp4" type="video/mp4"> <source src="https://cdn.selz.com/plyr/1.0/movie.webm" type="video/webm"> + <!-- Text track file --> <track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.0/example_captions_en.vtt" default> + <!-- Fallback for browsers that don't support the <video> element --> <a href="https://cdn.selz.com/plyr/1.0/movie.mp4">Download</a> @@ -77,22 +79,39 @@ <!-- Load SVG defs --> <!-- You should bundle all SVG/Icons into one file using a build tool such as gulp and svg store --> <script> - function loadSprite(d, u) { - var a = new XMLHttpRequest(), - b = document.body; + (function() { + [ + "https://cdn.shr.one/0.1.9/sprite.svg", + "https://cdn.plyr.io/1.3.7/sprite.svg" + ] + .forEach(function(u) { + var x = new XMLHttpRequest(), + b = document.body; + + // Check for CORS support + // If you're loading from same domain, you can remove the if statement + // XHR for Chrome/Firefox/Opera/Safari + if ("withCredentials" in x) { + x.open("GET", u, true); + } + // XDomainRequest for older IE + else if (typeof XDomainRequest != "undefined") { + x = new XDomainRequest(); + x.open("GET", u); + } + else { + return; + } - // If proper CORS supported - if("withCredentials" in a) { - a.open("GET", u, true); - a.send(); - a.onload = function(){ + x.send(); + x.onload = function() { var c = document.createElement("div"); c.setAttribute("hidden", ""); - c.innerHTML = a.responseText; + c.innerHTML = x.responseText; b.insertBefore(c, b.childNodes[0]); } - } - } + }); + })(); // Load the plyr sprite loadSprite(document, "../dist/sprite.svg"); @@ -101,12 +120,12 @@ </script> <!-- Plyr core script --> - <script src="https://cdn.plyr.io/1.3.5/plyr.js"></script> + <script src="https://cdn.plyr.io/1.3.7/plyr.js"></script> <!-- Shr core script --> - <script src="https://cdn.shr.one/0.1.7/shr.js"></script> + <script src="https://cdn.shr.one/0.1.9/shr.js"></script> <!-- Docs script --> - <script src="https://cdn.plyr.io/1.3.5/docs.js"></script> + <script src="https://cdn.plyr.io/1.3.7/docs.js"></script> </body> </html> diff --git a/docs/index.master.html b/docs/index.master.html new file mode 100644 index 00000000..c6972ae6 --- /dev/null +++ b/docs/index.master.html @@ -0,0 +1,130 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <title>Plyr - A simple HTML5 media player</title> + <meta name="description" content="A simple HTML5 media player with custom controls and WebVTT captions."> + <meta name="author" content="Sam Potts"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <!-- Styles --> + <link rel="stylesheet" href="../dist/plyr.css"> + + <!-- Docs styles --> + <link rel="stylesheet" href="dist/docs.css"> + </head> + <body> + <header> + <h1>Plyr</h1> + <p>A simple HTML5 media player with custom controls and WebVTT captions by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a> from <a href="https://twitter.com/selz" target="_blank">@selz</a></p> + <nav> + <ul> + <li> + <a href="https://github.com/selz/plyr" target="_blank" class="btn btn-primary" data-shr-network="github"> + <svg class="icon"><use xlink:href="#shr-github"/></svg>Download on GitHub + </a> + </li> + <li> + <a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn btn-twitter" data-shr-network="twitter"> + <svg class="icon"><use xlink:href="#shr-twitter"/></svg>Tweet + </a> + </li> + </ul> + </nav> + </header> + + <main role="main" id="main"> + <nav class="btn-bar nav-panel"> + <ul> + <li><a href="#video" class="btn active btn-small">Video</a></li> + <li><a href="#youtube" class="btn btn-small">YouTube</a></li> + <li><a href="#audio" class="btn btn-small">Audio</a></li> + </ul> + </nav> + <div class="panels"> + <section class="panel example-video active" id="video"> + <div class="player"> + <video poster="poster.jpg" controls crossorigin> + <!-- Video files --> + <source src="https://cdn.selz.com/plyr/1.0/movie.mp4" type="video/mp4"> + <source src="https://cdn.selz.com/plyr/1.0/movie.webm" type="video/webm"> + + <!-- Text track file --> + <track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.0/example_captions_en.vtt" default> + + <!-- Fallback for browsers that don't support the <video> element --> + <a href="https://cdn.selz.com/plyr/1.0/movie.mp4">Download</a> + </video> + </div> + <small>Big Buck Bunny. More info can be found at <a href="https://peach.blender.org" target="_blank">peach.blender.org</a>.</small> + </section> + <section class="panel example-video" id="youtube"> + <div class="player"> + <div data-video-id="Au87oAJ2jeE" data-type="youtube"></div> + </div> + <small>Envato's "Made By" interview of <a href="https://www.youtube.com/watch?v=Au87oAJ2jeE" target="_blank">Dan Cederholm</a> from <a href="https://dribbble.com" target="_blank">Dribbble</a>.</small> + </section> + <section class="panel example-audio" id="audio"> + <div class="player"> + <audio controls> + <!-- Audio files --> + <source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3" type="audio/mp3"> + <source src="//cdn.selz.com/plyr/1.0/logistics-96-sample.ogg" type="audio/ogg"> + + <!-- Fallback for browsers that don't support the <audio> element --> + <a href="//cdn.selz.com/plyr/1.0/logistics-96-sample.mp3">Download</a> + </audio> + </div> + <small>"96" by Logistics, which can be purchased from <a href="https://www.hospitalrecords.com/shop/artist/logistics" target="_blank">Hospital Records</a>.</small> + </section> + </div> + </main> + + <!-- Load SVG defs --> + <!-- You should bundle all SVG/Icons into one file using a build tool such as gulp and svg store --> + <script> + (function() { + [ + "https://cdn.shr.one/0.1.9/sprite.svg", + "../dist/sprite.svg" + ] + .forEach(function(u) { + var x = new XMLHttpRequest(), + b = document.body; + + // Check for CORS support + // If you're loading from same domain, you can remove the if statement + // XHR for Chrome/Firefox/Opera/Safari + if ("withCredentials" in x) { + x.open("GET", u, true); + } + // XDomainRequest for older IE + else if (typeof XDomainRequest != "undefined") { + x = new XDomainRequest(); + x.open("GET", u); + } + else { + return; + } + + x.send(); + x.onload = function() { + var c = document.createElement("div"); + c.setAttribute("hidden", ""); + c.innerHTML = x.responseText; + b.insertBefore(c, b.childNodes[0]); + } + }); + })(); + </script> + + <!-- Plyr core script --> + <script src="../src/js/plyr.js"></script> + + <!-- Shr core script --> + <script src="https://cdn.shr.one/0.1.9/shr.js"></script> + + <!-- Docs script --> + <script src="dist/docs.js"></script> + </body> +</html> diff --git a/docs/src/js/docs.js b/docs/src/js/docs.js index 4e2208ee..1e3c3206 100644 --- a/docs/src/js/docs.js +++ b/docs/src/js/docs.js @@ -2,7 +2,7 @@ // Docs example // ========================================================================== -/*global plyr, shr */ +/*global plyr, shr*/ // Setup the player plyr.setup({ @@ -25,7 +25,7 @@ shr.setup({ }); // General functions -(function() { +(function() { var buttons = document.querySelectorAll('[data-source]'); // Bind to each button @@ -103,7 +103,7 @@ shr.setup({ } })(); -// Google analytics +// Google analytics // 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(){ @@ -112,4 +112,4 @@ if(document.domain.indexOf('plyr.io') > -1) { })(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/src/less/components/buttons.less b/docs/src/less/components/buttons.less index 066011fe..1401cd01 100644 --- a/docs/src/less/components/buttons.less +++ b/docs/src/less/components/buttons.less @@ -78,7 +78,7 @@ nav { } } -// Shared +// Shared .btn, .btn-count { display: inline-block; @@ -88,7 +88,7 @@ nav { user-select: none; } -// Buttons +// Buttons .btn { padding: (@padding-base / 2) @padding-base; background: @body-background; @@ -121,7 +121,7 @@ nav { box-shadow: 0 1px 1px rgba(0,0,0, .15); text-shadow: 0 1px 1px rgba(0,0,0, .1); color: #fff; - + &:hover, &:focus { color: #fff; @@ -156,4 +156,4 @@ nav { border-width: 1px 0 0 1px; transform: rotate(-45deg) translate(-50%, -50%); } -}
\ No newline at end of file +} diff --git a/docs/src/less/components/icons.less b/docs/src/less/components/icons.less index 882ce25d..7bcc792e 100644 --- a/docs/src/less/components/icons.less +++ b/docs/src/less/components/icons.less @@ -19,4 +19,4 @@ label svg { a .icon, .btn .icon { margin-right: (@padding-base / 2); -}
\ No newline at end of file +} diff --git a/docs/src/less/components/type.less b/docs/src/less/components/type.less index 7b214b49..8fc200e2 100644 --- a/docs/src/less/components/type.less +++ b/docs/src/less/components/type.less @@ -29,7 +29,7 @@ small { ul li { list-style: none; - margin: 0; + margin: 0; padding: 0; } @@ -58,4 +58,4 @@ a { } .color-youtube { color: @color-youtube; -}
\ No newline at end of file +} diff --git a/docs/src/less/docs.less b/docs/src/less/docs.less index ea799382..965dcba1 100644 --- a/docs/src/less/docs.less +++ b/docs/src/less/docs.less @@ -24,4 +24,4 @@ @import "components/buttons.less"; @import "components/panels.less"; @import "components/error.less"; -@import "components/examples.less";
\ No newline at end of file +@import "components/examples.less"; diff --git a/docs/src/less/variables.less b/docs/src/less/variables.less index 8cb4bc1b..097aa1f2 100644 --- a/docs/src/less/variables.less +++ b/docs/src/less/variables.less @@ -35,4 +35,4 @@ // Examples @example-width-audio: 520px; -@example-width-video: 1200px;
\ No newline at end of file +@example-width-video: 1200px; diff --git a/gulpfile.js b/gulpfile.js index 76862236..3e7979a2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -41,8 +41,7 @@ paths = { // Source paths src: { less: path.join(root, "docs/src/less/**/*"), - js: path.join(root, "docs/src/js/**/*"), - sprite: path.join(root, "docs/src/sprite/*.svg") + js: path.join(root, "docs/src/js/**/*") }, // Output paths output: path.join(root, "docs/dist/"), @@ -53,7 +52,7 @@ paths = { }, // Task arrays -tasks = { +tasks = { less: [], sass: [], js: [] @@ -92,7 +91,7 @@ var build = { }, less: function(files, bundle) { for (var key in files) { - (function (key) { + (function (key) { var name = "less-" + key; tasks.less.push(name); @@ -111,7 +110,7 @@ var build = { }, sass: function(files, bundle) { for (var key in files) { - (function (key) { + (function (key) { var name = "sass-" + key; tasks.sass.push(name); @@ -130,16 +129,16 @@ var build = { }, sprite: function(bundle) { // Process Icons - gulp.task("sprite-" + bundle, function () { + gulp.task("sprite", function () { return gulp - .src(paths[bundle].src.sprite) + .src(paths.plyr.src.sprite) .pipe(svgmin({ plugins: [{ removeDesc: true }] })) .pipe(svgstore()) - .pipe(gulp.dest(paths[bundle].output)); + .pipe(gulp.dest(paths.plyr.output)); }); } }; @@ -148,12 +147,16 @@ var build = { build.js(bundles.plyr.js, "plyr"); build.less(bundles.plyr.less, "plyr"); build.sass(bundles.plyr.sass, "plyr"); -build.sprite("plyr"); +build.sprite(); // Docs files build.less(bundles.docs.less, "docs"); build.js(bundles.docs.js, "docs"); -build.sprite("docs"); + +// Build all JS +gulp.task("js", function(){ + run(tasks.js); +}); // Build SASS (for testing, default is LESS) gulp.task("sass", function(){ @@ -170,12 +173,11 @@ gulp.task("watch", function () { // Docs gulp.watch(paths.docs.src.js, tasks.js); gulp.watch(paths.docs.src.less, tasks.less); - gulp.watch(paths.docs.src.sprite, ["sprite-docs"]); }); // Default gulp task gulp.task("default", function(){ - run(tasks.js, tasks.less, "sprite-plyr", "sprite-docs", "watch"); + run(tasks.js, tasks.less, "sprite", "watch"); }); // Publish a version to CDN and docs @@ -211,7 +213,7 @@ if("cdn" in aws) { gulp.task("cdn", function () { console.log("Uploading " + version + " to " + aws.cdn.bucket); - // Upload to CDN + // Upload to CDN gulp.src(paths.upload) .pipe(size({ showFiles: true, @@ -259,7 +261,7 @@ gulp.task("open", function () { })); }); -// Do everything +// Do everything gulp.task("publish", function () { - run(tasks.js, tasks.less, "sprite-plyr", "sprite-docs", "cdn", "docs"); -});
\ No newline at end of file + run(tasks.js, tasks.less, "sprite", "cdn", "docs"); +}); diff --git a/package.json b/package.json index 847259d0..0300322f 100644 --- a/package.json +++ b/package.json @@ -1,28 +1,28 @@ { "name": "plyr", - "version": "1.3.5", + "version": "1.4.0", "description": "A simple HTML5 media player using custom controls", "homepage": "http://plyr.io", "main": "gulpfile.js", "dependencies": {}, "devDependencies": { "gulp": "^3.9.0", - "gulp-autoprefixer": "^3.0.2", + "gulp-autoprefixer": "^3.1.0", "gulp-concat": "^2.3.3", "gulp-gzip": "^1.0.0", - "gulp-less": "^3.0.3", + "gulp-less": "^3.0.5", "gulp-minify-css": "^1.2.1", "gulp-open": "^1.0.0", "gulp-rename": "^1.2.0", "gulp-replace": "^0.5.3", "gulp-s3": "^0.3.0", - "gulp-sass": "^2.0.4", + "gulp-sass": "^2.1.0", "gulp-size": "^2.0.0", "gulp-svgmin": "^1.0.0", "gulp-svgstore": "^5.0.0", - "gulp-uglify": "^1.4.1", - "gulp-util": "^3.0.6", - "run-sequence": "^1.1.4" + "gulp-uglify": "^1.5.1", + "gulp-util": "^3.0.7", + "run-sequence": "^1.1.5" }, "scripts": { "preinstall": "npm install -g gulp" @@ -1,7 +1,7 @@ # Plyr A simple, accessible HTML5 media player. -[Checkout the demo](http://plyr.io) +Checkout the [demo](http://plyr.io). [](http://plyr.io) @@ -24,9 +24,9 @@ We wanted a lightweight, accessible and customisable media player that just supp Oh and yes, it works with Bootstrap. ## Changelog -Check out [the changelog](changelog.md) +Check out the [changelog](changelog.md). -## Planned development +## Planned Development - Vimeo support - Playback speed - Playlists @@ -34,13 +34,13 @@ Check out [the changelog](changelog.md) - Audio captions ... and whatever else has been raised in [issues](https://github.com/Selz/plyr/issues) -If you have any cool ideas or features, please let me know by [creating an issue](https://github.com/Selz/plyr/issues/new) or of course, forking and sending a pull request. +If you have any cool ideas or features, please let me know by [creating an issue](https://github.com/Selz/plyr/issues/new) or, of course, forking and sending a pull request. ## Implementation Check `docs/index.html` and `docs/dist/docs.js` for an example setup. -**Heads up**, the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.3.5/plyr.js` to `https://cdn.plyr.io/1.3.5/plyr.js` +**Heads up:** the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.3.7/plyr.js` to `https://cdn.plyr.io/1.3.7/plyr.js` ### Bower If bower is your thang, you can grab Plyr using: @@ -60,14 +60,14 @@ More info is on [npm](https://www.npmjs.com/package/ember-cli-plyr) and [GitHub] If you want to use our CDN, you can use the following: ```html -<link rel="stylesheet" href="https://cdn.plyr.io/1.3.5/plyr.css"> -<script src="https://cdn.plyr.io/1.3.5/plyr.js"></script> +<link rel="stylesheet" href="https://cdn.plyr.io/1.3.7/plyr.css"> +<script src="https://cdn.plyr.io/1.3.7/plyr.js"></script> ``` -You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.3.5/sprite.svg`. +You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.3.7/sprite.svg`. ### CSS -If you want to use the default css, add the `plyr.css` file from /dist into your head, or even better use `plyr.less` or `plyr.sass` file included in `/src` in your build to save a request. +If you want to use the default css, add the `plyr.css` file from `/dist` into your head, or even better use `plyr.less` or `plyr.sass` file included in `/src` in your build to save a request. ```html <link rel="stylesheet" href="dist/plyr.css"> |