Compare commits
66 Commits
Author | SHA1 | Date | |
---|---|---|---|
351e1540c5 | |||
b3299b4641 | |||
be2e7d4c99 | |||
7238eab737 | |||
3c2921b994 | |||
179c6fca0b | |||
69194915d4 | |||
98e4c5acea | |||
1496b21c83 | |||
ac0061b83e | |||
0b7dc51bd1 | |||
126f80ed78 | |||
e0ef7482c6 | |||
6ffb971226 | |||
72187a89dd | |||
a461500ab9 | |||
c830af492c | |||
1f6f841fcb | |||
99960c0dc5 | |||
e8a8b08215 | |||
a989e87a2d | |||
0bceeb4674 | |||
5a433f2fc8 | |||
c86b824a04 | |||
21c2276359 | |||
602944ea4f | |||
f4a9ffcec7 | |||
d2e9c61fd7 | |||
c8cd051a00 | |||
448c070898 | |||
7f624ebbb7 | |||
4a69ef3874 | |||
31c933af38 | |||
00137fe46b | |||
b23a16826e | |||
2a822d7b45 | |||
cc5b363d66 | |||
7e53f01d44 | |||
d351f9f172 | |||
4d67d68c6b | |||
3f20462943 | |||
ab26525f09 | |||
e431d7594b | |||
8b75bec3d2 | |||
1a5e56ed46 | |||
3470d5f5e6 | |||
9ff933e532 | |||
299dfe4afe | |||
6921070688 | |||
bb976ccf4b | |||
f02cb5635f | |||
fad3f41ca7 | |||
39a0a38d07 | |||
a316514ca1 | |||
3b69f47590 | |||
8172e2339d | |||
44bb6c077c | |||
e11a58a841 | |||
c4e3b5a242 | |||
f1b44e6da0 | |||
aa093b6c42 | |||
97870a7cdc | |||
9a6433488f | |||
993617f75f | |||
48399f6364 | |||
47e0800f02 |
2
.gitignore
vendored
@ -7,3 +7,5 @@ docs/index.dev.html
|
|||||||
*.mp4
|
*.mp4
|
||||||
index-dev.html
|
index-dev.html
|
||||||
notes.txt
|
notes.txt
|
||||||
|
*.vtt
|
||||||
|
docs/index.dev.php
|
||||||
|
59
changelog.md
@ -1,5 +1,64 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
# v1.6.16
|
||||||
|
- Always hide standard controls (Fixes #225)
|
||||||
|
- Fix for Tooltips overflowing (fixes #230)
|
||||||
|
|
||||||
|
## v1.6.15
|
||||||
|
- Restore scroll position when exiting full screen (fixes #236)
|
||||||
|
|
||||||
|
## v1.6.14
|
||||||
|
- SVG sprite loading automatically for an easier setup
|
||||||
|
- Touch devices now show controls on touch rather than pausing playback
|
||||||
|
|
||||||
|
## v1.6.13
|
||||||
|
- Decreased sensitivity and inverted scroll on volume slider (scroll up to increase, down to decrease)
|
||||||
|
|
||||||
|
## v1.6.12
|
||||||
|
- Fix for undefined buffer error
|
||||||
|
- Add scroll listener on volume slider (PR #227 bty @igoradamenko)
|
||||||
|
|
||||||
|
## v1.6.11
|
||||||
|
- Fix for Vimeo fullscreen (fixes #214)
|
||||||
|
|
||||||
|
## v1.6.10
|
||||||
|
- Changed default icon prefix from 'icon' to 'plyr' to avoid clashes
|
||||||
|
|
||||||
|
## v1.6.9
|
||||||
|
- Added 'latest' CDN option
|
||||||
|
- Renamed `sprite.svg` to `plyr.svg` to be inline with the other package files
|
||||||
|
|
||||||
|
## v1.6.8
|
||||||
|
- Fix for bug introduced in v1.6.7
|
||||||
|
|
||||||
|
## v1.6.7
|
||||||
|
- Fixes for using `source` API method on iOS
|
||||||
|
|
||||||
|
## v1.6.6
|
||||||
|
- Icons cleaned up
|
||||||
|
- IE11 button fix for tooltips (fixes #210)
|
||||||
|
|
||||||
|
## v1.6.5
|
||||||
|
- IE UI bug fixes
|
||||||
|
|
||||||
|
## v1.6.4
|
||||||
|
- Bug fix for undefined progress bar
|
||||||
|
|
||||||
|
## v1.6.3
|
||||||
|
- Seek back to 0 for all media on ended
|
||||||
|
- Check for HTML5 video on ended reload
|
||||||
|
- Update to docs for `showPosterOnEnd` option
|
||||||
|
|
||||||
|
## v1.6.2
|
||||||
|
- Fix for tooltip displaying when duration is not set (fixes #177)
|
||||||
|
- `showPosterOnEnd` option to show poster when HTML5 video ended (fixes #59)
|
||||||
|
- Error handler for YouTube (fixes #189)
|
||||||
|
- Initial SoundCloud support (fixes #194)
|
||||||
|
- Other minor bug fixes
|
||||||
|
|
||||||
|
## v1.6.1
|
||||||
|
- Tooltip changes for accessibility
|
||||||
|
|
||||||
## v1.6.0
|
## v1.6.0
|
||||||
- New, cleaner, UI:
|
- New, cleaner, UI:
|
||||||
- Controls are now overlaid, maintaining the video's ratio and making sizing easier
|
- Controls are now overlaid, maintaining the video's ratio and making sizing easier
|
||||||
|
22
controls.md
@ -47,23 +47,23 @@ This is an example `html` option with all controls.
|
|||||||
```javascript
|
```javascript
|
||||||
var controls = ["<div class='plyr__controls'>",
|
var controls = ["<div class='plyr__controls'>",
|
||||||
"<button type='button' data-plyr='restart'>",
|
"<button type='button' data-plyr='restart'>",
|
||||||
"<svg><use xlink:href='#icon-restart'></use></svg>",
|
"<svg><use xlink:href='#plyr-restart'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Restart</span>",
|
"<span class='plyr__sr-only'>Restart</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"<button type='button' data-plyr='rewind'>",
|
"<button type='button' data-plyr='rewind'>",
|
||||||
"<svg><use xlink:href='#icon-rewind'></use></svg>",
|
"<svg><use xlink:href='#plyr-rewind'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Rewind {seektime} secs</span>",
|
"<span class='plyr__sr-only'>Rewind {seektime} secs</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"<button type='button' data-plyr='play'>",
|
"<button type='button' data-plyr='play'>",
|
||||||
"<svg><use xlink:href='#icon-play'></use></svg>",
|
"<svg><use xlink:href='#plyr-play'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Play</span>",
|
"<span class='plyr__sr-only'>Play</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"<button type='button' data-plyr='pause'>",
|
"<button type='button' data-plyr='pause'>",
|
||||||
"<svg><use xlink:href='#icon-pause'></use></svg>",
|
"<svg><use xlink:href='#plyr-pause'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Pause</span>",
|
"<span class='plyr__sr-only'>Pause</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"<button type='button' data-plyr='fast-forward'>",
|
"<button type='button' data-plyr='fast-forward'>",
|
||||||
"<svg><use xlink:href='#icon-fast-forward'></use></svg>",
|
"<svg><use xlink:href='#plyr-fast-forward'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Forward {seektime} secs</span>",
|
"<span class='plyr__sr-only'>Forward {seektime} secs</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"<span class='plyr__progress'>",
|
"<span class='plyr__progress'>",
|
||||||
@ -84,8 +84,8 @@ var controls = ["<div class='plyr__controls'>",
|
|||||||
"<span class='plyr__time--duration'>00:00</span>",
|
"<span class='plyr__time--duration'>00:00</span>",
|
||||||
"</span>",
|
"</span>",
|
||||||
"<button type='button' data-plyr='mute'>",
|
"<button type='button' data-plyr='mute'>",
|
||||||
"<svg class='icon--muted'><use xlink:href='#icon-muted'></use></svg>",
|
"<svg class='icon--muted'><use xlink:href='#plyr-muted'></use></svg>",
|
||||||
"<svg><use xlink:href='#icon-volume'></use></svg>",
|
"<svg><use xlink:href='#plyr-volume'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Toggle Mute</span>",
|
"<span class='plyr__sr-only'>Toggle Mute</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"<span class='plyr__volume'>",
|
"<span class='plyr__volume'>",
|
||||||
@ -94,13 +94,13 @@ var controls = ["<div class='plyr__controls'>",
|
|||||||
"<progress class='plyr__volume--display' max='10' value='0' role='presentation'></progress>",
|
"<progress class='plyr__volume--display' max='10' value='0' role='presentation'></progress>",
|
||||||
"</span>",
|
"</span>",
|
||||||
"<button type='button' data-plyr='captions'>",
|
"<button type='button' data-plyr='captions'>",
|
||||||
"<svg class='icon--captions-on'><use xlink:href='#icon-captions-on'></use></svg>",
|
"<svg class='icon--captions-on'><use xlink:href='#plyr-captions-on'></use></svg>",
|
||||||
"<svg><use xlink:href='#icon-captions-off'></use></svg>",
|
"<svg><use xlink:href='#plyr-captions-off'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Toggle Captions</span>",
|
"<span class='plyr__sr-only'>Toggle Captions</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"<button type='button' data-plyr='fullscreen'>",
|
"<button type='button' data-plyr='fullscreen'>",
|
||||||
"<svg class='icon--exit-fullscreen'><use xlink:href='#icon-exit-fullscreen'></use></svg>",
|
"<svg class='icon--exit-fullscreen'><use xlink:href='#plyr-exit-fullscreen'></use></svg>",
|
||||||
"<svg><use xlink:href='#icon-enter-fullscreen'></use></svg>",
|
"<svg><use xlink:href='#plyr-enter-fullscreen'></use></svg>",
|
||||||
"<span class='plyr__sr-only'>Toggle Fullscreen</span>",
|
"<span class='plyr__sr-only'>Toggle Fullscreen</span>",
|
||||||
"</button>",
|
"</button>",
|
||||||
"</div>"].join("");
|
"</div>"].join("");
|
||||||
|
2
dist/plyr.css
vendored
4
dist/plyr.js
vendored
1
dist/plyr.svg
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="plyr-captions-off" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd" fill-opacity=".5"/></symbol><symbol id="plyr-captions-on" viewBox="0 0 18 18"><path d="M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z" fill-rule="evenodd"/></symbol><symbol id="plyr-enter-fullscreen" viewBox="0 0 18 18"><path d="M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"/></symbol><symbol id="plyr-exit-fullscreen" viewBox="0 0 18 18"><path d="M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"/></symbol><symbol id="plyr-fast-forward" viewBox="0 0 18 18"><path d="M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"/></symbol><symbol id="plyr-muted" viewBox="0 0 18 18"><path d="M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol><symbol id="plyr-pause" viewBox="0 0 18 18"><path d="M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM12 1c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"/></symbol><symbol id="plyr-play" viewBox="0 0 18 18"><path d="M15.562 8.1L3.87.225C3.052-.337 2 .225 2 1.125v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"/></symbol><symbol id="plyr-restart" viewBox="0 0 18 18"><path d="M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"/></symbol><symbol id="plyr-rewind" viewBox="0 0 18 18"><path d="M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"/></symbol><symbol id="plyr-volume" viewBox="0 0 18 18"><path d="M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"/><path d="M11.282 5.282a.909.909 0 0 0 0 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 0 0 0 1.316c.145.145.636.262 1.018.156a.725.725 0 0 0 .298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 0 0-1.316 0zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"/></symbol></svg>
|
After Width: | Height: | Size: 3.7 KiB |
1
dist/sprite.svg
vendored
@ -1 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon-captions-off" viewBox="0 0 18 18"><path d="M1 2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H1zm1 12V4h14v10H2z"/></symbol><symbol id="icon-captions-on" viewBox="0 0 18 18"><path d="M1 2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H1zm1 12V4h14v10H2z"/><path d="M3 11h3v2H3zM12 11h3v2h-3zM7 11h4v2H7z"/></symbol><symbol id="icon-enter-fullscreen" viewBox="0 0 18 18"><path d="M10.3 9.7c.7.677 1.4 0 1.4 0L16 5.4V10h2V3c0-.6-.4-1-1-1h-7v2h4.6l-4.3 4.3s-.7.723 0 1.4z"/><path d="M7 2v2H2v10h14v-1h2v2c0 .6-.4 1-1 1H1c-.6 0-1-.4-1-1V3c0-.6.4-1 1-1h6z"/></symbol><symbol id="icon-exit-fullscreen" viewBox="0 0 18 18"><path d="M7.7 8.3c-.7-.677-1.4 0-1.4 0L2 12.6V8H0v7c0 .6.4 1 1 1h7v-2H3.4l4.3-4.3s.7-.723 0-1.4z"/><path d="M11 16v-2h5V4H2v1H0V3c0-.6.4-1 1-1h16c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6z"/></symbol><symbol id="icon-fast-forward" viewBox="0 0 16 16"><path d="M7 6.4L0 1v14l7-5.4V15l9-7-9-7z"/></symbol><symbol id="icon-muted" viewBox="0 0 18 18"><path d="M9.214 2a.62.62 0 0 0-.334.101l-4.048 2.81A.494.494 0 0 1 4.549 5H.996A.998.998 0 0 0 0 6v6c0 .552.446 1 .996 1h3.553c.102 0 .2.031.283.089l4.048 2.81a.62.62 0 0 0 .334.101c.392 0 .747-.4.747-.949V2.95c0-.55-.355-.949-.747-.949V2zM7.969 12.834l-2.387-1.657a.996.996 0 0 0-.566-.178H2.491a.5.5 0 0 1-.498-.5v-3a.5.5 0 0 1 .498-.5h2.525c.202 0 .4-.062.566-.178l2.387-1.657v7.67zM14.934 8.799c-.086-1.748-1.514-2.991-2.507-3.649-.47-.312-1.094-.122-1.325.408l-.038.086a.973.973 0 0 0 .336 1.194c.706.473 1.586 1.247 1.624 2.065.032.676-.553 1.468-1.663 2.27a.987.987 0 0 0-.285 1.275l.042.075c.266.475.866.624 1.3.312 1.74-1.251 2.586-2.606 2.516-4.037v.001z"/><path d="M13.957 9.2c.086 1.747 1.514 2.99 2.507 3.648.47.312 1.094.122 1.325-.408l.038-.086a.973.973 0 0 0-.336-1.194c-.706-.473-1.586-1.247-1.624-2.065-.032-.676.553-1.468 1.663-2.27a.987.987 0 0 0 .285-1.275l-.042-.075c-.266-.475-.866-.624-1.3-.312-1.74 1.251-2.586 2.606-2.516 4.037z"/></symbol><symbol id="icon-pause" viewBox="0 0 16 16"><path d="M5 1H2c-.6 0-1 .4-1 1v12c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM14 1h-3c-.6 0-1 .4-1 1v12c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1z"/></symbol><symbol id="icon-play" viewBox="0 0 16 16"><path d="M13.6 7.2l-10-7A1 1 0 0 0 2 1v14c0 .8.9 1.3 1.6.8l10-7c.5-.4.5-1.2 0-1.6z"/></symbol><symbol id="icon-restart" viewBox="0 0 16 16"><path d="M7.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C4 2.6 2.9 3.2 2 4.1-.7 6.8-.7 11.2 2 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L14 1.9l-6.3-.7z"/></symbol><symbol id="icon-rewind" viewBox="0 0 16 16"><path d="M9 1L0 8l9 7V9.6l7 5.4V1L9 6.4z"/></symbol><symbol id="icon-volume" viewBox="0 0 18 18"><path d="M10.214 2a.62.62 0 0 0-.334.101l-4.048 2.81A.494.494 0 0 1 5.549 5H1.996A.998.998 0 0 0 1 6v6c0 .552.446 1 .996 1h3.553c.102 0 .2.031.283.089l4.048 2.81a.62.62 0 0 0 .334.101c.392 0 .747-.4.747-.949V2.95c0-.55-.355-.949-.747-.949zM8.969 12.834l-2.387-1.657a.996.996 0 0 0-.566-.178H3.491a.5.5 0 0 1-.498-.5v-3a.5.5 0 0 1 .498-.5h2.525c.202 0 .4-.062.566-.178l2.387-1.657v7.669zM16.934 8.799c-.086-1.748-1.514-2.991-2.507-3.649-.47-.312-1.094-.122-1.325.408l-.038.086a.973.973 0 0 0 .336 1.194c.706.473 1.586 1.247 1.624 2.065.032.676-.553 1.468-1.663 2.27a.987.987 0 0 0-.285 1.275l.042.075c.266.475.866.624 1.3.312 1.74-1.251 2.586-2.606 2.516-4.037z"/></symbol></svg>
|
|
Before Width: | Height: | Size: 3.5 KiB |
2
docs/dist/docs.js
vendored
@ -1 +1 @@
|
|||||||
"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,n=arguments.length;for(i=0;n>i;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",n=e.Element[i],o=Object,s=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=s.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],n=0,o=i.length;o>n;n++)this.push(i[n]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,i=0,n=t.length,o=!1;do e=t[i]+"",-1===c(this,e)&&(this.push(e),o=!0);while(++i<n);o&&this._updateClassName()},u.remove=function(){var e,t,i=arguments,n=0,o=i.length,s=!1;do for(e=i[n]+"",t=c(this,e);-1!==t;)this.splice(t,1),s=!0,t=c(this,e);while(++n<o);s&&this._updateClassName()},u.toggle=function(e,t){e+="";var i=this.contains(e),n=i?t!==!0&&"remove":t!==!1&&"add";return n&&this[n](e),t===!0||t===!1?t:!i},u.toString=function(){return this.join(" ")},o.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{o.defineProperty(n,t,p)}catch(h){-2146823252===h.number&&(p.enumerable=!1,o.defineProperty(n,t,p))}}else o[i].__defineGetter__&&n.__defineGetter__(t,d)}}(self)),plyr.setup(".js-media-player",{debug:!0,title:"Video demo",tooltips:{controls:!0},captions:{defaultActive:!0}}),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=n+(i?" "+t:"")}}function t(t,s){if(t in n&&(s||t!=o)&&(o.length||t!=n.video)){var r=document.querySelector(".js-media-player").plyr;switch(t){case n.video:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"},{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm",type:"video/webm"}],poster:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt","default":!0}]});break;case n.audio:r.source({type:"audio",title:"Kishi Bashi – “It All Began With A Burst”",sources:[{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]});break;case n.youtube:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}o=t;for(var a=i.length-1;a>=0;a--)e(i[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}for(var i=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},o=window.location.hash.replace("#",""),s=window.history&&window.history.pushState,r=i.length-1;r>=0;r--)i[r].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),s&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),s){var a=!o.length;a&&(o=n.video),o in n&&history.replaceState({type:o},"",a?"":"#"+o),o!==n.video&&t(o,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,n,o,s,r){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,s=t.createElement(i),r=t.getElementsByTagName(i)[0],s.async=1,s.src=n,r.parentNode.insertBefore(s,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));
|
"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,s=arguments.length;for(i=0;s>i;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",s=e.Element[i],o=Object,n=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=n.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],s=0,o=i.length;o>s;s++)this.push(i[s]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,i=0,s=t.length,o=!1;do e=t[i]+"",-1===c(this,e)&&(this.push(e),o=!0);while(++i<s);o&&this._updateClassName()},u.remove=function(){var e,t,i=arguments,s=0,o=i.length,n=!1;do for(e=i[s]+"",t=c(this,e);-1!==t;)this.splice(t,1),n=!0,t=c(this,e);while(++s<o);n&&this._updateClassName()},u.toggle=function(e,t){e+="";var i=this.contains(e),s=i?t!==!0&&"remove":t!==!1&&"add";return s&&this[s](e),t===!0||t===!1?t:!i},u.toString=function(){return this.join(" ")},o.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{o.defineProperty(s,t,p)}catch(h){-2146823252===h.number&&(p.enumerable=!1,o.defineProperty(s,t,p))}}else o[i].__defineGetter__&&s.__defineGetter__(t,d)}}(self)),plyr.setup(".js-media-player",{debug:!0,title:"Video demo",iconUrl:"../dist/plyr.svg",tooltips:{controls:!0},captions:{defaultActive:!0}}),plyr.loadSprite("dist/docs.svg"),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=s+(i?" "+t:"")}}function t(t,n){if(t in s&&(n||t!=o)&&(o.length||t!=s.video)){var r=document.querySelector(".js-media-player").plyr;switch(t){case s.video:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"},{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm",type:"video/webm"}],poster:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt","default":!0}]});break;case s.audio:r.source({type:"audio",title:"Kishi Bashi – “It All Began With A Burst”",sources:[{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]});break;case s.youtube:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case s.vimeo:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}o=t;for(var a=i.length-1;a>=0;a--)e(i[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}for(var i=document.querySelectorAll("[data-source]"),s={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},o=window.location.hash.replace("#",""),n=window.history&&window.history.pushState,r=i.length-1;r>=0;r--)i[r].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),n&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),n){var a=!o.length;a&&(o=s.video),o in s&&history.replaceState({type:o},"",a?"":"#"+o),o!==s.video&&t(o,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,s,o,n,r){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,n=t.createElement(i),r=t.getElementsByTagName(i)[0],n.async=1,n.src=s,r.parentNode.insertBefore(n,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));
|
@ -74,47 +74,6 @@
|
|||||||
</section>
|
</section>
|
||||||
</main>
|
</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() {
|
|
||||||
[
|
|
||||||
'../dist/sprite.svg',
|
|
||||||
'dist/docs.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 whole if/else statement
|
|
||||||
// XHR for Chrome/Firefox/Opera/Safari/IE10+
|
|
||||||
if ('withCredentials' in x) {
|
|
||||||
x.open('GET', u, true);
|
|
||||||
}
|
|
||||||
// XDomainRequest for IE8 & IE9
|
|
||||||
else if (typeof XDomainRequest == 'function') {
|
|
||||||
x = new XDomainRequest();
|
|
||||||
x.open('GET', u);
|
|
||||||
}
|
|
||||||
else { return; }
|
|
||||||
|
|
||||||
// Inject hidden div with sprite on load
|
|
||||||
x.onload = function() {
|
|
||||||
var c = document.createElement('div');
|
|
||||||
c.setAttribute('hidden', '');
|
|
||||||
c.innerHTML = x.responseText;
|
|
||||||
b.insertBefore(c, b.childNodes[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Timeout for IE9
|
|
||||||
setTimeout(function () {
|
|
||||||
x.send();
|
|
||||||
}, 0);
|
|
||||||
});
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- Plyr core script -->
|
<!-- Plyr core script -->
|
||||||
<script src="../dist/plyr.js"></script>
|
<script src="../dist/plyr.js"></script>
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
plyr.setup('.js-media-player', {
|
plyr.setup('.js-media-player', {
|
||||||
debug: true,
|
debug: true,
|
||||||
title: 'Video demo',
|
title: 'Video demo',
|
||||||
|
iconUrl: '../dist/plyr.svg',
|
||||||
tooltips: {
|
tooltips: {
|
||||||
controls: true
|
controls: true
|
||||||
},
|
},
|
||||||
@ -15,6 +16,7 @@ plyr.setup('.js-media-player', {
|
|||||||
defaultActive: true
|
defaultActive: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
plyr.loadSprite('dist/docs.svg');
|
||||||
|
|
||||||
// General functions
|
// General functions
|
||||||
(function() {
|
(function() {
|
||||||
|
97
gulpfile.js
@ -1,7 +1,7 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Gulp build script
|
// Gulp build script
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
/*global require, __dirname*/
|
/*global require, __dirname,Buffer*/
|
||||||
/*jshint -W079 */
|
/*jshint -W079 */
|
||||||
|
|
||||||
var fs = require("fs"),
|
var fs = require("fs"),
|
||||||
@ -19,10 +19,10 @@ var fs = require("fs"),
|
|||||||
svgmin = require("gulp-svgmin"),
|
svgmin = require("gulp-svgmin"),
|
||||||
rename = require("gulp-rename"),
|
rename = require("gulp-rename"),
|
||||||
s3 = require("gulp-s3"),
|
s3 = require("gulp-s3"),
|
||||||
gzip = require("gulp-gzip"),
|
|
||||||
replace = require("gulp-replace"),
|
replace = require("gulp-replace"),
|
||||||
open = require("gulp-open"),
|
open = require("gulp-open"),
|
||||||
size = require("gulp-size");
|
size = require("gulp-size"),
|
||||||
|
through = require("through2");
|
||||||
|
|
||||||
var root = __dirname,
|
var root = __dirname,
|
||||||
paths = {
|
paths = {
|
||||||
@ -74,6 +74,29 @@ function loadJSON(path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a file from a string
|
||||||
|
// http://stackoverflow.com/questions/23230569/how-do-you-create-a-file-from-a-string-in-gulp
|
||||||
|
function createFile(filename, string) {
|
||||||
|
var src = require('stream').Readable({
|
||||||
|
objectMode: true
|
||||||
|
});
|
||||||
|
src._read = function () {
|
||||||
|
this.push(new gutil.File({
|
||||||
|
cwd: "",
|
||||||
|
base: "",
|
||||||
|
path: filename,
|
||||||
|
contents: new Buffer(string),
|
||||||
|
// stats also required for some functions
|
||||||
|
// https://nodejs.org/api/fs.html#fs_class_fs_stats
|
||||||
|
stat: {
|
||||||
|
size: string.length
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
this.push(null);
|
||||||
|
}
|
||||||
|
return src
|
||||||
|
}
|
||||||
|
|
||||||
var build = {
|
var build = {
|
||||||
js: function (files, bundle) {
|
js: function (files, bundle) {
|
||||||
for (var key in files) {
|
for (var key in files) {
|
||||||
@ -143,7 +166,7 @@ var build = {
|
|||||||
}]
|
}]
|
||||||
}))
|
}))
|
||||||
.pipe(svgstore())
|
.pipe(svgstore())
|
||||||
.pipe(rename({ basename: (bundle == "plyr" ? "sprite" : bundle) }))
|
.pipe(rename({ basename: bundle }))
|
||||||
.pipe(gulp.dest(paths[bundle].output));
|
.pipe(gulp.dest(paths[bundle].output));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -200,32 +223,40 @@ options = {
|
|||||||
headers: {
|
headers: {
|
||||||
"Cache-Control": "max-age=" + maxAge,
|
"Cache-Control": "max-age=" + maxAge,
|
||||||
"Vary": "Accept-Encoding"
|
"Vary": "Accept-Encoding"
|
||||||
},
|
}
|
||||||
gzippedOnly: true
|
|
||||||
},
|
},
|
||||||
docs: {
|
docs: {
|
||||||
headers: {
|
headers: {
|
||||||
"Cache-Control": "public, must-revalidate, proxy-revalidate, max-age=0",
|
"Cache-Control": "no-cache, no-store, must-revalidate, max-age=0",
|
||||||
"Vary": "Accept-Encoding"
|
"Vary": "Accept-Encoding"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
gzippedOnly: true
|
symlinks: function(version, filename) {
|
||||||
|
return {
|
||||||
|
headers: {
|
||||||
|
// http://stackoverflow.com/questions/2272835/amazon-s3-object-redirect
|
||||||
|
"x-amz-website-redirect-location": "/" + version + "/" + filename,
|
||||||
|
"Cache-Control": "no-cache, no-store, must-revalidate, max-age=0"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// If aws is setup
|
// If aws is setup
|
||||||
if("cdn" in aws) {
|
if("cdn" in aws) {
|
||||||
var regex = "(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)",
|
var regex = "(?:0|[1-9][0-9]*)\\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\.[\\da-z\\-]+)*)?",
|
||||||
cdnpath = new RegExp(aws.cdn.bucket + "\/" + regex, "gi"),
|
cdnpath = new RegExp(aws.cdn.bucket + "\/" + regex, "gi"),
|
||||||
semver = new RegExp("v" + regex, "gi"),
|
semver = new RegExp("v" + regex, "gi"),
|
||||||
localpath = new RegExp("(\.\.\/)?dist", "gi");
|
localPath = new RegExp("(\.\.\/)?dist", "gi"),
|
||||||
|
versionPath = "https://" + aws.cdn.bucket + "/" + version;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Publish version to CDN bucket
|
// Publish version to CDN bucket
|
||||||
gulp.task("cdn", function () {
|
gulp.task("cdn", function () {
|
||||||
console.log("Uploading " + version + " to " + aws.cdn.bucket);
|
console.log("Uploading " + version + " to " + aws.cdn.bucket + "...");
|
||||||
|
|
||||||
// Upload to CDN
|
// Upload to CDN
|
||||||
gulp.src(paths.upload)
|
return gulp.src(paths.upload)
|
||||||
.pipe(size({
|
.pipe(size({
|
||||||
showFiles: true,
|
showFiles: true,
|
||||||
gzip: true
|
gzip: true
|
||||||
@ -233,13 +264,13 @@ gulp.task("cdn", function () {
|
|||||||
.pipe(rename(function (path) {
|
.pipe(rename(function (path) {
|
||||||
path.dirname = path.dirname.replace(".", version);
|
path.dirname = path.dirname.replace(".", version);
|
||||||
}))
|
}))
|
||||||
.pipe(gzip())
|
.pipe(replace(localPath, versionPath))
|
||||||
.pipe(s3(aws.cdn, options.cdn));
|
.pipe(s3(aws.cdn, options.cdn));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Publish to Docs bucket
|
// Publish to Docs bucket
|
||||||
gulp.task("docs", function () {
|
gulp.task("docs", function () {
|
||||||
console.log("Uploading " + version + " docs to " + aws.docs.bucket);
|
console.log("Uploading " + version + " docs to " + aws.docs.bucket + "...");
|
||||||
|
|
||||||
// Replace versioned files in readme.md
|
// Replace versioned files in readme.md
|
||||||
gulp.src([root + "/readme.md"])
|
gulp.src([root + "/readme.md"])
|
||||||
@ -249,22 +280,44 @@ gulp.task("docs", function () {
|
|||||||
// Replace versioned files in plyr.js
|
// Replace versioned files in plyr.js
|
||||||
gulp.src(path.join(root, "src/js/plyr.js"))
|
gulp.src(path.join(root, "src/js/plyr.js"))
|
||||||
.pipe(replace(semver, "v" + version))
|
.pipe(replace(semver, "v" + version))
|
||||||
|
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
|
||||||
.pipe(gulp.dest(path.join(root, "src/js/")));
|
.pipe(gulp.dest(path.join(root, "src/js/")));
|
||||||
|
|
||||||
// Replace local file paths with remote paths in docs
|
// Replace local file paths with remote paths in docs HTML
|
||||||
// e.g. "../dist/plyr.js" to "https://cdn.plyr.io/x.x.x/plyr.js"
|
// e.g. "../dist/plyr.js" to "https://cdn.plyr.io/x.x.x/plyr.js"
|
||||||
gulp.src([paths.docs.root + "*.html"])
|
gulp.src([paths.docs.root + "*.html"])
|
||||||
.pipe(replace(localpath, "https://" + aws.cdn.bucket + "/" + version))
|
.pipe(replace(localPath, versionPath))
|
||||||
.pipe(gzip())
|
|
||||||
.pipe(s3(aws.docs, options.docs));
|
.pipe(s3(aws.docs, options.docs));
|
||||||
|
|
||||||
// Upload error.html to cdn (as well as docs site)
|
// Upload error.html to cdn (as well as docs site)
|
||||||
gulp.src([paths.docs.root + "error.html"])
|
return gulp.src([paths.docs.root + "error.html"])
|
||||||
.pipe(replace(localpath, "https://" + aws.cdn.bucket + "/" + version))
|
.pipe(replace(localPath, versionPath))
|
||||||
.pipe(gzip())
|
|
||||||
.pipe(s3(aws.cdn, options.docs));
|
.pipe(s3(aws.cdn, options.docs));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Open the docs site to check it's sweet
|
||||||
|
gulp.task("symlinks", function () {
|
||||||
|
console.log("Updating symlinks...");
|
||||||
|
|
||||||
|
return gulp.src(paths.upload)
|
||||||
|
.pipe(through.obj(function (chunk, enc, callback) {
|
||||||
|
if (chunk.stat.isFile()) {
|
||||||
|
// Get the filename
|
||||||
|
var filename = chunk.path.split("/").reverse()[0];
|
||||||
|
|
||||||
|
// Create the 0 byte redirect files to upload
|
||||||
|
createFile(filename, "")
|
||||||
|
.pipe(rename(function (path) {
|
||||||
|
path.dirname = path.dirname.replace(".", "latest");
|
||||||
|
}))
|
||||||
|
// Upload to S3 with correct headers
|
||||||
|
.pipe(s3(aws.cdn, options.symlinks(version, filename)));
|
||||||
|
}
|
||||||
|
|
||||||
|
callback(null, chunk);
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
|
||||||
// Open the docs site to check it's sweet
|
// Open the docs site to check it's sweet
|
||||||
gulp.task("open", function () {
|
gulp.task("open", function () {
|
||||||
console.log("Opening " + aws.docs.bucket + "...");
|
console.log("Opening " + aws.docs.bucket + "...");
|
||||||
@ -272,7 +325,7 @@ gulp.task("open", function () {
|
|||||||
// A file must be specified or gulp will skip the task
|
// A file must be specified or gulp will skip the task
|
||||||
// Doesn't matter which file since we set the URL above
|
// Doesn't matter which file since we set the URL above
|
||||||
// Weird, I know...
|
// Weird, I know...
|
||||||
gulp.src([paths.docs.root + "index.html"])
|
return gulp.src([paths.docs.root + "index.html"])
|
||||||
.pipe(open("", {
|
.pipe(open("", {
|
||||||
url: "http://" + aws.docs.bucket
|
url: "http://" + aws.docs.bucket
|
||||||
}));
|
}));
|
||||||
@ -280,5 +333,5 @@ gulp.task("open", function () {
|
|||||||
|
|
||||||
// Do everything
|
// Do everything
|
||||||
gulp.task("publish", function () {
|
gulp.task("publish", function () {
|
||||||
run(tasks.js, tasks.less, tasks.sprite, "cdn", "docs");
|
run(tasks.js, tasks.less, tasks.sprite, "cdn", "docs", "symlinks");
|
||||||
});
|
});
|
||||||
|
10
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plyr",
|
"name": "plyr",
|
||||||
"version": "1.6.0",
|
"version": "1.6.16",
|
||||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||||
"homepage": "http://plyr.io",
|
"homepage": "http://plyr.io",
|
||||||
"main": "src/js/plyr.js",
|
"main": "src/js/plyr.js",
|
||||||
@ -8,10 +8,9 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"gulp": "^3.9.1",
|
"gulp": "^3.9.1",
|
||||||
"gulp-autoprefixer": "^3.1.0",
|
"gulp-autoprefixer": "^3.1.0",
|
||||||
"gulp-concat": "^2.3.3",
|
|
||||||
"gulp-gzip": "^1.0.0",
|
|
||||||
"gulp-less": "^3.0.5",
|
|
||||||
"gulp-clean-css": "^2.0.6",
|
"gulp-clean-css": "^2.0.6",
|
||||||
|
"gulp-concat": "^2.3.3",
|
||||||
|
"gulp-less": "^3.0.5",
|
||||||
"gulp-open": "^2.0.0",
|
"gulp-open": "^2.0.0",
|
||||||
"gulp-rename": "^1.2.0",
|
"gulp-rename": "^1.2.0",
|
||||||
"gulp-replace": "^0.5.3",
|
"gulp-replace": "^0.5.3",
|
||||||
@ -22,7 +21,8 @@
|
|||||||
"gulp-svgstore": "^5.0.5",
|
"gulp-svgstore": "^5.0.5",
|
||||||
"gulp-uglify": "^1.5.3",
|
"gulp-uglify": "^1.5.3",
|
||||||
"gulp-util": "^3.0.7",
|
"gulp-util": "^3.0.7",
|
||||||
"run-sequence": "^1.1.5"
|
"run-sequence": "^1.1.5",
|
||||||
|
"through2": "^2.0.1"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"HTML5 Video",
|
"HTML5 Video",
|
||||||
|
78
readme.md
@ -3,7 +3,7 @@ A simple, accessible and customizable HTML5, YouTube and Vimeo media player.
|
|||||||
|
|
||||||
[Checkout the demo](https://plyr.io)
|
[Checkout the demo](https://plyr.io)
|
||||||
|
|
||||||
[](https://plyr.io)
|
[](https://plyr.io)
|
||||||
|
|
||||||
## Why?
|
## Why?
|
||||||
We wanted a lightweight, accessible and customizable media player that supports [*modern*](#browser-support) browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job.
|
We wanted a lightweight, accessible and customizable media player that supports [*modern*](#browser-support) browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job.
|
||||||
@ -40,19 +40,17 @@ If you have any cool ideas or features, please let me know by [creating an issue
|
|||||||
## Implementation
|
## Implementation
|
||||||
Check `docs/index.html` and `docs/dist/docs.js` for an example setup.
|
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.6.0/plyr.js` to `https://cdn.plyr.io/1.6.0/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.6.16/plyr.js` to `https://cdn.plyr.io/1.6.16/plyr.js`
|
||||||
|
|
||||||
### Node Package Manager (NPM)
|
### npm
|
||||||
[](https://badge.fury.io/js/plyr)
|
|
||||||
|
|
||||||
Using NPM, you can grab Plyr:
|
Using `npm`, you can grab Plyr:
|
||||||
```
|
```
|
||||||
npm install plyr
|
npm install plyr
|
||||||
```
|
```
|
||||||
[https://www.npmjs.com/package/plyr](https://www.npmjs.com/package/plyr)
|
[https://www.npmjs.com/package/plyr](https://www.npmjs.com/package/plyr)
|
||||||
|
|
||||||
### Bower
|
### Bower
|
||||||
[](https://badge.fury.io/bo/plyr)
|
|
||||||
|
|
||||||
If bower is your thang, you can grab Plyr using:
|
If bower is your thang, you can grab Plyr using:
|
||||||
```
|
```
|
||||||
@ -73,11 +71,11 @@ 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:
|
If you want to use our CDN, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="https://cdn.plyr.io/1.6.0/plyr.css">
|
<link rel="stylesheet" href="https://cdn.plyr.io/1.6.16/plyr.css">
|
||||||
<script src="https://cdn.plyr.io/1.6.0/plyr.js"></script>
|
<script src="https://cdn.plyr.io/1.6.16/plyr.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.6.0/sprite.svg`.
|
The SVG sprite/defs file can be found here: `https://cdn.plyr.io/1.6.16/plyr.svg`.
|
||||||
|
|
||||||
### CSS & Styling
|
### CSS & Styling
|
||||||
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.scss` 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.scss` file included in `/src` in your build to save a request.
|
||||||
@ -89,35 +87,10 @@ If you want to use the default css, add the `plyr.css` file from `/dist` into yo
|
|||||||
The default setup uses the BEM methodology with `plyr` as the block, e.g. `.plyr__controls`. You can change the class hooks in the options. Check out the source for more on this.
|
The default setup uses the BEM methodology with `plyr` as the block, e.g. `.plyr__controls`. You can change the class hooks in the options. Check out the source for more on this.
|
||||||
|
|
||||||
### SVG
|
### SVG
|
||||||
The SVG sprite for the controls icons can be loaded two ways:
|
The icons used in the Plyr controls are loaded in an SVG sprite. The sprite is automatically loaded from our CDN by default. If you already have an icon build system in place, you can include the source plyr icons (see `/src/sprite` for source icons).
|
||||||
- By passing the *relative* path to the sprite as the `iconUrl` option; or
|
|
||||||
- Using AJAX, injecting the sprite into a hidden div.
|
|
||||||
|
|
||||||
#### Using the `iconUrl` option
|
#### Using the `iconUrl` option
|
||||||
This method requires the SVG sprite to be hosted on the *same domain* as your page hosting the player. Currently no browser supports cross origin SVG sprites due to XSS issues. Fingers crossed this will come soon though. An example value for this option would be:
|
You can however specify your own `iconUrl` option and Plyr will determine if the url is absolute and requires loading by AJAX/CORS due to current browser limitations or if it's a relative path, just use the path directly.
|
||||||
```
|
|
||||||
/path/to/sprite.svg
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Using AJAX
|
|
||||||
Using AJAX means you can load the sprite from a different origin. Avoiding the issues above. This is an example script to load an SVG sprite best added before the closing `</body>`, before any other scripts.
|
|
||||||
|
|
||||||
```html
|
|
||||||
<script>
|
|
||||||
(function(d, p){
|
|
||||||
var a = new XMLHttpRequest(),
|
|
||||||
b = d.body;
|
|
||||||
a.open('GET', p, true);
|
|
||||||
a.send();
|
|
||||||
a.onload = function() {
|
|
||||||
var c = d.createElement('div');
|
|
||||||
c.setAttribute('hidden', '');
|
|
||||||
c.innerHTML = a.responseText;
|
|
||||||
b.insertBefore(c, b.childNodes[0]);
|
|
||||||
};
|
|
||||||
})(document, 'https://cdn.plyr.io/1.6.0/sprite.svg');
|
|
||||||
</script>
|
|
||||||
```
|
|
||||||
|
|
||||||
If you're using the `<base>` tag on your site, you may need to use something like this:
|
If you're using the `<base>` tag on your site, you may need to use something like this:
|
||||||
[svgfixer.js](https://gist.github.com/leonderijke/c5cf7c5b2e424c0061d2)
|
[svgfixer.js](https://gist.github.com/leonderijke/c5cf7c5b2e424c0061d2)
|
||||||
@ -190,7 +163,7 @@ Be sure to [validate your caption files](https://quuz.org/webvtt/)
|
|||||||
Here's an example of a default setup:
|
Here's an example of a default setup:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/1.6.0/plyr.js"></script>
|
<script src="https://cdn.plyr.io/1.6.16/plyr.js"></script>
|
||||||
<script>plyr.setup();</script>
|
<script>plyr.setup();</script>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -250,7 +223,7 @@ Options must be passed as an object to the `setup()` method as above or as JSON
|
|||||||
<tr>
|
<tr>
|
||||||
<td><code>controls</code></td>
|
<td><code>controls</code></td>
|
||||||
<td>Array</td>
|
<td>Array</td>
|
||||||
<td><code>["restart", "rewind", "play", "fast-forward", "current-time", "duration", "mute", "volume", "captions", "fullscreen"]</code></td>
|
<td><code>['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'fullscreen']</code></td>
|
||||||
<td>Toggle which control elements you would like to display when using the default controls html. If you specify a <code>html</code> option, this is redundant. The default value is to display everything.</td>
|
<td>Toggle which control elements you would like to display when using the default controls html. If you specify a <code>html</code> option, this is redundant. The default value is to display everything.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -260,16 +233,22 @@ Options must be passed as an object to the `setup()` method as above or as JSON
|
|||||||
<td>Used for internationalization (i18n) of the tooltips/labels within the buttons.</td>
|
<td>Used for internationalization (i18n) of the tooltips/labels within the buttons.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>iconPrefix</code></td>
|
<td><code>loadSprite</code></td>
|
||||||
<td>String</td>
|
<td>Boolean</td>
|
||||||
<td><code>icon</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Specify the id prefix for the icons used in the default controls (e.g. "icon-play" would be "icon"). This is to prevent clashes if you're using your own SVG defs file but with the default controls. Most people can ignore this option.</td>
|
<td>Load the SVG sprite specified as the <code>iconUrl</code> option (if a URL). If <code>false</code>, it is assumed you are handling sprite loading yourself.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>iconUrl</code></td>
|
<td><code>iconUrl</code></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td><code>null</code></td>
|
<td><code>null</code></td>
|
||||||
<td>Specify a relative path to the SVG sprite, hosted on the *same domain* as the page the player is hosted on. Using this menthod means no requirement for the AJAX sprite loading script. See the <a href="#svg">SVG section</a> for more info.</td>
|
<td>Specify a URL or path to the SVG sprite. See the <a href="#svg">SVG section</a> for more info.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>iconPrefix</code></td>
|
||||||
|
<td>String</td>
|
||||||
|
<td><code>plyr</code></td>
|
||||||
|
<td>Specify the id prefix for the icons used in the default controls (e.g. "plyr-play" would be "plyr"). This is to prevent clashes if you're using your own SVG sprite but with the default controls. Most people can ignore this option.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>debug</code></td>
|
<td><code>debug</code></td>
|
||||||
@ -307,6 +286,12 @@ Options must be passed as an object to the `setup()` method as above or as JSON
|
|||||||
<td><code>true</code></td>
|
<td><code>true</code></td>
|
||||||
<td>Hide video controls automatically after 2s of no mouse or focus movement, on control element blur (tab out), on playback start or entering fullscreen. As soon as the mouse is moved, a control element is focused or playback is paused, the controls reappear instantly.</td>
|
<td>Hide video controls automatically after 2s of no mouse or focus movement, on control element blur (tab out), on playback start or entering fullscreen. As soon as the mouse is moved, a control element is focused or playback is paused, the controls reappear instantly.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><code>showPosterOnEnd</code></td>
|
||||||
|
<td>Boolean</td>
|
||||||
|
<td><code>false</code></td>
|
||||||
|
<td>This will restore and *reload* HTML5 video once playback is complete. Note: depending on the browser caching, this may result in the video downloading again (or parts of it). Use with caution.</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>tooltips</code></td>
|
<td><code>tooltips</code></td>
|
||||||
<td>Object</td>
|
<td>Object</td>
|
||||||
@ -650,7 +635,7 @@ Some more details on the object parameters
|
|||||||
|
|
||||||
## Events
|
## Events
|
||||||
|
|
||||||
You can listen for events on the element you setup Plyr on. Some events only apply to HTML5 audio and video.
|
You can listen for events on the target element you setup Plyr on (see example under the table). Some events only apply to HTML5 audio and video.
|
||||||
|
|
||||||
<table class="table" width="100%">
|
<table class="table" width="100%">
|
||||||
<thead>
|
<thead>
|
||||||
@ -784,7 +769,7 @@ Details borrowed from: [https://developer.mozilla.org/en-US/docs/Web/Guide/Event
|
|||||||
Here's an example of binding an event listener:
|
Here's an example of binding an event listener:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
document.querySelector('.js-plyr').addEventListener('ready', function() {
|
document.querySelector('.js-plyr').addEventListener('ready', function(event) {
|
||||||
var player = event.target.plyr;
|
var player = event.target.plyr;
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@ -798,7 +783,7 @@ Plyr references a custom version of the Vimeo Froogaloop API as Vimeo have negle
|
|||||||
The native API's can be accessed through the `embed` property of the plyr object. For example:
|
The native API's can be accessed through the `embed` property of the plyr object. For example:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
document.querySelector('.js-plyr').addEventListener('ready', function() {
|
document.querySelector('.js-plyr').addEventListener('ready', function(event) {
|
||||||
var player = event.target.plyr;
|
var player = event.target.plyr;
|
||||||
|
|
||||||
// YouTube
|
// YouTube
|
||||||
@ -869,6 +854,7 @@ If you find anything weird with Plyr, please let us know using the GitHub issues
|
|||||||
Plyr is developed by [@sam_potts](https://twitter.com/sam_potts) / [sampotts.me](http://sampotts.me) with help from the awesome [contributors](https://github.com/Selz/plyr/graphs/contributors)
|
Plyr is developed by [@sam_potts](https://twitter.com/sam_potts) / [sampotts.me](http://sampotts.me) with help from the awesome [contributors](https://github.com/Selz/plyr/graphs/contributors)
|
||||||
|
|
||||||
## Mentions
|
## Mentions
|
||||||
|
- [ProductHunt](https://www.producthunt.com/tech/plyr)
|
||||||
- [The Changelog](http://thechangelog.com/plyr-simple-html5-media-player-custom-controls-webvtt-captions/)
|
- [The Changelog](http://thechangelog.com/plyr-simple-html5-media-player-custom-controls-webvtt-captions/)
|
||||||
- [HTML5 Weekly #177](http://html5weekly.com/issues/177)
|
- [HTML5 Weekly #177](http://html5weekly.com/issues/177)
|
||||||
- [Responsive Design #149](http://us4.campaign-archive2.com/?u=559bc631fe5294fc66f5f7f89&id=451a61490f)
|
- [Responsive Design #149](http://us4.campaign-archive2.com/?u=559bc631fe5294fc66f5f7f89&id=451a61490f)
|
||||||
|
504
src/js/plyr.js
@ -1,6 +1,6 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Plyr
|
// Plyr
|
||||||
// plyr.js v1.6.0
|
// plyr.js v1.6.16
|
||||||
// https://github.com/selz/plyr
|
// https://github.com/selz/plyr
|
||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@ -26,22 +26,28 @@
|
|||||||
/*global YT,$f*/
|
/*global YT,$f*/
|
||||||
|
|
||||||
// Globals
|
// Globals
|
||||||
var fullscreen, api = {};
|
var fullscreen,
|
||||||
|
scroll = { x: 0, y: 0 },
|
||||||
|
|
||||||
// Default config
|
// Default config
|
||||||
var defaults = {
|
defaults = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
debug: false,
|
debug: false,
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
loop: false,
|
loop: false,
|
||||||
seekTime: 10,
|
seekTime: 10,
|
||||||
volume: 5,
|
volume: 5,
|
||||||
|
volumeMin: 0,
|
||||||
|
volumeMax: 10,
|
||||||
|
volumeStep: 1,
|
||||||
duration: null,
|
duration: null,
|
||||||
displayDuration: true,
|
displayDuration: true,
|
||||||
iconPrefix: 'icon',
|
loadSprite: true,
|
||||||
iconUrl: '',
|
iconPrefix: 'plyr',
|
||||||
|
iconUrl: 'https://cdn.plyr.io/1.6.16/plyr.svg',
|
||||||
clickToPlay: true,
|
clickToPlay: true,
|
||||||
hideControls: true,
|
hideControls: true,
|
||||||
|
showPosterOnEnd: false,
|
||||||
tooltips: {
|
tooltips: {
|
||||||
controls: false,
|
controls: false,
|
||||||
seek: true
|
seek: true
|
||||||
@ -131,7 +137,7 @@
|
|||||||
frameTitle: 'Player for {title}'
|
frameTitle: 'Player for {title}'
|
||||||
},
|
},
|
||||||
types: {
|
types: {
|
||||||
embed: ['youtube', 'vimeo'],
|
embed: ['youtube', 'vimeo', 'soundcloud'],
|
||||||
html5: ['video', 'audio']
|
html5: ['video', 'audio']
|
||||||
},
|
},
|
||||||
// URLs
|
// URLs
|
||||||
@ -141,6 +147,9 @@
|
|||||||
},
|
},
|
||||||
youtube: {
|
youtube: {
|
||||||
api: 'https://www.youtube.com/iframe_api'
|
api: 'https://www.youtube.com/iframe_api'
|
||||||
|
},
|
||||||
|
soundcloud: {
|
||||||
|
api: 'https://w.soundcloud.com/player/api.js'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Custom control listeners
|
// Custom control listeners
|
||||||
@ -445,14 +454,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Trigger event
|
// Trigger event
|
||||||
function _triggerEvent(element, eventName, properties) {
|
function _triggerEvent(element, eventName, bubbles, properties) {
|
||||||
// Bail if no element
|
// Bail if no element
|
||||||
if (!element || !eventName) {
|
if (!element || !eventName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create and dispatch the event
|
// Default bubbles to false
|
||||||
var event = new CustomEvent(eventName, properties);
|
if (typeof bubbles !== 'boolean') {
|
||||||
|
bubbles = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create and dispatch the event
|
||||||
|
var event = new CustomEvent(eventName, {
|
||||||
|
bubbles: bubbles,
|
||||||
|
detail: properties
|
||||||
|
});
|
||||||
|
|
||||||
// Dispatch the event
|
// Dispatch the event
|
||||||
element.dispatchEvent(event);
|
element.dispatchEvent(event);
|
||||||
@ -642,11 +659,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get icon URL
|
||||||
|
function _getIconUrl() {
|
||||||
|
return {
|
||||||
|
url: config.iconUrl,
|
||||||
|
external: (config.iconUrl.indexOf("http") === 0)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Build the default HTML
|
// Build the default HTML
|
||||||
function _buildControls() {
|
function _buildControls() {
|
||||||
// Create html array
|
// Create html array
|
||||||
var html = [],
|
var html = [],
|
||||||
iconPath = config.iconUrl + '#' + config.iconPrefix;
|
iconUrl = _getIconUrl(),
|
||||||
|
iconPath = (!iconUrl.external ? iconUrl.url : '') + '#' + config.iconPrefix;
|
||||||
|
|
||||||
// Larger overlaid play button
|
// Larger overlaid play button
|
||||||
if (_inArray(config.controls, 'play-large')) {
|
if (_inArray(config.controls, 'play-large')) {
|
||||||
@ -761,8 +787,8 @@
|
|||||||
html.push(
|
html.push(
|
||||||
'<span class="plyr__volume">',
|
'<span class="plyr__volume">',
|
||||||
'<label for="volume{id}" class="plyr__sr-only">' + config.i18n.volume + '</label>',
|
'<label for="volume{id}" class="plyr__sr-only">' + config.i18n.volume + '</label>',
|
||||||
'<input id="volume{id}" class="plyr__volume--input" type="range" min="0" max="10" value="5" data-plyr="volume">',
|
'<input id="volume{id}" class="plyr__volume--input" type="range" min="' + config.volumeMin + '" max="' + config.volumeMax + '" value="' + config.volume + '" data-plyr="volume">',
|
||||||
'<progress class="plyr__volume--display" max="10" value="0" role="presentation"></progress>',
|
'<progress class="plyr__volume--display" max="' + config.volumeMax + '" value="' + config.volumeMin + '" role="presentation"></progress>',
|
||||||
'</span>'
|
'</span>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -971,6 +997,7 @@
|
|||||||
|
|
||||||
// Set the current caption
|
// Set the current caption
|
||||||
function _setCaption(caption) {
|
function _setCaption(caption) {
|
||||||
|
/* jshint unused:false */
|
||||||
var container = _getElement(config.selectors.captions),
|
var container = _getElement(config.selectors.captions),
|
||||||
content = document.createElement('span');
|
content = document.createElement('span');
|
||||||
|
|
||||||
@ -993,7 +1020,7 @@
|
|||||||
// Set new caption text
|
// Set new caption text
|
||||||
container.appendChild(content);
|
container.appendChild(content);
|
||||||
|
|
||||||
// Force redraw
|
// Force redraw (for Safari)
|
||||||
var redraw = container.offsetHeight;
|
var redraw = container.offsetHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1146,6 +1173,20 @@
|
|||||||
|
|
||||||
// Insert controls
|
// Insert controls
|
||||||
function _injectControls() {
|
function _injectControls() {
|
||||||
|
// Sprite
|
||||||
|
if (config.loadSprite) {
|
||||||
|
var iconUrl = _getIconUrl();
|
||||||
|
|
||||||
|
// Only load external sprite using AJAX
|
||||||
|
if (iconUrl.external) {
|
||||||
|
_log('Loading external SVG sprite');
|
||||||
|
loadSprite(iconUrl.url);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_log('Sprite will be used inline');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Make a copy of the html
|
// Make a copy of the html
|
||||||
var html = config.html;
|
var html = config.html;
|
||||||
|
|
||||||
@ -1344,7 +1385,7 @@
|
|||||||
// Setup YouTube/Vimeo
|
// Setup YouTube/Vimeo
|
||||||
function _setupEmbed() {
|
function _setupEmbed() {
|
||||||
var container = document.createElement('div'),
|
var container = document.createElement('div'),
|
||||||
videoId = plyr.embedId,
|
mediaId = plyr.embedId,
|
||||||
id = plyr.type + '-' + Math.floor(Math.random() * (10000));
|
id = plyr.type + '-' + Math.floor(Math.random() * (10000));
|
||||||
|
|
||||||
// Remove old containers
|
// Remove old containers
|
||||||
@ -1367,7 +1408,7 @@
|
|||||||
|
|
||||||
// Setup API
|
// Setup API
|
||||||
if (typeof YT === 'object') {
|
if (typeof YT === 'object') {
|
||||||
_youTubeReady(videoId, container);
|
_youTubeReady(mediaId, container);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Load the API
|
// Load the API
|
||||||
@ -1377,7 +1418,7 @@
|
|||||||
window.onYouTubeReadyCallbacks = window.onYouTubeReadyCallbacks || [];
|
window.onYouTubeReadyCallbacks = window.onYouTubeReadyCallbacks || [];
|
||||||
|
|
||||||
// Add to queue
|
// Add to queue
|
||||||
window.onYouTubeReadyCallbacks.push(function() { _youTubeReady(videoId, container) });
|
window.onYouTubeReadyCallbacks.push(function() { _youTubeReady(mediaId, container); });
|
||||||
|
|
||||||
// Set callback to process queue
|
// Set callback to process queue
|
||||||
window.onYouTubeIframeAPIReady = function () {
|
window.onYouTubeIframeAPIReady = function () {
|
||||||
@ -1388,14 +1429,14 @@
|
|||||||
// Vimeo
|
// Vimeo
|
||||||
else if (plyr.type === 'vimeo') {
|
else if (plyr.type === 'vimeo') {
|
||||||
// Inject the iframe
|
// Inject the iframe
|
||||||
var iframe = document.createElement('iframe');
|
var vimeo = document.createElement('iframe');
|
||||||
|
|
||||||
// Watch for iframe load
|
// Watch for iframe load
|
||||||
iframe.loaded = false;
|
vimeo.loaded = false;
|
||||||
_on(iframe, 'load', function() { iframe.loaded = true; });
|
_on(vimeo, 'load', function() { vimeo.loaded = true; });
|
||||||
|
|
||||||
_setAttributes(iframe, {
|
_setAttributes(vimeo, {
|
||||||
'src': 'https://player.vimeo.com/video/' + videoId + '?player_id=' + id + '&api=1&badge=0&byline=0&portrait=0&title=0',
|
'src': 'https://player.vimeo.com/video/' + mediaId + '?player_id=' + id + '&api=1&badge=0&byline=0&portrait=0&title=0',
|
||||||
'id': id,
|
'id': id,
|
||||||
'webkitallowfullscreen': '',
|
'webkitallowfullscreen': '',
|
||||||
'mozallowfullscreen': '',
|
'mozallowfullscreen': '',
|
||||||
@ -1405,23 +1446,53 @@
|
|||||||
|
|
||||||
// If full support, we can use custom controls (hiding Vimeos), if not, use Vimeo
|
// If full support, we can use custom controls (hiding Vimeos), if not, use Vimeo
|
||||||
if (plyr.supported.full) {
|
if (plyr.supported.full) {
|
||||||
container.appendChild(iframe);
|
container.appendChild(vimeo);
|
||||||
plyr.media.appendChild(container);
|
plyr.media.appendChild(container);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
plyr.media.appendChild(iframe);
|
plyr.media.appendChild(vimeo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the API
|
// Load the API if not already
|
||||||
if (!('$f' in window)) {
|
if (!('$f' in window)) {
|
||||||
_injectScript(config.urls.vimeo.api);
|
_injectScript(config.urls.vimeo.api);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for fragaloop load
|
// Wait for fragaloop load
|
||||||
var timer = window.setInterval(function() {
|
var vimeoTimer = window.setInterval(function() {
|
||||||
if ('$f' in window && iframe.loaded) {
|
if ('$f' in window && vimeo.loaded) {
|
||||||
window.clearInterval(timer);
|
window.clearInterval(vimeoTimer);
|
||||||
_vimeoReady.call(iframe);
|
_vimeoReady.call(vimeo);
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
|
// Soundcloud
|
||||||
|
else if (plyr.type === 'soundcloud') {
|
||||||
|
// Inject the iframe
|
||||||
|
var soundCloud = document.createElement('iframe');
|
||||||
|
|
||||||
|
// Watch for iframe load
|
||||||
|
soundCloud.loaded = false;
|
||||||
|
_on(soundCloud, 'load', function() { soundCloud.loaded = true; });
|
||||||
|
|
||||||
|
_setAttributes(soundCloud, {
|
||||||
|
'src': 'https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/' + mediaId,
|
||||||
|
'id': id
|
||||||
|
});
|
||||||
|
|
||||||
|
container.appendChild(soundCloud);
|
||||||
|
plyr.media.appendChild(container);
|
||||||
|
|
||||||
|
// Load the API if not already
|
||||||
|
if (!window.SC) {
|
||||||
|
_injectScript(config.urls.soundcloud.api);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for SC load
|
||||||
|
var soundCloudTimer = window.setInterval(function() {
|
||||||
|
if (window.SC && soundCloud.loaded) {
|
||||||
|
window.clearInterval(soundCloudTimer);
|
||||||
|
_soundcloudReady.call(soundCloud);
|
||||||
}
|
}
|
||||||
}, 50);
|
}, 50);
|
||||||
}
|
}
|
||||||
@ -1465,6 +1536,12 @@
|
|||||||
origin: '*' // https://code.google.com/p/gdata-issues/issues/detail?id=5788#c45
|
origin: '*' // https://code.google.com/p/gdata-issues/issues/detail?id=5788#c45
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
|
'onError': function(event) {
|
||||||
|
_triggerEvent(plyr.container, 'error', true, {
|
||||||
|
code: event.data,
|
||||||
|
embed: event.target
|
||||||
|
});
|
||||||
|
},
|
||||||
'onReady': function(event) {
|
'onReady': function(event) {
|
||||||
// Get the instance
|
// Get the instance
|
||||||
var instance = event.target;
|
var instance = event.target;
|
||||||
@ -1561,6 +1638,10 @@
|
|||||||
_triggerEvent(plyr.media, 'pause');
|
_triggerEvent(plyr.media, 'pause');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_triggerEvent(plyr.container, 'statechange', false, {
|
||||||
|
code: event.data
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1649,6 +1730,85 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Soundcloud ready
|
||||||
|
function _soundcloudReady() {
|
||||||
|
/* jshint validthis: true */
|
||||||
|
plyr.embed = window.SC.Widget(this);
|
||||||
|
|
||||||
|
// Setup on ready
|
||||||
|
plyr.embed.bind(window.SC.Widget.Events.READY, function() {
|
||||||
|
// Create a faux HTML5 API using the Soundcloud API
|
||||||
|
plyr.media.play = function() {
|
||||||
|
plyr.embed.play();
|
||||||
|
plyr.media.paused = false;
|
||||||
|
};
|
||||||
|
plyr.media.pause = function() {
|
||||||
|
plyr.embed.pause();
|
||||||
|
plyr.media.paused = true;
|
||||||
|
};
|
||||||
|
plyr.media.stop = function() {
|
||||||
|
plyr.embed.seekTo(0);
|
||||||
|
plyr.embed.pause();
|
||||||
|
plyr.media.paused = true;
|
||||||
|
};
|
||||||
|
plyr.media.paused = true;
|
||||||
|
plyr.media.currentTime = 0;
|
||||||
|
|
||||||
|
// Update UI
|
||||||
|
_embedReady();
|
||||||
|
|
||||||
|
plyr.embed.getPosition(function(value) {
|
||||||
|
plyr.media.currentTime = value;
|
||||||
|
|
||||||
|
// Trigger timeupdate
|
||||||
|
_triggerEvent(plyr.media, 'timeupdate');
|
||||||
|
});
|
||||||
|
|
||||||
|
plyr.embed.getDuration(function(value) {
|
||||||
|
plyr.media.duration = value/1000;
|
||||||
|
// Display duration if available
|
||||||
|
_displayDuration();
|
||||||
|
});
|
||||||
|
|
||||||
|
plyr.embed.bind(window.SC.Widget.Events.PLAY, function() {
|
||||||
|
plyr.media.paused = false;
|
||||||
|
_triggerEvent(plyr.media, 'play');
|
||||||
|
_triggerEvent(plyr.media, 'playing');
|
||||||
|
});
|
||||||
|
|
||||||
|
plyr.embed.bind(window.SC.Widget.Events.PAUSE, function() {
|
||||||
|
plyr.media.paused = true;
|
||||||
|
_triggerEvent(plyr.media, 'pause');
|
||||||
|
});
|
||||||
|
|
||||||
|
plyr.embed.bind(window.SC.Widget.Events.PLAY_PROGRESS, function(data) {
|
||||||
|
plyr.media.seeking = false;
|
||||||
|
plyr.media.currentTime = data.currentPosition/1000;
|
||||||
|
_triggerEvent(plyr.media, 'timeupdate');
|
||||||
|
});
|
||||||
|
|
||||||
|
plyr.embed.bind(window.SC.Widget.Events.LOAD_PROGRESS, function(data) {
|
||||||
|
plyr.media.buffered = data.loadProgress;
|
||||||
|
_triggerEvent(plyr.media, 'progress');
|
||||||
|
|
||||||
|
if (parseInt(data.loadProgress) === 1) {
|
||||||
|
// Trigger event
|
||||||
|
_triggerEvent(plyr.media, 'canplaythrough');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
plyr.embed.bind(window.SC.Widget.Events.FINISH, function() {
|
||||||
|
plyr.media.paused = true;
|
||||||
|
_triggerEvent(plyr.media, 'ended');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Autoplay
|
||||||
|
if (config.autoplay) {
|
||||||
|
plyr.embed.play();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Play media
|
// Play media
|
||||||
function _play() {
|
function _play() {
|
||||||
if ('play' in plyr.media) {
|
if ('play' in plyr.media) {
|
||||||
@ -1723,10 +1883,8 @@
|
|||||||
targetTime = duration;
|
targetTime = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update progress
|
// Update seek range and progress
|
||||||
if(plyr.progress && plyr.progress.played) {
|
_updateSeekDisplay(targetTime);
|
||||||
plyr.progress.played.value = ((100 / duration) * targetTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the current time
|
// Set the current time
|
||||||
// Try/catch incase the media isn't set and we're calling seek() from source() and IE moans
|
// Try/catch incase the media isn't set and we're calling seek() from source() and IE moans
|
||||||
@ -1747,6 +1905,10 @@
|
|||||||
// Round to nearest second for vimeo
|
// Round to nearest second for vimeo
|
||||||
plyr.embed.api('seekTo', targetTime.toFixed(0));
|
plyr.embed.api('seekTo', targetTime.toFixed(0));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'soundcloud':
|
||||||
|
plyr.embed.seekTo(targetTime * 1000);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (paused) {
|
if (paused) {
|
||||||
@ -1770,10 +1932,18 @@
|
|||||||
// Get the duration (or custom if set)
|
// Get the duration (or custom if set)
|
||||||
function _getDuration() {
|
function _getDuration() {
|
||||||
// It should be a number, but parse it just incase
|
// It should be a number, but parse it just incase
|
||||||
var duration = parseInt(config.duration);
|
var duration = parseInt(config.duration),
|
||||||
|
|
||||||
|
// True duration
|
||||||
|
mediaDuration = 0;
|
||||||
|
|
||||||
|
// Only if duration available
|
||||||
|
if(plyr.media.duration !== null && !isNaN(plyr.media.duration)) {
|
||||||
|
mediaDuration = plyr.media.duration;
|
||||||
|
}
|
||||||
|
|
||||||
// If custom duration is funky, use regular duration
|
// If custom duration is funky, use regular duration
|
||||||
return (isNaN(duration) ? plyr.media.duration : duration);
|
return (isNaN(duration) ? mediaDuration : duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check playing state
|
// Check playing state
|
||||||
@ -1784,6 +1954,19 @@
|
|||||||
_toggleControls(plyr.media.paused);
|
_toggleControls(plyr.media.paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save scroll position
|
||||||
|
function _saveScrollPosition() {
|
||||||
|
scroll = {
|
||||||
|
x: window.pageXOffset || 0,
|
||||||
|
y: window.pageYOffset || 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Restore scroll position
|
||||||
|
function _restoreScrollPosition() {
|
||||||
|
window.scrollTo(scroll.x, scroll.y);
|
||||||
|
}
|
||||||
|
|
||||||
// Toggle fullscreen
|
// Toggle fullscreen
|
||||||
function _toggleFullscreen(event) {
|
function _toggleFullscreen(event) {
|
||||||
// Check for native support
|
// Check for native support
|
||||||
@ -1797,6 +1980,10 @@
|
|||||||
else if (nativeSupport) {
|
else if (nativeSupport) {
|
||||||
// Request fullscreen
|
// Request fullscreen
|
||||||
if (!fullscreen.isFullScreen(plyr.container)) {
|
if (!fullscreen.isFullScreen(plyr.container)) {
|
||||||
|
// Save scroll position
|
||||||
|
_saveScrollPosition();
|
||||||
|
|
||||||
|
// Request full screen
|
||||||
fullscreen.requestFullScreen(plyr.container);
|
fullscreen.requestFullScreen(plyr.container);
|
||||||
}
|
}
|
||||||
// Bail from fullscreen
|
// Bail from fullscreen
|
||||||
@ -1841,6 +2028,11 @@
|
|||||||
|
|
||||||
// Trigger an event
|
// Trigger an event
|
||||||
_triggerEvent(plyr.container, plyr.isFullscreen ? 'enterfullscreen' : 'exitfullscreen');
|
_triggerEvent(plyr.container, plyr.isFullscreen ? 'enterfullscreen' : 'exitfullscreen');
|
||||||
|
|
||||||
|
// Restore scroll position
|
||||||
|
if (!plyr.isFullscreen && nativeSupport) {
|
||||||
|
_restoreScrollPosition();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bail from faux-fullscreen
|
// Bail from faux-fullscreen
|
||||||
@ -1878,7 +2070,11 @@
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'vimeo':
|
case 'vimeo':
|
||||||
plyr.embed.api('setVolume', plyr.media.muted ? 0 : parseFloat(config.volume / 10));
|
plyr.embed.api('setVolume', plyr.media.muted ? 0 : parseFloat(config.volume / config.volumeMax));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'soundcloud':
|
||||||
|
plyr.embed.setVolume(plyr.media.muted ? 0 : parseFloat(config.volume / config.volumeMax));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1889,6 +2085,9 @@
|
|||||||
|
|
||||||
// Set volume
|
// Set volume
|
||||||
function _setVolume(volume) {
|
function _setVolume(volume) {
|
||||||
|
var max = config.volumeMax,
|
||||||
|
min = config.volumeMin;
|
||||||
|
|
||||||
// Use default if no value specified
|
// Use default if no value specified
|
||||||
if (typeof volume === 'undefined') {
|
if (typeof volume === 'undefined') {
|
||||||
volume = config.volume;
|
volume = config.volume;
|
||||||
@ -1907,17 +2106,17 @@
|
|||||||
volume = config.volume;
|
volume = config.volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maximum is 10
|
// Maximum is volumeMax
|
||||||
if (volume > 10) {
|
if (volume > max) {
|
||||||
volume = 10;
|
volume = max;
|
||||||
}
|
}
|
||||||
// Minimum is 0
|
// Minimum is volumeMin
|
||||||
if (volume < 0) {
|
if (volume < min) {
|
||||||
volume = 0;
|
volume = min;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the player volume
|
// Set the player volume
|
||||||
plyr.media.volume = parseFloat(volume / 10);
|
plyr.media.volume = parseFloat(volume / max);
|
||||||
|
|
||||||
// Set the display
|
// Set the display
|
||||||
if (plyr.volume.display) {
|
if (plyr.volume.display) {
|
||||||
@ -1935,6 +2134,10 @@
|
|||||||
case 'vimeo':
|
case 'vimeo':
|
||||||
plyr.embed.api('setVolume', plyr.media.volume);
|
plyr.embed.api('setVolume', plyr.media.volume);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'soundcloud':
|
||||||
|
plyr.embed.setVolume(plyr.media.volume);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger volumechange for embeds
|
// Trigger volumechange for embeds
|
||||||
@ -1947,10 +2150,24 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Increase volume
|
||||||
|
function _increaseVolume() {
|
||||||
|
var volume = plyr.media.muted ? 0 : (plyr.media.volume * config.volumeMax);
|
||||||
|
|
||||||
|
_setVolume(volume + (config.volumeStep / 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Decrease volume
|
||||||
|
function _decreaseVolume() {
|
||||||
|
var volume = plyr.media.muted ? 0 : (plyr.media.volume * config.volumeMax);
|
||||||
|
|
||||||
|
_setVolume(volume - (config.volumeStep / 5));
|
||||||
|
}
|
||||||
|
|
||||||
// Update volume UI and storage
|
// Update volume UI and storage
|
||||||
function _updateVolume() {
|
function _updateVolume() {
|
||||||
// Get the current volume
|
// Get the current volume
|
||||||
var volume = plyr.media.muted ? 0 : (plyr.media.volume * 10);
|
var volume = plyr.media.muted ? 0 : (plyr.media.volume * config.volumeMax);
|
||||||
|
|
||||||
// Update the <input type="range"> if present
|
// Update the <input type="range"> if present
|
||||||
if (plyr.supported.full) {
|
if (plyr.supported.full) {
|
||||||
@ -2016,8 +2233,11 @@
|
|||||||
|
|
||||||
// Update <progress> elements
|
// Update <progress> elements
|
||||||
function _updateProgress(event) {
|
function _updateProgress(event) {
|
||||||
|
if (!plyr.supported.full) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var progress = plyr.progress.played,
|
var progress = plyr.progress.played,
|
||||||
text = false,
|
|
||||||
value = 0,
|
value = 0,
|
||||||
duration = _getDuration();
|
duration = _getDuration();
|
||||||
|
|
||||||
@ -2038,8 +2258,7 @@
|
|||||||
// Check buffer status
|
// Check buffer status
|
||||||
case 'playing':
|
case 'playing':
|
||||||
case 'progress':
|
case 'progress':
|
||||||
progress = plyr.progress.buffer.bar;
|
progress = plyr.progress.buffer;
|
||||||
text = plyr.progress.buffer.text;
|
|
||||||
value = (function() {
|
value = (function() {
|
||||||
var buffered = plyr.media.buffered;
|
var buffered = plyr.media.buffered;
|
||||||
|
|
||||||
@ -2060,11 +2279,41 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set values
|
// Set values
|
||||||
if (progress) {
|
_setProgress(progress, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set <progress> value
|
||||||
|
function _setProgress(progress, value) {
|
||||||
|
if (!plyr.supported.full) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default to 0
|
||||||
|
if (typeof value === 'undefined') {
|
||||||
|
value = 0;
|
||||||
|
}
|
||||||
|
// Default to buffer or bail
|
||||||
|
if (typeof progress === 'undefined') {
|
||||||
|
if (plyr.progress && plyr.progress.buffer) {
|
||||||
|
progress = plyr.progress.buffer;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// One progress element passed
|
||||||
|
if (progress instanceof HTMLElement) {
|
||||||
progress.value = value;
|
progress.value = value;
|
||||||
}
|
}
|
||||||
if (text) {
|
// Object of progress + text element
|
||||||
text.innerHTML = value;
|
else if (progress) {
|
||||||
|
if (progress.bar) {
|
||||||
|
progress.bar.value = value;
|
||||||
|
}
|
||||||
|
if (progress.text) {
|
||||||
|
progress.text.innerHTML = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2132,10 +2381,33 @@
|
|||||||
_updateProgress(event);
|
_updateProgress(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update seek range and progress
|
||||||
|
function _updateSeekDisplay(time) {
|
||||||
|
// Default to 0
|
||||||
|
if (typeof time !== 'number') {
|
||||||
|
time = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var duration = _getDuration(),
|
||||||
|
value = _getPercentage(time, duration);
|
||||||
|
|
||||||
|
// Update progress
|
||||||
|
if (plyr.progress && plyr.progress.played) {
|
||||||
|
plyr.progress.played.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update seek range input
|
||||||
|
if (plyr.buttons && plyr.buttons.seek) {
|
||||||
|
plyr.buttons.seek.value = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update hover tooltip for seeking
|
// Update hover tooltip for seeking
|
||||||
function _updateSeekTooltip(event) {
|
function _updateSeekTooltip(event) {
|
||||||
|
var duration = _getDuration();
|
||||||
|
|
||||||
// Bail if setting not true
|
// Bail if setting not true
|
||||||
if (!config.tooltips.seek || plyr.browser.touch || !plyr.progress.container) {
|
if (!config.tooltips.seek || !plyr.progress.container || duration === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2166,7 +2438,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Display the time a click would seek to
|
// Display the time a click would seek to
|
||||||
_updateTimeDisplay(((_getDuration() / 100) * percent), plyr.progress.tooltip);
|
_updateTimeDisplay(((duration / 100) * percent), plyr.progress.tooltip);
|
||||||
|
|
||||||
// Set position
|
// Set position
|
||||||
plyr.progress.tooltip.style.left = percent + "%";
|
plyr.progress.tooltip.style.left = percent + "%";
|
||||||
@ -2207,7 +2479,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
show = false;
|
show = !_hasClass(plyr.container, config.classes.hideControls);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2218,14 +2490,19 @@
|
|||||||
if (show || plyr.media.paused) {
|
if (show || plyr.media.paused) {
|
||||||
_toggleClass(plyr.container, config.classes.hideControls, false);
|
_toggleClass(plyr.container, config.classes.hideControls, false);
|
||||||
|
|
||||||
// Always show controls when paused
|
// Always show controls when paused or if touch
|
||||||
if (plyr.media.paused) {
|
if (plyr.media.paused) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delay for hiding on touch
|
||||||
|
if (plyr.browser.touch) {
|
||||||
|
delay = 3000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If toggle is false or if we're playing (regardless of toggle), then
|
// If toggle is false or if we're playing (regardless of toggle),
|
||||||
// set the timer to hide the controls
|
// then set the timer to hide the controls
|
||||||
if (!show || !plyr.media.paused) {
|
if (!show || !plyr.media.paused) {
|
||||||
plyr.timers.hover = window.setTimeout(function() {
|
plyr.timers.hover = window.setTimeout(function() {
|
||||||
// If the mouse is over the controls (and not entering fullscreen), bail
|
// If the mouse is over the controls (and not entering fullscreen), bail
|
||||||
@ -2259,6 +2536,12 @@
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'soundcloud':
|
||||||
|
plyr.embed.getCurrentSound(function(object) {
|
||||||
|
url = object.permalink_url;
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
url = plyr.media.currentSrc;
|
url = plyr.media.currentSrc;
|
||||||
break;
|
break;
|
||||||
@ -2278,13 +2561,14 @@
|
|||||||
// Pause playback
|
// Pause playback
|
||||||
_pause();
|
_pause();
|
||||||
|
|
||||||
// Set seek input to 0
|
// Update seek range and progress
|
||||||
if (plyr.buttons && plyr.buttons.seek) {
|
_updateSeekDisplay();
|
||||||
plyr.buttons.seek.value = 0;
|
|
||||||
}
|
// Reset buffer progress
|
||||||
if (plyr.progress && plyr.progress.played) {
|
_setProgress();
|
||||||
plyr.progress.played.value = 0;
|
|
||||||
}
|
// Cancel current network requests
|
||||||
|
_cancelRequests();
|
||||||
|
|
||||||
// Clean up YouTube stuff
|
// Clean up YouTube stuff
|
||||||
if (plyr.type === 'youtube') {
|
if (plyr.type === 'youtube') {
|
||||||
@ -2295,6 +2579,7 @@
|
|||||||
window.clearInterval(plyr.timer.buffering);
|
window.clearInterval(plyr.timer.buffering);
|
||||||
window.clearInterval(plyr.timer.playing);
|
window.clearInterval(plyr.timer.playing);
|
||||||
}
|
}
|
||||||
|
// HTML5 Video
|
||||||
else if (plyr.type === 'video' && plyr.videoContainer) {
|
else if (plyr.type === 'video' && plyr.videoContainer) {
|
||||||
// Remove video wrapper
|
// Remove video wrapper
|
||||||
_remove(plyr.videoContainer);
|
_remove(plyr.videoContainer);
|
||||||
@ -2303,9 +2588,6 @@
|
|||||||
// Remove embed object
|
// Remove embed object
|
||||||
plyr.embed = null;
|
plyr.embed = null;
|
||||||
|
|
||||||
// Cancel current network requests
|
|
||||||
_cancelRequests();
|
|
||||||
|
|
||||||
// Remove the old media
|
// Remove the old media
|
||||||
_remove(plyr.media);
|
_remove(plyr.media);
|
||||||
|
|
||||||
@ -2324,7 +2606,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for support
|
// Check for support
|
||||||
plyr.supported = api.supported(plyr.type);
|
plyr.supported = supported(plyr.type);
|
||||||
|
|
||||||
// Create new markup
|
// Create new markup
|
||||||
switch(plyr.type) {
|
switch(plyr.type) {
|
||||||
@ -2338,6 +2620,7 @@
|
|||||||
|
|
||||||
case 'youtube':
|
case 'youtube':
|
||||||
case 'vimeo':
|
case 'vimeo':
|
||||||
|
case 'soundcloud':
|
||||||
plyr.media = document.createElement('div');
|
plyr.media = document.createElement('div');
|
||||||
plyr.embedId = source.sources[0].src;
|
plyr.embedId = source.sources[0].src;
|
||||||
break;
|
break;
|
||||||
@ -2482,6 +2765,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_on(window, 'keyup', function(event) {
|
_on(window, 'keyup', function(event) {
|
||||||
var code = (event.keyCode ? event.keyCode : event.which);
|
var code = (event.keyCode ? event.keyCode : event.which);
|
||||||
|
|
||||||
@ -2553,6 +2837,21 @@
|
|||||||
// Focus in/out on controls
|
// Focus in/out on controls
|
||||||
_on(plyr.controls, 'focus blur', _toggleControls, true);
|
_on(plyr.controls, 'focus blur', _toggleControls, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Adjust volume on scroll
|
||||||
|
_on(plyr.volume.input, 'wheel', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
// Scroll down to decrease
|
||||||
|
if (event.deltaY < 0 || event.deltaX > 0) {
|
||||||
|
_decreaseVolume();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Scroll up to increase
|
||||||
|
if (event.deltaY > 0 || event.deltaX < 0) {
|
||||||
|
_increaseVolume();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Listen for media events
|
// Listen for media events
|
||||||
@ -2575,6 +2874,18 @@
|
|||||||
|
|
||||||
// Reset UI
|
// Reset UI
|
||||||
_checkPlaying();
|
_checkPlaying();
|
||||||
|
|
||||||
|
// Seek to 0
|
||||||
|
_seek(0);
|
||||||
|
|
||||||
|
// Reset duration display
|
||||||
|
_displayDuration();
|
||||||
|
|
||||||
|
// Show poster on end
|
||||||
|
if(plyr.type === 'video' && config.showPosterOnEnd) {
|
||||||
|
// Re-load media
|
||||||
|
plyr.media.load();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check for buffer progress
|
// Check for buffer progress
|
||||||
@ -2604,6 +2915,11 @@
|
|||||||
|
|
||||||
// On click play, pause ore restart
|
// On click play, pause ore restart
|
||||||
_on(wrapper, 'click', function() {
|
_on(wrapper, 'click', function() {
|
||||||
|
if (plyr.browser.touch && !plyr.media.paused) {
|
||||||
|
_toggleControls(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (plyr.media.paused) {
|
if (plyr.media.paused) {
|
||||||
_play();
|
_play();
|
||||||
}
|
}
|
||||||
@ -2619,7 +2935,7 @@
|
|||||||
|
|
||||||
// Proxy events to container
|
// Proxy events to container
|
||||||
_on(plyr.media, config.events.join(' '), function(event) {
|
_on(plyr.media, config.events.join(' '), function(event) {
|
||||||
_triggerEvent(plyr.container, event.type);
|
_triggerEvent(plyr.container, event.type, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2630,15 +2946,18 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set empty src attribute
|
|
||||||
plyr.media.setAttribute('src', '');
|
|
||||||
|
|
||||||
// Remove child sources
|
// Remove child sources
|
||||||
var sources = plyr.media.querySelectorAll('source');
|
var sources = plyr.media.querySelectorAll('source');
|
||||||
for (var i = 0; i < sources.length; i++) {
|
for (var i = 0; i < sources.length; i++) {
|
||||||
_remove(sources[i]);
|
_remove(sources[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set blank video src attribute
|
||||||
|
// This is to prevent a MEDIA_ERR_SRC_NOT_SUPPORTED error
|
||||||
|
// Small mp4: https://github.com/mathiasbynens/small/blob/master/mp4.mp4
|
||||||
|
// Info: http://stackoverflow.com/questions/32231579/how-to-properly-dispose-of-an-html5-video-and-close-socket-or-connection
|
||||||
|
plyr.media.setAttribute('src', 'data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAGm1kYXQAAAGzABAHAAABthBgUYI9t+8AAAMNbW9vdgAAAGxtdmhkAAAAAMXMvvrFzL76AAAD6AAAACoAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAABhpb2RzAAAAABCAgIAHAE/////+/wAAAiF0cmFrAAAAXHRraGQAAAAPxcy++sXMvvoAAAABAAAAAAAAACoAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAgAAAAIAAAAAAG9bWRpYQAAACBtZGhkAAAAAMXMvvrFzL76AAAAGAAAAAEVxwAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAABaG1pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAShzdGJsAAAAxHN0c2QAAAAAAAAAAQAAALRtcDR2AAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAgACABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAAXmVzZHMAAAAAA4CAgE0AAQAEgICAPyARAAAAAAMNQAAAAAAFgICALQAAAbABAAABtYkTAAABAAAAASAAxI2IAMUARAEUQwAAAbJMYXZjNTMuMzUuMAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAABAAAAAQAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAASAAAAAQAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYHVkdGEAAABYbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAraWxzdAAAACOpdG9vAAAAG2RhdGEAAAABAAAAAExhdmY1My4yMS4x');
|
||||||
|
|
||||||
// Load the new empty source
|
// Load the new empty source
|
||||||
// This will cancel existing requests
|
// This will cancel existing requests
|
||||||
// See https://github.com/Selz/plyr/issues/174
|
// See https://github.com/Selz/plyr/issues/174
|
||||||
@ -2738,7 +3057,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for support
|
// Check for support
|
||||||
plyr.supported = api.supported(plyr.type);
|
plyr.supported = supported(plyr.type);
|
||||||
|
|
||||||
// Add style hook
|
// Add style hook
|
||||||
_toggleStyleHook();
|
_toggleStyleHook();
|
||||||
@ -2868,6 +3187,7 @@
|
|||||||
toggleMute: _toggleMute,
|
toggleMute: _toggleMute,
|
||||||
toggleCaptions: _toggleCaptions,
|
toggleCaptions: _toggleCaptions,
|
||||||
toggleFullscreen: _toggleFullscreen,
|
toggleFullscreen: _toggleFullscreen,
|
||||||
|
toggleControls: _toggleControls,
|
||||||
isFullscreen: function() { return plyr.isFullscreen || false; },
|
isFullscreen: function() { return plyr.isFullscreen || false; },
|
||||||
support: function(mimeType) { return _supportMime(plyr, mimeType); },
|
support: function(mimeType) { return _supportMime(plyr, mimeType); },
|
||||||
destroy: _destroy,
|
destroy: _destroy,
|
||||||
@ -2875,8 +3195,31 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load a sprite
|
||||||
|
function loadSprite(url) {
|
||||||
|
var x = new XMLHttpRequest();
|
||||||
|
|
||||||
|
// Check for CORS support
|
||||||
|
if ('withCredentials' in x) {
|
||||||
|
x.open('GET', url, true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Inject hidden div with sprite on load
|
||||||
|
x.onload = function() {
|
||||||
|
var c = document.createElement('div');
|
||||||
|
c.setAttribute('hidden', '');
|
||||||
|
c.innerHTML = x.responseText;
|
||||||
|
document.body.insertBefore(c, document.body.childNodes[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
x.send();
|
||||||
|
}
|
||||||
|
|
||||||
// Check for support
|
// Check for support
|
||||||
api.supported = function(type) {
|
function supported(type) {
|
||||||
var browser = _browserSniff(),
|
var browser = _browserSniff(),
|
||||||
oldIE = (browser.name === 'IE' && browser.version <= 9),
|
oldIE = (browser.name === 'IE' && browser.version <= 9),
|
||||||
iPhone = /iPhone|iPod/i.test(navigator.userAgent),
|
iPhone = /iPhone|iPod/i.test(navigator.userAgent),
|
||||||
@ -2897,6 +3240,7 @@
|
|||||||
|
|
||||||
case 'vimeo':
|
case 'vimeo':
|
||||||
case 'youtube':
|
case 'youtube':
|
||||||
|
case 'soundcloud':
|
||||||
basic = true;
|
basic = true;
|
||||||
full = (!oldIE && !iPhone);
|
full = (!oldIE && !iPhone);
|
||||||
break;
|
break;
|
||||||
@ -2910,10 +3254,10 @@
|
|||||||
basic: basic,
|
basic: basic,
|
||||||
full: full
|
full: full
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
// Expose setup function
|
// Setup function
|
||||||
api.setup = function(elements, options) {
|
function setup(elements, options) {
|
||||||
// Get the players
|
// Get the players
|
||||||
var instances = [];
|
var instances = [];
|
||||||
|
|
||||||
@ -2939,7 +3283,7 @@
|
|||||||
|
|
||||||
// Bail if disabled or no basic support
|
// Bail if disabled or no basic support
|
||||||
// You may want to disable certain UAs etc
|
// You may want to disable certain UAs etc
|
||||||
if (!api.supported().basic || !elements.length) {
|
if (!supported().basic || !elements.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2973,9 +3317,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return instances;
|
return instances;
|
||||||
};
|
}
|
||||||
|
|
||||||
return api;
|
return {
|
||||||
|
setup: setup,
|
||||||
|
supported: supported,
|
||||||
|
loadSprite: loadSprite
|
||||||
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Custom event polyfill
|
// Custom event polyfill
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
|
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
|
||||||
|
|
||||||
|
& when (@plyr-border-box = true) {
|
||||||
// border-box everything
|
// border-box everything
|
||||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||||
&,
|
&,
|
||||||
@ -29,11 +30,14 @@
|
|||||||
*::before {
|
*::before {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& when (@plyr-touch-action = true) {
|
||||||
// Fix 300ms delay
|
// Fix 300ms delay
|
||||||
a, button, input, label {
|
a, button, input, label {
|
||||||
touch-action: manipulation;
|
touch-action: manipulation;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Media elements
|
// Media elements
|
||||||
video,
|
video,
|
||||||
@ -76,9 +80,6 @@
|
|||||||
&::-moz-range-thumb {
|
&::-moz-range-thumb {
|
||||||
.plyr-range-thumb();
|
.plyr-range-thumb();
|
||||||
}
|
}
|
||||||
&::-moz-focus-outer {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Microsoft
|
// Microsoft
|
||||||
&::-ms-track {
|
&::-ms-track {
|
||||||
@ -141,13 +142,24 @@
|
|||||||
|
|
||||||
// Screen reader only elements
|
// Screen reader only elements
|
||||||
.plyr__sr-only {
|
.plyr__sr-only {
|
||||||
position: absolute !important;
|
|
||||||
clip: rect(1px, 1px, 1px, 1px);
|
clip: rect(1px, 1px, 1px, 1px);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
// !important is not always needed
|
||||||
|
& when (@plyr-sr-only-important = true) {
|
||||||
|
position: absolute !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
border: 0 !important;
|
border: 0 !important;
|
||||||
height: 1px !important;
|
height: 1px !important;
|
||||||
width: 1px !important;
|
width: 1px !important;
|
||||||
overflow: hidden;
|
}
|
||||||
|
& when (@plyr-sr-only-important = false) {
|
||||||
|
position: absolute;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
height: 1px;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Video
|
// Video
|
||||||
@ -201,17 +213,18 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: (@plyr-control-spacing * 2) (@plyr-control-spacing * 2) (@plyr-control-spacing * 8);
|
padding: (@plyr-control-spacing * 2);
|
||||||
color: #fff;
|
transform: translateY(-(@plyr-control-spacing * 4));
|
||||||
|
transition: transform .3s ease;
|
||||||
|
color: @plyr-captions-color;
|
||||||
font-size: @plyr-font-size-captions-base;
|
font-size: @plyr-font-size-captions-base;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
-webkit-font-smoothing: subpixel-antialiased;
|
|
||||||
|
|
||||||
span {
|
span {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: floor(@plyr-control-spacing / 3) @plyr-control-spacing;
|
padding: floor(@plyr-control-spacing / 3) @plyr-control-spacing;
|
||||||
background: fade(#000, 85%);
|
background: @plyr-captions-bg;
|
||||||
}
|
}
|
||||||
span:empty {
|
span:empty {
|
||||||
display: none;
|
display: none;
|
||||||
@ -227,9 +240,17 @@
|
|||||||
.plyr--fullscreen-active .plyr__captions {
|
.plyr--fullscreen-active .plyr__captions {
|
||||||
font-size: @plyr-font-size-captions-large;
|
font-size: @plyr-font-size-captions-large;
|
||||||
}
|
}
|
||||||
|
.plyr--hide-controls .plyr__captions {
|
||||||
|
transform: translateY(-(@plyr-control-spacing * 1.5));
|
||||||
|
}
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
// Hide native controls
|
||||||
|
.plyr ::-webkit-media-controls {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
// Playback controls
|
// Playback controls
|
||||||
.plyr__controls {
|
.plyr__controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -262,8 +283,9 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
overflow: visible; // IE11
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: (@plyr-control-spacing / 2);
|
padding: @plyr-control-padding;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
@ -272,8 +294,8 @@
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
width: 18px;
|
width: @plyr-control-icon-size;
|
||||||
height: 18px;
|
height: @plyr-control-icon-size;
|
||||||
display: block;
|
display: block;
|
||||||
fill: currentColor;
|
fill: currentColor;
|
||||||
}
|
}
|
||||||
@ -297,9 +319,6 @@
|
|||||||
.plyr__time {
|
.plyr__time {
|
||||||
margin-left: @plyr-control-spacing;
|
margin-left: @plyr-control-spacing;
|
||||||
}
|
}
|
||||||
button {
|
|
||||||
padding: (@plyr-control-spacing / 2) @plyr-control-spacing;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Hide controls
|
// Hide controls
|
||||||
@ -327,11 +346,6 @@
|
|||||||
color: @plyr-video-control-color-hover;
|
color: @plyr-video-control-color-hover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: @plyr-bp-screen-sm) {
|
|
||||||
padding-left: (@plyr-control-spacing * 1.5);
|
|
||||||
padding-right: (@plyr-control-spacing * 1.5);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Audio controls
|
// Audio controls
|
||||||
@ -355,6 +369,7 @@
|
|||||||
|
|
||||||
// Large play button (video only)
|
// Large play button (video only)
|
||||||
.plyr__play-large {
|
.plyr__play-large {
|
||||||
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@ -365,7 +380,7 @@
|
|||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
box-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%);
|
box-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%);
|
||||||
color: @plyr-video-control-color;
|
color: @plyr-video-control-color;
|
||||||
transition: opacity .3s ease, visibility .3s ease;
|
transition: all .3s ease;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -380,6 +395,9 @@
|
|||||||
outline: 1px dotted fade(@plyr-video-control-color, 50%);
|
outline: 1px dotted fade(@plyr-video-control-color, 50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.plyr .plyr__play-large {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.plyr--audio .plyr__play-large {
|
.plyr--audio .plyr__play-large {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -421,7 +439,6 @@
|
|||||||
// Tooltips
|
// Tooltips
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr__tooltip {
|
.plyr__tooltip {
|
||||||
visibility: hidden;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
@ -431,29 +448,26 @@
|
|||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
background: @plyr-tooltip-bg;
|
background: @plyr-tooltip-bg;
|
||||||
box-shadow: @plyr-tooltip-shadow;
|
|
||||||
border-radius: @plyr-tooltip-radius;
|
border-radius: @plyr-tooltip-radius;
|
||||||
|
|
||||||
color: @plyr-tooltip-color;
|
color: @plyr-tooltip-color;
|
||||||
font-size: @plyr-font-size-small;
|
font-size: @plyr-font-size-small;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
-webkit-font-smoothing: subpixel-antialiased;
|
|
||||||
|
|
||||||
transform: translate(-50%, 10px) scale(.8);
|
transform: translate(-50%, 10px) scale(.8);
|
||||||
transform-origin: 50% 100%;
|
transform-origin: 50% 100%;
|
||||||
transition: transform .2s .1s ease, opacity .2s .1s ease, visibility .3s ease;
|
transition: transform .2s .1s ease, opacity .2s .1s ease;
|
||||||
|
|
||||||
// Arrows
|
|
||||||
&::before {
|
&::before {
|
||||||
|
// Arrows
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
|
||||||
// The background triangle
|
// The background triangle
|
||||||
&::before {
|
|
||||||
bottom: -@plyr-tooltip-arrow-size;
|
bottom: -@plyr-tooltip-arrow-size;
|
||||||
border-right: @plyr-tooltip-arrow-size solid transparent;
|
border-right: @plyr-tooltip-arrow-size solid transparent;
|
||||||
border-top: @plyr-tooltip-arrow-size solid @plyr-tooltip-bg;
|
border-top: @plyr-tooltip-arrow-size solid @plyr-tooltip-bg;
|
||||||
@ -464,7 +478,6 @@
|
|||||||
.plyr button:hover .plyr__tooltip,
|
.plyr button:hover .plyr__tooltip,
|
||||||
.plyr button.tab-focus:focus .plyr__tooltip,
|
.plyr button.tab-focus:focus .plyr__tooltip,
|
||||||
.plyr__tooltip--visible {
|
.plyr__tooltip--visible {
|
||||||
visibility: visible;
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translate(-50%, 0) scale(1);
|
transform: translate(-50%, 0) scale(1);
|
||||||
}
|
}
|
||||||
@ -472,11 +485,46 @@
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// First tooltip
|
||||||
|
.plyr__controls button:first-child .plyr__tooltip {
|
||||||
|
left: 0;
|
||||||
|
transform: translate(0, 10px) scale(.8);
|
||||||
|
transform-origin: 0 100%;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
left: (@plyr-control-icon-size / 2) + @plyr-control-padding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Last tooltip
|
||||||
|
.plyr__controls button:last-child .plyr__tooltip {
|
||||||
|
right: 0;
|
||||||
|
transform: translate(0, 10px) scale(.8);
|
||||||
|
transform-origin: 100% 100%;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
left: auto;
|
||||||
|
right: (@plyr-control-icon-size / 2) + @plyr-control-padding;
|
||||||
|
transform: translateX(50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.plyr__controls button:first-child,
|
||||||
|
.plyr__controls button:last-child {
|
||||||
|
&:hover .plyr__tooltip,
|
||||||
|
&.tab-focus:focus .plyr__tooltip,
|
||||||
|
.plyr__tooltip--visible {
|
||||||
|
transform: translate(0, 0) scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Playback progress
|
// Playback progress
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
// <progress> element
|
// <progress> element
|
||||||
.plyr__progress {
|
.plyr__progress {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
display: none;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
input[type="range"] {
|
input[type="range"] {
|
||||||
@ -499,10 +547,13 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.plyr .plyr__progress {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.plyr__progress--buffer[value],
|
.plyr__progress--buffer,
|
||||||
.plyr__progress--played[value],
|
.plyr__progress--played,
|
||||||
.plyr__volume--display[value] {
|
.plyr__volume--display {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@ -532,8 +583,8 @@
|
|||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr__progress--played[value],
|
.plyr__progress--played,
|
||||||
.plyr__volume--display[value] {
|
.plyr__volume--display {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
color: @plyr-range-selected-bg;
|
color: @plyr-range-selected-bg;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
@ -544,18 +595,20 @@
|
|||||||
max-width: 99%;
|
max-width: 99%;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
&::-moz-progress-bar {
|
&::-moz-progress-bar {
|
||||||
min-width: @plyr-range-track-height;
|
min-width: @plyr-range-track-height;
|
||||||
max-width: 99%;
|
max-width: 99%;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
&::-ms-fill {
|
&::-ms-fill {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr__progress--buffer[value] {
|
.plyr__progress--buffer {
|
||||||
&::-webkit-progress-value {
|
&::-webkit-progress-value {
|
||||||
transition: width .2s ease;
|
transition: width .2s ease;
|
||||||
}
|
}
|
||||||
@ -566,18 +619,18 @@
|
|||||||
transition: width .2s ease;
|
transition: width .2s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr--video .plyr__progress--buffer[value],
|
.plyr--video .plyr__progress--buffer,
|
||||||
.plyr--video .plyr__volume--display[value] {
|
.plyr--video .plyr__volume--display {
|
||||||
background: @plyr-video-range-track-bg;
|
background: @plyr-video-range-track-bg;
|
||||||
}
|
}
|
||||||
.plyr--video .plyr__progress--buffer[value] {
|
.plyr--video .plyr__progress--buffer {
|
||||||
color: @plyr-video-progress-buffered-bg;
|
color: @plyr-video-progress-buffered-bg;
|
||||||
}
|
}
|
||||||
.plyr--audio .plyr__progress--buffer[value],
|
.plyr--audio .plyr__progress--buffer,
|
||||||
.plyr--audio .plyr__volume--display[value] {
|
.plyr--audio .plyr__volume--display {
|
||||||
background: @plyr-audio-range-track-bg;
|
background: @plyr-audio-range-track-bg;
|
||||||
}
|
}
|
||||||
.plyr--audio .plyr__progress--buffer[value] {
|
.plyr--audio .plyr__progress--buffer {
|
||||||
color: @plyr-audio-progress-buffered-bg;
|
color: @plyr-audio-progress-buffered-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -611,7 +664,6 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
font-size: @plyr-font-size-small;
|
font-size: @plyr-font-size-small;
|
||||||
line-height: .95;
|
line-height: .95;
|
||||||
-webkit-font-smoothing: subpixel-antialiased;
|
|
||||||
}
|
}
|
||||||
// Media duration hidden on small screens
|
// Media duration hidden on small screens
|
||||||
.plyr__time + .plyr__time {
|
.plyr__time + .plyr__time {
|
||||||
@ -630,8 +682,11 @@
|
|||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr .plyr__volume {
|
.plyr__volume {
|
||||||
display: none;
|
display: none;
|
||||||
|
}
|
||||||
|
.plyr .plyr__volume {
|
||||||
|
flex: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
input[type="range"] {
|
input[type="range"] {
|
||||||
@ -683,4 +738,11 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vimeo requires some different styling
|
||||||
|
&.plyr--vimeo .plyr__video-wrapper {
|
||||||
|
height: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
// https://github.com/selz/plyr
|
// https://github.com/selz/plyr
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
// Settings
|
||||||
|
@plyr-border-box: true;
|
||||||
|
@plyr-touch-action: true;
|
||||||
|
@plyr-sr-only-important: true;
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
@plyr-color-main: #3498db;
|
@plyr-color-main: #3498db;
|
||||||
|
|
||||||
@ -11,12 +16,16 @@
|
|||||||
@plyr-font-size-base: 16px;
|
@plyr-font-size-base: 16px;
|
||||||
|
|
||||||
// Captions
|
// Captions
|
||||||
@plyr-font-size-captions-base: ceil(@plyr-font-size-base * 1.25);
|
@plyr-captions-bg: fade(#000, 70%);
|
||||||
|
@plyr-captions-color: #fff;
|
||||||
|
@plyr-font-size-captions-base: @plyr-font-size-base;
|
||||||
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
|
@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
|
||||||
@plyr-font-size-captions-large: (@plyr-font-size-base * 2);
|
@plyr-font-size-captions-large: (@plyr-font-size-base * 2);
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
|
@plyr-control-icon-size: 18px;
|
||||||
@plyr-control-spacing: 10px;
|
@plyr-control-spacing: 10px;
|
||||||
|
@plyr-control-padding: (@plyr-control-spacing * .7);
|
||||||
@plyr-video-controls-bg: #000;
|
@plyr-video-controls-bg: #000;
|
||||||
@plyr-video-control-color: #fff;
|
@plyr-video-control-color: #fff;
|
||||||
@plyr-video-control-color-hover: #fff;
|
@plyr-video-control-color-hover: #fff;
|
||||||
@ -29,12 +38,8 @@
|
|||||||
@plyr-audio-control-bg-hover: @plyr-color-main;
|
@plyr-audio-control-bg-hover: @plyr-color-main;
|
||||||
|
|
||||||
// Tooltips
|
// Tooltips
|
||||||
@plyr-tooltip-bg: @plyr-video-controls-bg;
|
@plyr-tooltip-bg: fade(#000, 70%);
|
||||||
@plyr-tooltip-border-color: fade(darken(@plyr-video-controls-bg, 75%), 10%);
|
@plyr-tooltip-color: #fff;
|
||||||
@plyr-tooltip-arrow-border-color: fade(darken(@plyr-video-controls-bg, 75%), 20%);
|
|
||||||
@plyr-tooltip-border-width: 1px;
|
|
||||||
@plyr-tooltip-shadow: 0 0 5px @plyr-tooltip-border-color, 0 0 0 @plyr-tooltip-border-width @plyr-tooltip-border-color;
|
|
||||||
@plyr-tooltip-color: @plyr-video-control-color;
|
|
||||||
@plyr-tooltip-padding: (@plyr-control-spacing / 2);
|
@plyr-tooltip-padding: (@plyr-control-spacing / 2);
|
||||||
@plyr-tooltip-arrow-size: 4px;
|
@plyr-tooltip-arrow-size: 4px;
|
||||||
@plyr-tooltip-radius: 3px;
|
@plyr-tooltip-radius: 3px;
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
|
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
|
||||||
|
|
||||||
|
@if $plyr-border-box == true {
|
||||||
// border-box everything
|
// border-box everything
|
||||||
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
// http://paulirish.com/2012/box-sizing-border-box-ftw/
|
||||||
&,
|
&,
|
||||||
@ -29,11 +30,14 @@
|
|||||||
*::before {
|
*::before {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@if $plyr-touch-action == true {
|
||||||
// Fix 300ms delay
|
// Fix 300ms delay
|
||||||
a, button, input, label {
|
a, button, input, label {
|
||||||
touch-action: manipulation;
|
touch-action: manipulation;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Media elements
|
// Media elements
|
||||||
video,
|
video,
|
||||||
@ -76,9 +80,6 @@
|
|||||||
&::-moz-range-thumb {
|
&::-moz-range-thumb {
|
||||||
@include plyr-range-thumb();
|
@include plyr-range-thumb();
|
||||||
}
|
}
|
||||||
&::-moz-focus-outer {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Microsoft
|
// Microsoft
|
||||||
&::-ms-track {
|
&::-ms-track {
|
||||||
@ -141,13 +142,23 @@
|
|||||||
|
|
||||||
// Screen reader only elements
|
// Screen reader only elements
|
||||||
.plyr__sr-only {
|
.plyr__sr-only {
|
||||||
position: absolute !important;
|
|
||||||
clip: rect(1px, 1px, 1px, 1px);
|
clip: rect(1px, 1px, 1px, 1px);
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
// !important is not always needed
|
||||||
|
@if $plyr-sr-only-important == true {
|
||||||
|
position: absolute !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
border: 0 !important;
|
border: 0 !important;
|
||||||
height: 1px !important;
|
height: 1px !important;
|
||||||
width: 1px !important;
|
width: 1px !important;
|
||||||
overflow: hidden;
|
} @else {
|
||||||
|
position: absolute;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
height: 1px;
|
||||||
|
width: 1px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Video
|
// Video
|
||||||
@ -201,17 +212,18 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: ($plyr-control-spacing * 2) ($plyr-control-spacing * 2) ($plyr-control-spacing * 8);
|
padding: ($plyr-control-spacing * 2);
|
||||||
color: #fff;
|
transform: translateY(-($plyr-control-spacing * 6));
|
||||||
|
transition: transform .3s ease;
|
||||||
|
color: $plyr-captions-color;
|
||||||
font-size: $plyr-font-size-captions-base;
|
font-size: $plyr-font-size-captions-base;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
-webkit-font-smoothing: subpixel-antialiased;
|
|
||||||
|
|
||||||
span {
|
span {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
padding: floor($plyr-control-spacing / 3) $plyr-control-spacing;
|
padding: floor($plyr-control-spacing / 3) $plyr-control-spacing;
|
||||||
background: transparentize(#000, .15);
|
background: $plyr-captions-bg;
|
||||||
}
|
}
|
||||||
span:empty {
|
span:empty {
|
||||||
display: none;
|
display: none;
|
||||||
@ -227,9 +239,17 @@
|
|||||||
.plyr--fullscreen-active .plyr__captions {
|
.plyr--fullscreen-active .plyr__captions {
|
||||||
font-size: $plyr-font-size-captions-large;
|
font-size: $plyr-font-size-captions-large;
|
||||||
}
|
}
|
||||||
|
.plyr--hide-controls .plyr__captions {
|
||||||
|
transform: translateY(-($plyr-control-spacing * 2));
|
||||||
|
}
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
// Hide native controls
|
||||||
|
.plyr ::-webkit-media-controls {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
// Playback controls
|
// Playback controls
|
||||||
.plyr__controls {
|
.plyr__controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -262,8 +282,9 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
overflow: visible; // IE11
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
padding: ($plyr-control-spacing / 2);
|
padding: ($plyr-control-spacing * .7);
|
||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
@ -297,9 +318,6 @@
|
|||||||
.plyr__time {
|
.plyr__time {
|
||||||
margin-left: $plyr-control-spacing;
|
margin-left: $plyr-control-spacing;
|
||||||
}
|
}
|
||||||
button {
|
|
||||||
padding: ($plyr-control-spacing / 2) $plyr-control-spacing;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Hide controls
|
// Hide controls
|
||||||
@ -327,11 +345,6 @@
|
|||||||
color: $plyr-video-control-color-hover;
|
color: $plyr-video-control-color-hover;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: $plyr-bp-screen-sm) {
|
|
||||||
padding-left: ($plyr-control-spacing * 1.5);
|
|
||||||
padding-right: ($plyr-control-spacing * 1.5);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Audio controls
|
// Audio controls
|
||||||
@ -355,6 +368,7 @@
|
|||||||
|
|
||||||
// Large play button (video only)
|
// Large play button (video only)
|
||||||
.plyr__play-large {
|
.plyr__play-large {
|
||||||
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@ -365,7 +379,7 @@
|
|||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
box-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85);
|
box-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85);
|
||||||
color: $plyr-video-control-color;
|
color: $plyr-video-control-color;
|
||||||
transition: opacity .3s ease, visibility .3s ease;
|
transition: all .3s ease;
|
||||||
|
|
||||||
svg {
|
svg {
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -380,6 +394,9 @@
|
|||||||
outline: 1px dotted transparentize($plyr-video-control-color, .5);
|
outline: 1px dotted transparentize($plyr-video-control-color, .5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.plyr .plyr__play-large {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.plyr--audio .plyr__play-large {
|
.plyr--audio .plyr__play-large {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -421,7 +438,6 @@
|
|||||||
// Tooltips
|
// Tooltips
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr__tooltip {
|
.plyr__tooltip {
|
||||||
visibility: hidden;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
bottom: 100%;
|
bottom: 100%;
|
||||||
@ -431,29 +447,26 @@
|
|||||||
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
background: $plyr-tooltip-bg;
|
background: $plyr-tooltip-bg;
|
||||||
box-shadow: $plyr-tooltip-shadow;
|
|
||||||
border-radius: $plyr-tooltip-radius;
|
border-radius: $plyr-tooltip-radius;
|
||||||
|
|
||||||
color: $plyr-tooltip-color;
|
color: $plyr-tooltip-color;
|
||||||
font-size: $plyr-font-size-small;
|
font-size: $plyr-font-size-small;
|
||||||
line-height: 1.3;
|
line-height: 1.3;
|
||||||
-webkit-font-smoothing: subpixel-antialiased;
|
|
||||||
|
|
||||||
transform: translate(-50%, 10px) scale(.8);
|
transform: translate(-50%, 10px) scale(.8);
|
||||||
transform-origin: 50% 100%;
|
transform-origin: 50% 100%;
|
||||||
transition: transform .2s .1s ease, opacity .2s .1s ease, visibility .3s ease;
|
transition: transform .2s .1s ease, opacity .2s .1s ease;
|
||||||
|
|
||||||
// Arrows
|
|
||||||
&::before {
|
&::before {
|
||||||
|
// Arrows
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
}
|
|
||||||
// The background triangle
|
// The background triangle
|
||||||
&::before {
|
|
||||||
bottom: -$plyr-tooltip-arrow-size;
|
bottom: -$plyr-tooltip-arrow-size;
|
||||||
border-right: $plyr-tooltip-arrow-size solid transparent;
|
border-right: $plyr-tooltip-arrow-size solid transparent;
|
||||||
border-top: $plyr-tooltip-arrow-size solid $plyr-tooltip-bg;
|
border-top: $plyr-tooltip-arrow-size solid $plyr-tooltip-bg;
|
||||||
@ -464,7 +477,6 @@
|
|||||||
.plyr button:hover .plyr__tooltip,
|
.plyr button:hover .plyr__tooltip,
|
||||||
.plyr button.tab-focus:focus .plyr__tooltip,
|
.plyr button.tab-focus:focus .plyr__tooltip,
|
||||||
.plyr__tooltip--visible {
|
.plyr__tooltip--visible {
|
||||||
visibility: visible;
|
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translate(-50%, 0) scale(1);
|
transform: translate(-50%, 0) scale(1);
|
||||||
}
|
}
|
||||||
@ -472,10 +484,45 @@
|
|||||||
z-index: 3;
|
z-index: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// First tooltip
|
||||||
|
.plyr__controls button:first-child .plyr__tooltip {
|
||||||
|
$tooltip-arrow-offset: ;
|
||||||
|
left: 0;
|
||||||
|
transform: translate(0, 10px) scale(.8);
|
||||||
|
transform-origin: 0 100%;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
left: ($plyr-control-icon-size / 2) + $plyr-control-padding;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Last tooltip
|
||||||
|
.plyr__controls button:last-child .plyr__tooltip {
|
||||||
|
right: 0;
|
||||||
|
transform: translate(0, 10px) scale(.8);
|
||||||
|
transform-origin: 100% 100%;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
left: auto;
|
||||||
|
right: ($plyr-control-icon-size / 2) + $plyr-control-padding;
|
||||||
|
transform: translateX(50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.plyr__controls button:first-child,
|
||||||
|
.plyr__controls button:last-child {
|
||||||
|
&:hover .plyr__tooltip,
|
||||||
|
&.tab-focus:focus .plyr__tooltip,
|
||||||
|
.plyr__tooltip--visible {
|
||||||
|
transform: translate(0, 0) scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Playback progress
|
// Playback progress
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
// <progress> element
|
// <progress> element
|
||||||
.plyr__progress {
|
.plyr__progress {
|
||||||
|
display: none;
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
@ -499,10 +546,13 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.plyr .plyr__progress {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.plyr__progress--buffer[value],
|
.plyr__progress--buffer,
|
||||||
.plyr__progress--played[value],
|
.plyr__progress--played,
|
||||||
.plyr__volume--display[value] {
|
.plyr__volume--display {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@ -532,8 +582,8 @@
|
|||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr__progress--played[value],
|
.plyr__progress--played,
|
||||||
.plyr__volume--display[value] {
|
.plyr__volume--display {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
color: $plyr-range-selected-bg;
|
color: $plyr-range-selected-bg;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
@ -544,18 +594,20 @@
|
|||||||
max-width: 99%;
|
max-width: 99%;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
&::-moz-progress-bar {
|
&::-moz-progress-bar {
|
||||||
min-width: $plyr-range-track-height;
|
min-width: $plyr-range-track-height;
|
||||||
max-width: 99%;
|
max-width: 99%;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
&::-ms-fill {
|
&::-ms-fill {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr__progress--buffer[value] {
|
.plyr__progress--buffer {
|
||||||
&::-webkit-progress-value {
|
&::-webkit-progress-value {
|
||||||
transition: width .2s ease;
|
transition: width .2s ease;
|
||||||
}
|
}
|
||||||
@ -566,18 +618,18 @@
|
|||||||
transition: width .2s ease;
|
transition: width .2s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.plyr--video .plyr__progress--buffer[value],
|
.plyr--video .plyr__progress--buffer,
|
||||||
.plyr--video .plyr__volume--display[value] {
|
.plyr--video .plyr__volume--display {
|
||||||
background: $plyr-video-range-track-bg;
|
background: $plyr-video-range-track-bg;
|
||||||
}
|
}
|
||||||
.plyr--video .plyr__progress--buffer[value] {
|
.plyr--video .plyr__progress--buffer {
|
||||||
color: $plyr-video-progress-buffered-bg;
|
color: $plyr-video-progress-buffered-bg;
|
||||||
}
|
}
|
||||||
.plyr--audio .plyr__progress--buffer[value],
|
.plyr--audio .plyr__progress--buffer,
|
||||||
.plyr--audio .plyr__volume--display[value] {
|
.plyr--audio .plyr__volume--display {
|
||||||
background: $plyr-audio-range-track-bg;
|
background: $plyr-audio-range-track-bg;
|
||||||
}
|
}
|
||||||
.plyr--audio .plyr__progress--buffer[value] {
|
.plyr--audio .plyr__progress--buffer {
|
||||||
color: $plyr-audio-progress-buffered-bg;
|
color: $plyr-audio-progress-buffered-bg;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -611,7 +663,6 @@
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
font-size: $plyr-font-size-small;
|
font-size: $plyr-font-size-small;
|
||||||
line-height: .95;
|
line-height: .95;
|
||||||
-webkit-font-smoothing: subpixel-antialiased;
|
|
||||||
}
|
}
|
||||||
// Media duration hidden on small screens
|
// Media duration hidden on small screens
|
||||||
.plyr__time + .plyr__time {
|
.plyr__time + .plyr__time {
|
||||||
@ -630,8 +681,11 @@
|
|||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
.plyr .plyr__volume {
|
.plyr__volume {
|
||||||
display: none;
|
display: none;
|
||||||
|
}
|
||||||
|
.plyr .plyr__volume {
|
||||||
|
flex: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
input[type="range"] {
|
input[type="range"] {
|
||||||
@ -683,4 +737,11 @@
|
|||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Vimeo requires some different styling
|
||||||
|
&.plyr--vimeo .plyr__video-wrapper {
|
||||||
|
height: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,11 @@
|
|||||||
// https://robots.thoughtbot.com/sass-default
|
// https://robots.thoughtbot.com/sass-default
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
// Settings
|
||||||
|
$plyr-border-box: true !default;
|
||||||
|
$plyr-touch-action: true !default;
|
||||||
|
$plyr-sr-only-important: true !default;
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
$plyr-color-main: #3498db !default;
|
$plyr-color-main: #3498db !default;
|
||||||
|
|
||||||
@ -12,12 +17,16 @@ $plyr-font-size-small: 14px !default;
|
|||||||
$plyr-font-size-base: 16px !default;
|
$plyr-font-size-base: 16px !default;
|
||||||
|
|
||||||
// Captions
|
// Captions
|
||||||
$plyr-font-size-captions-base: ceil($plyr-font-size-base * 1.25) !default;
|
$plyr-captions-bg: transparentize(#000, .3) !default;
|
||||||
|
$plyr-captions-color: #fff !default;
|
||||||
|
$plyr-font-size-captions-base: $plyr-font-size-base !default;
|
||||||
$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
|
$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
|
||||||
$plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default;
|
$plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default;
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
|
$plyr-control-icon-size: 18px !default;
|
||||||
$plyr-control-spacing: 10px !default;
|
$plyr-control-spacing: 10px !default;
|
||||||
|
$plyr-control-padding: ($plyr-control-spacing * .7) !default;
|
||||||
$plyr-video-controls-bg: #000 !default;
|
$plyr-video-controls-bg: #000 !default;
|
||||||
$plyr-video-control-color: #fff !default;
|
$plyr-video-control-color: #fff !default;
|
||||||
$plyr-video-control-color-hover: #fff !default;
|
$plyr-video-control-color-hover: #fff !default;
|
||||||
@ -30,12 +39,8 @@ $plyr-audio-control-color-hover: #fff !default;
|
|||||||
$plyr-audio-control-bg-hover: $plyr-color-main;
|
$plyr-audio-control-bg-hover: $plyr-color-main;
|
||||||
|
|
||||||
// Tooltips
|
// Tooltips
|
||||||
$plyr-tooltip-bg: $plyr-video-controls-bg !default;
|
$plyr-tooltip-bg: transparentize(#000, .3) !default;
|
||||||
$plyr-tooltip-border-color: transparentize(darken($plyr-video-controls-bg, 75%), .9) !default;
|
$plyr-tooltip-color: #fff !default;
|
||||||
$plyr-tooltip-arrow-border-color: transparentize(darken($plyr-video-controls-bg, 75%), .8) !default;
|
|
||||||
$plyr-tooltip-border-width: 1px !default;
|
|
||||||
$plyr-tooltip-shadow: 0 0 5px $plyr-tooltip-border-color, 0 0 0 $plyr-tooltip-border-width $plyr-tooltip-border-color !default;
|
|
||||||
$plyr-tooltip-color: $plyr-video-control-color !default;
|
|
||||||
$plyr-tooltip-padding: ($plyr-control-spacing / 2) !default;
|
$plyr-tooltip-padding: ($plyr-control-spacing / 2) !default;
|
||||||
$plyr-tooltip-arrow-size: 4px !default;
|
$plyr-tooltip-arrow-size: 4px !default;
|
||||||
$plyr-tooltip-radius: 3px !default;
|
$plyr-tooltip-radius: 3px !default;
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
|
||||||
<g>
|
|
||||||
<path d="M1,2 C0.448,2 0,2.448 0,3 L0,15 C0,15.552 0.448,16 1,16 L17,16 C17.552,16 18,15.552 18,15 L18,3 C18,2.448 17.552,2 17,2 L1,2 Z M2,14 L2,4 L16,4 L16,14 L2,14 L2,14 Z"></path>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 443 B |
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<g>
|
|
||||||
<path d="M1,2 C0.448,2 0,2.448 0,3 L0,15 C0,15.552 0.448,16 1,16 L17,16 C17.552,16 18,15.552 18,15 L18,3 C18,2.448 17.552,2 17,2 L1,2 Z M2,14 L2,4 L16,4 L16,14 L2,14 L2,14 Z"></path>
|
|
||||||
<rect x="3" y="11" width="3" height="2"></rect>
|
|
||||||
<rect x="12" y="11" width="3" height="2"></rect>
|
|
||||||
<rect x="7" y="11" width="4" height="2"></rect>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 557 B |
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<g transform="translate(9.000000, 9.000000) rotate(-180.000000) translate(-9.000000, -9.000000) translate(0.000000, 2.000000)">
|
|
||||||
<path d="M7.69999981,6.30000001 C7.00064659,5.62264405 6.3,6.3 6.3,6.3 L2,10.6 L2,6 L0,6 L0,13 C0,13.6 0.4,14 1,14 L8,14 L8,12 L3.4,12 L7.7,7.7 C7.7,7.7 8.39935303,6.97735597 7.69999981,6.30000001 Z"></path>
|
|
||||||
<path d="M11,14 L11,12 L16,12 L16,2 L2,2 L2,3 L0,3 L0,1 C0,0.4 0.4,0 1,0 L17,0 C17.6,0 18,0.4 18,1 L18,13 C18,13.6 17.6,14 17,14 L11,14 Z"></path>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 719 B |
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<g transform="translate(0.000000, 2.000000)">
|
|
||||||
<path d="M7.69999981,6.30000001 C7.00064659,5.62264405 6.3,6.3 6.3,6.3 L2,10.6 L2,6 L0,6 L0,13 C0,13.6 0.4,14 1,14 L8,14 L8,12 L3.4,12 L7.7,7.7 C7.7,7.7 8.39935303,6.97735597 7.69999981,6.30000001 Z"></path>
|
|
||||||
<path d="M11,14 L11,12 L16,12 L16,2 L2,2 L2,3 L0,3 L0,1 C0,0.4 0.4,0 1,0 L17,0 C17.6,0 18,0.4 18,1 L18,13 C18,13.6 17.6,14 17,14 L11,14 Z"></path>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 637 B |
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
||||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
|
||||||
<polygon points="7,6.4 0,1 0,15 7,9.6 7,15 16,8 7,1 "/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 534 B |
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<svg viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<g transform="translate(0.000000, 2.000000)">
|
|
||||||
<path d="M9.214,0 C9.103,0 8.989,0.032 8.88,0.101 L4.832,2.911 C4.749,2.969 4.65,3 4.549,3 L0.996,3 C0.446,3 1.33226763e-15,3.448 1.33226763e-15,4 L1.33226763e-15,10 C1.33226763e-15,10.552 0.446,11 0.996,11 L4.549,11 C4.651,11 4.749,11.031 4.832,11.089 L8.88,13.899 C8.989,13.968 9.103,14 9.214,14 C9.606,14 9.961,13.6 9.961,13.051 L9.961,0.95 C9.961,0.4 9.606,0.001 9.214,0.001 L9.214,0 Z M7.969,10.834 L5.582,9.177 C5.416,9.062 5.218,8.999 5.016,8.999 L2.491,8.999 C2.216,8.999 1.993,8.775 1.993,8.499 L1.993,5.499 C1.993,5.223 2.216,4.999 2.491,4.999 L5.016,4.999 C5.218,4.999 5.416,4.937 5.582,4.821 L7.969,3.164 L7.969,10.833 L7.969,10.834 Z"></path>
|
|
||||||
<path d="M14.934,6.799 C14.848,5.051 13.42,3.808 12.427,3.15 C11.957,2.838 11.333,3.028 11.102,3.558 L11.064,3.644 C10.876,4.075 11.019,4.583 11.4,4.838 C12.106,5.311 12.986,6.085 13.024,6.903 C13.056,7.579 12.471,8.371 11.361,9.173 C10.963,9.461 10.832,10.012 11.076,10.448 L11.118,10.523 C11.384,10.998 11.984,11.147 12.418,10.835 C14.158,9.584 15.004,8.229 14.934,6.798 L14.934,6.799 Z"></path>
|
|
||||||
<path d="M17.934,6.799 C17.848,5.051 16.42,3.808 15.427,3.15 C14.957,2.838 14.333,3.028 14.102,3.558 L14.064,3.644 C13.876,4.075 14.019,4.583 14.4,4.838 C15.106,5.311 15.986,6.085 16.024,6.903 C16.056,7.579 15.471,8.371 14.361,9.173 C13.963,9.461 13.832,10.012 14.076,10.448 L14.118,10.523 C14.384,10.998 14.984,11.147 15.418,10.835 C17.158,9.584 18.004,8.229 17.934,6.798 L17.934,6.799 Z" transform="translate(15.945467, 6.999165) rotate(-180.000000) translate(-15.945467, -6.999165) "></path>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 1.8 KiB |
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
||||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
|
||||||
<path d="M5,1H2C1.4,1,1,1.4,1,2v12c0,0.6,0.4,1,1,1h3c0.6,0,1-0.4,1-1V2C6,1.4,5.6,1,5,1z"/>
|
|
||||||
<path d="M14,1h-3c-0.6,0-1,0.4-1,1v12c0,0.6,0.4,1,1,1h3c0.6,0,1-0.4,1-1V2C15,1.4,14.6,1,14,1z"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 667 B |
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
||||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
|
||||||
<path d="M13.6,7.2l-10-7C2.9-0.3,2,0.2,2,1v14c0,0.8,0.9,1.3,1.6,0.8l10-7C14.1,8.4,14.1,7.6,13.6,7.2z"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 582 B |
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<svg viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
|
||||||
<path d="M7.7,1.2l0.7,6.4l2.1-2.1c1.9,1.9,1.9,5.1,0,7C9.6,13.5,8.3,14,7,14c-1.3,0-2.6-0.5-3.5-1.5
|
|
||||||
c-1.9-1.9-1.9-5.1,0-7c0.6-0.6,1.4-1.1,2.3-1.3L5.2,2.3C4,2.6,2.9,3.2,2,4.1c-2.7,2.7-2.7,7.1,0,9.9c1.3,1.3,3.1,2,4.9,2
|
|
||||||
c1.9,0,3.6-0.7,4.9-2c2.7-2.7,2.7-7.1,0-9.9l2.2-2.2L7.7,1.2z"/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 505 B |
@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
||||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
||||||
width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
|
|
||||||
<polygon points="9,1 0,8 9,15 9,9.6 16,15 16,1 9,6.4 "/>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 535 B |
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<svg viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
||||||
<path d="M10.214 2c-0.111 0-0.225 0.032-0.334 0.101l-4.048 2.81c-0.083 0.058-0.182 0.089-0.283 0.089h-3.553c-0.55 0-0.996 0.448-0.996 1v6c0 0.552 0.446 1 0.996 1h3.553c0.102 0 0.2 0.031 0.283 0.089l4.048 2.81c0.109 0.069 0.223 0.101 0.334 0.101 0.392 0 0.747-0.4 0.747-0.949v-12.101c0-0.55-0.355-0.949-0.747-0.949zM8.969 12.834l-2.387-1.657c-0.166-0.115-0.364-0.178-0.566-0.178h-2.525c-0.275 0-0.498-0.224-0.498-0.5v-3c0-0.276 0.223-0.5 0.498-0.5h2.525c0.202 0 0.4-0.062 0.566-0.178l2.387-1.657v7.669z"></path>
|
|
||||||
<path d="M16.934 8.799c-0.086-1.748-1.514-2.991-2.507-3.649-0.47-0.312-1.094-0.122-1.325 0.408l-0.038 0.086c-0.188 0.431-0.045 0.939 0.336 1.194 0.706 0.473 1.586 1.247 1.624 2.065 0.032 0.676-0.553 1.468-1.663 2.27-0.398 0.288-0.529 0.839-0.285 1.275l0.042 0.075c0.266 0.475 0.866 0.624 1.3 0.312 1.74-1.251 2.586-2.606 2.516-4.037z"></path>
|
|
||||||
</svg>
|
|
Before Width: | Height: | Size: 1020 B |
7
src/sprite/plyr-captions-off.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<!-- Generator: Sketch 3.7.2 (28276) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<g fill-rule="evenodd" fill-opacity="0.5">
|
||||||
|
<path d="M1,1 C0.4,1 0,1.4 0,2 L0,13 C0,13.6 0.4,14 1,14 L5.6,14 L8.3,16.7 C8.5,16.9 8.7,17 9,17 C9.3,17 9.5,16.9 9.7,16.7 L12.4,14 L17,14 C17.6,14 18,13.6 18,13 L18,2 C18,1.4 17.6,1 17,1 L1,1 Z M5.52,11.15 C7.51,11.15 8.53,9.83 8.8,8.74 L7.51,8.35 C7.32,9.01 6.73,9.8 5.52,9.8 C4.38,9.8 3.32,8.97 3.32,7.46 C3.32,5.85 4.44,5.09 5.5,5.09 C6.73,5.09 7.28,5.84 7.45,6.52 L8.75,6.11 C8.47,4.96 7.46,3.76 5.5,3.76 C3.6,3.76 1.89,5.2 1.89,7.46 C1.89,9.72 3.54,11.15 5.52,11.15 Z M13.09,11.15 C15.08,11.15 16.1,9.83 16.37,8.74 L15.08,8.35 C14.89,9.01 14.3,9.8 13.09,9.8 C11.95,9.8 10.89,8.97 10.89,7.46 C10.89,5.85 12.01,5.09 13.07,5.09 C14.3,5.09 14.85,5.84 15.02,6.52 L16.32,6.11 C16.04,4.96 15.03,3.76 13.07,3.76 C11.17,3.76 9.46,5.2 9.46,7.46 C9.46,9.72 11.11,11.15 13.09,11.15 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
7
src/sprite/plyr-captions-on.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<!-- Generator: Sketch 3.7.2 (28276) - http://www.bohemiancoding.com/sketch -->
|
||||||
|
<g fill-rule="evenodd">
|
||||||
|
<path d="M1,1 C0.4,1 0,1.4 0,2 L0,13 C0,13.6 0.4,14 1,14 L5.6,14 L8.3,16.7 C8.5,16.9 8.7,17 9,17 C9.3,17 9.5,16.9 9.7,16.7 L12.4,14 L17,14 C17.6,14 18,13.6 18,13 L18,2 C18,1.4 17.6,1 17,1 L1,1 Z M5.52,11.15 C7.51,11.15 8.53,9.83 8.8,8.74 L7.51,8.35 C7.32,9.01 6.73,9.8 5.52,9.8 C4.38,9.8 3.32,8.97 3.32,7.46 C3.32,5.85 4.44,5.09 5.5,5.09 C6.73,5.09 7.28,5.84 7.45,6.52 L8.75,6.11 C8.47,4.96 7.46,3.76 5.5,3.76 C3.6,3.76 1.89,5.2 1.89,7.46 C1.89,9.72 3.54,11.15 5.52,11.15 Z M13.09,11.15 C15.08,11.15 16.1,9.83 16.37,8.74 L15.08,8.35 C14.89,9.01 14.3,9.8 13.09,9.8 C11.95,9.8 10.89,8.97 10.89,7.46 C10.89,5.85 12.01,5.09 13.07,5.09 C14.3,5.09 14.85,5.84 15.02,6.52 L16.32,6.11 C16.04,4.96 15.03,3.76 13.07,3.76 C11.17,3.76 9.46,5.2 9.46,7.46 C9.46,9.72 11.11,11.15 13.09,11.15 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
7
src/sprite/plyr-enter-fullscreen.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<polygon points="10 3 13.6 3 9.6 7 11 8.4 15 4.4 15 8 17 8 17 1 10 1"></polygon>
|
||||||
|
<polygon points="7 9.6 3 13.6 3 10 1 10 1 17 8 17 8 15 4.4 15 8.4 11"></polygon>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 401 B |
7
src/sprite/plyr-exit-fullscreen.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<polygon points="1 12 4.6 12 0.6 16 2 17.4 6 13.4 6 17 8 17 8 10 1 10"></polygon>
|
||||||
|
<polygon points="16 0.6 12 4.6 12 1 10 1 10 8 17 8 17 6 13.4 6 17.4 2"></polygon>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 403 B |
6
src/sprite/plyr-fast-forward.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<polygon points="7.875 7.17142857 0 1 0 17 7.875 10.8285714 7.875 17 18 9 7.875 1"></polygon>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 325 B |
7
src/sprite/plyr-muted.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<polygon points="12.4 12.5 14.5 10.4 16.6 12.5 18 11.1 15.9 9 18 6.9 16.6 5.5 14.5 7.6 12.4 5.5 11 6.9 13.1 9 11 11.1"></polygon>
|
||||||
|
<path d="M3.78571429,6.00820648 L0.714285714,6.00820648 C0.285714286,6.00820648 0,6.30901277 0,6.76022222 L0,11.2723167 C0,11.7235261 0.285714286,12.0243324 0.714285714,12.0243324 L3.78571429,12.0243324 L7.85714286,15.8819922 C8.35714286,16.1827985 9,15.8819922 9,15.2803796 L9,2.75215925 C9,2.15054666 8.35714286,1.77453879 7.85714286,2.15054666 L3.78571429,6.00820648 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 750 B |
7
src/sprite/plyr-pause.svg
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<path d="M6,1 L3,1 C2.4,1 2,1.4 2,2 L2,16 C2,16.6 2.4,17 3,17 L6,17 C6.6,17 7,16.6 7,16 L7,2 C7,1.4 6.6,1 6,1 L6,1 Z"></path>
|
||||||
|
<path d="M12,1 C11.4,1 11,1.4 11,2 L11,16 C11,16.6 11.4,17 12,17 L15,17 C15.6,17 16,16.6 16,16 L16,2 C16,1.4 15.6,1 15,1 L12,1 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 503 B |
6
src/sprite/plyr-play.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<path d="M15.5615866,8.10002147 L3.87056367,0.225209313 C3.05219207,-0.33727727 2,0.225209313 2,1.12518784 L2,16.8748122 C2,17.7747907 3.05219207,18.3372773 3.87056367,17.7747907 L15.5615866,9.89997853 C16.1461378,9.44998927 16.1461378,8.55001073 15.5615866,8.10002147 L15.5615866,8.10002147 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 534 B |
6
src/sprite/plyr-restart.svg
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<path d="M9.7,1.2 L10.4,7.6 L12.5,5.5 C14.4,7.4 14.4,10.6 12.5,12.5 C11.6,13.5 10.3,14 9,14 C7.7,14 6.4,13.5 5.5,12.5 C3.6,10.6 3.6,7.4 5.5,5.5 C6.1,4.9 6.9,4.4 7.8,4.2 L7.2,2.3 C6,2.6 4.9,3.2 4,4.1 C1.3,6.8 1.3,11.2 4,14 C5.3,15.3 7.1,16 8.9,16 C10.8,16 12.5,15.3 13.8,14 C16.5,11.3 16.5,6.9 13.8,4.1 L16,1.9 L9.7,1.2 L9.7,1.2 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 570 B |
6
src/sprite/plyr-rewind.svg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<polygon points="10.125 1 0 9 10.125 17 10.125 10.8285714 18 17 18 1 10.125 7.17142857"></polygon>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 330 B |
8
src/sprite/plyr-volume.svg
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g>
|
||||||
|
<path d="M15.5999996,3.3 C15.1999996,2.9 14.5999996,2.9 14.1999996,3.3 C13.7999996,3.7 13.7999996,4.3 14.1999996,4.7 C15.3999996,5.9 15.9999996,7.4 15.9999996,9 C15.9999996,10.6 15.3999996,12.1 14.1999996,13.3 C13.7999996,13.7 13.7999996,14.3 14.1999996,14.7 C14.3999996,14.9 14.6999996,15 14.8999996,15 C15.1999996,15 15.3999996,14.9 15.5999996,14.7 C17.0999996,13.2 17.9999996,11.2 17.9999996,9 C17.9999996,6.8 17.0999996,4.8 15.5999996,3.3 L15.5999996,3.3 Z"></path>
|
||||||
|
<path d="M11.2819745,5.28197449 C10.9060085,5.65794047 10.9060085,6.22188944 11.2819745,6.59785542 C12.0171538,7.33303477 12.2772954,8.05605449 12.2772954,9.00000021 C12.2772954,9.93588462 11.851678,10.9172014 11.2819745,11.4869049 C10.9060085,11.8628709 10.9060085,12.4268199 11.2819745,12.8027859 C11.4271642,12.9479755 11.9176724,13.0649528 12.2998149,12.9592565 C12.4124479,12.9281035 12.5156669,12.8776063 12.5978555,12.8027859 C13.773371,11.732654 14.1311161,10.1597914 14.1312523,9.00000021 C14.1312723,8.8299555 14.1286311,8.66015647 14.119665,8.4897429 C14.0674781,7.49784946 13.8010171,6.48513613 12.5978554,5.28197449 C12.2218894,4.9060085 11.6579405,4.9060085 11.2819745,5.28197449 Z"></path>
|
||||||
|
<path d="M3.78571429,6.00820648 L0.714285714,6.00820648 C0.285714286,6.00820648 0,6.30901277 0,6.76022222 L0,11.2723167 C0,11.7235261 0.285714286,12.0243324 0.714285714,12.0243324 L3.78571429,12.0243324 L7.85714286,15.8819922 C8.35714286,16.1827985 9,15.8819922 9,15.2803796 L9,2.75215925 C9,2.15054666 8.35714286,1.77453879 7.85714286,2.15054666 L3.78571429,6.00820648 Z"></path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.8 KiB |