Compare commits

...

137 Commits

Author SHA1 Message Date
032d73408f CDN URL updates 2017-10-02 14:18:44 +11:00
3fe0c7c84b Update readme.md 2017-08-13 21:07:22 +10:00
6828bc00f8 Delete notes.md 2017-05-16 10:31:07 +10:00
e95c81cc5b Update bower.json 2017-05-16 10:17:57 +10:00
c0eee58732 Plugin versions 2017-05-16 10:14:01 +10:00
bcf88cd024 Vimeo demo bug fix + repo move 2017-05-16 10:08:59 +10:00
4957e4d80c Version bump to 2.0.12 2017-03-25 10:58:41 +11:00
605f8a8249 Changelog update 2017-03-25 10:57:52 +11:00
7490a7e7f3 Merge pull request #468 from jronallo/captions-listener
allow for setting additional listener for captions
2017-03-25 10:51:54 +11:00
f32527feb4 Merge pull request #504 from ShimShamSam/master
Add blankUrl option to set the URL for blank.mp4
2017-03-25 10:50:55 +11:00
a971850d26 Update readme.md 2017-03-09 15:35:29 +11:00
382397407f Generated dist files 2017-02-12 00:15:21 -05:00
82809235b9 Documented the blankUrl option 2017-02-11 23:59:14 -05:00
7d5c507f16 Allow configuration of the blank.mp4 URL
This is useful for people behind firewalls who need to host a blank mp4 themselves.
2017-02-11 23:50:49 -05:00
bc139f16a7 Update readme.md 2017-02-10 11:21:20 +11:00
f6f3284dc5 Update readme.md 2017-02-10 11:19:37 +11:00
f4d2f1856f Update readme.md 2017-02-09 23:38:52 +11:00
871e19ed92 Update readme.md 2017-02-09 23:37:29 +11:00
72998c4c41 Merge pull request #437 from tv2/playground
Fixed typo
2017-01-10 20:21:01 +11:00
da48be495b Merge pull request #477 from iamrobert/patch-1
Update index.html
2017-01-10 14:51:40 +11:00
c843ed3460 Update index.html
Just missing the closing </li>
2017-01-10 11:50:26 +08:00
4232aa9ea4 Update issue_template.md 2017-01-10 09:47:46 +11:00
f6612fa78c Update issue_template.md 2017-01-10 09:45:41 +11:00
96ae866baa allow for setting additional listener for captions 2016-12-26 17:06:59 -05:00
a1d5bccac2 Fixed typo 2016-11-30 08:54:24 +01:00
a9bb8afca4 v2.0.11 2016-11-27 20:18:30 +11:00
28cd92b708 Merge branch 'master' of https://github.com/Selz/plyr 2016-11-27 20:15:19 +11:00
a44c7ecc3a Fix for iPad and YouTube issues 2016-11-27 20:15:15 +11:00
5214c5d55d Merge pull request #425 from sebastiancarlsson/cleanup-called-twice-bug
fixes bug where cleanUp would be called twice
2016-11-18 09:40:34 +11:00
3e6ed7b69b fixes bug where cleanUp would be called twice 2016-11-17 15:43:26 +01:00
7d2a8d343a Update 2016-11-16 09:41:06 +11:00
03aacf483f Update readme.md 2016-11-16 09:40:09 +11:00
73a1391f2f Update readme.md 2016-11-02 18:45:37 +11:00
660ff0434d Cache bust 2016-11-02 18:29:38 +11:00
94208dce76 v2.0.10
- Added seek event fixes for Vimeo and YouTube (fixes #409)
- Added support for embed URLs rather than ID only (fixes #345)
2016-11-02 18:14:06 +11:00
efe54fbba4 Added seek event fixes (fixes #409), Added support for URLs (fixes #345) 2016-11-02 18:09:40 +11:00
10561d6c83 Merge pull request #408 from gurupras/urlparser
Added logic to parse youtube video id
2016-11-02 16:59:28 +11:00
0ef87f93a6 Added logic to parse youtube video id
This commit is targetted at solving issue#345 and adds
    functionality to parse youtube video IDs from various
    types of youtube video URLs.

    Other embed types like vimeo/soundcloud can be extended by
    following a similar structure as implemented in this commit.
2016-10-30 00:49:17 -04:00
a3ed309342 v2.0.9
- Temporary patch for the YouTube API issues with `getDuration()` (relates to #374)
2016-10-23 15:18:53 +11:00
08b4c09b89 Temporary patch for the YouTube API issues with getDuration() (relates to #374) 2016-10-23 15:18:08 +11:00
a509a5e1bc v2.0.8
- Added `isPaused()` API method (thanks to @darrena092)
- Allowed `.on()` API method to be chainable (thanks to @gurupras) (fixes #357)
- Improved the "awful" rendering of captions on small screens in fullscreen mode (fixes #390)
- Fix for Firefox VTT compatibility (thanks to @magourex)
- Fix for Firefox Developer Edition blank video due to `-webkit-mask-image` issue (fixes #392)
- Added Issue and PR templates with the aim of reducing duplicate or duff issues
2016-10-23 13:48:05 +11:00
bec10e7836 Fix for caption size (fixes #390), Fix for Firefox Dev (fixes #392) 2016-10-23 13:35:49 +11:00
f9a184800b Add Issue and PR templates 2016-10-23 13:34:44 +11:00
f428c3ff8b Manually merged #395 2016-10-23 12:19:39 +11:00
97eb40a8e3 Merge pull request #389 from darrena092/master
Added .isPaused().
2016-10-23 11:51:10 +11:00
8211631950 Gulp build done. 2016-10-06 15:43:41 +01:00
a17cbb0e8b Added .isPaused to API 2016-10-06 15:33:49 +01:00
8098be6f93 Merge pull request #379 from magourex/master
Support WebVTT with CRLF or LF Line separator with firefox #378
2016-10-01 22:10:35 +10:00
1c73c9fbfe Update plyr.js 2016-09-27 10:57:35 +02:00
978606edb4 CSS path 2016-09-06 23:54:04 +10:00
Sam
435b5c74bf Fixed API method, added new methods (fixes #346, #351)
- Fixed `getCurrentTime()` method (fixes #351)
- Added `getVolume()` , `isMuted()` and `getDuration()` API methods (fixes #346)
2016-08-29 23:36:43 +10:00
Sam
15fd7041ab Fixed AMD definition 2016-08-26 21:43:51 +10:00
1ced6b4d67 Vimeo IE9/10 (Fixes #348), HTML5 ready event (Fixes #349) 2016-08-26 18:15:24 +10:00
Sam
6694c1e6cf Fix for Firefox full screen (fixes #343) 2016-08-23 00:34:43 +10:00
19ca906e50 Update changelog.md 2016-08-22 20:41:49 +10:00
12e94775d6 Global keyboard shortcut changes 2016-08-22 14:44:18 +10:00
df7f52d885 Added ‘global’ keyboard shortcut option 2016-08-22 14:15:49 +10:00
d5b5faafbb Version bump for NPM 2016-08-22 13:08:19 +10:00
a318e8588b Merge branch 'master' of https://github.com/Selz/plyr 2016-08-22 13:07:07 +10:00
51fb252cd8 Update changelog.md 2016-08-22 13:06:26 +10:00
86b2f61b56 Bump to v2.0.0 2016-08-22 13:00:47 +10:00
232a9fe868 Update changelog.md 2016-08-22 12:53:38 +10:00
e8bfe73b1d Update readme.md 2016-08-22 08:40:02 +10:00
ab0d762675 Update readme.md 2016-08-21 22:46:11 +10:00
a6a314e011 Update readme.md 2016-08-21 21:53:16 +10:00
514bdff92e Update readme.md 2016-08-21 21:53:02 +10:00
745e56a3a3 Update readme.md 2016-08-21 21:40:24 +10:00
130fb78b4c Version bump 2016-08-21 19:47:13 +10:00
3718ec69ba Use minified 2016-08-21 19:45:45 +10:00
4610f4a8c9 Firefox and Edge fixes 2016-08-21 19:44:46 +10:00
a8062354ec Loading tweaks, Microsoft Edge tweaks 2016-08-21 19:25:21 +10:00
Sam
aac0a5a3a9 Work on docs 2016-08-21 10:30:11 +10:00
Sam
92b9e3400b Keyboard shortcuts 2016-08-20 23:39:18 +10:00
Sam
bea513f5dd Jshint tweaks, changelog 2016-08-20 20:11:21 +10:00
9d109bf02d Refactoring and bug fixing 2016-08-20 18:02:02 +10:00
fc45ab48c9 Merge branch 'master' into develop
# Conflicts:
#	src/js/plyr.js
2016-08-20 17:46:05 +10:00
58e9b02405 Merge 2016-08-06 11:09:55 +10:00
b578fb4840 Merge branch 'master' of https://github.com/Selz/plyr 2016-08-06 11:08:33 +10:00
f18d9589eb Font stack SASS fix (Fixes #328) 2016-08-06 11:08:28 +10:00
35c6ec9461 Manually merged #313 PR 2016-08-06 11:08:04 +10:00
56d9730d0a Merge pull request #326 from mkaziz/master
Updated define to work with AMD imports
2016-08-06 10:15:53 +10:00
6e18bc8b31 Updated define to work with AMD imports 2016-08-04 02:05:12 -05:00
81756a1af9 Merge pull request #322 from mortonfox/patch-1
Fix the Initialising and Options anchor links
2016-07-30 14:10:34 +10:00
05e1ab1165 Fix the Initialising and Options anchor links 2016-07-30 00:09:39 -04:00
a0ddc5e6eb Merge pull request #321 from electerious/patch-1
Added Array as selector in .setup() to readme
2016-07-25 08:53:29 +10:00
dc40b1f93a Added Array as selector in .setup() to readme
Documentation for #319
2016-07-24 20:52:20 +02:00
d7cc29f2fb Vimeo keyboard focus fix (Fixes #317), Fix for Vimeo on basic support devices 2016-07-23 11:11:17 +10:00
0505e49038 Vimeo API upgrade, YouTube Bugfix, Array support
- Vimeo API upgrade
- Fix for YouTube bug introduced in v1.8.9 (Fixes #320)
- Added support for passing array to .setup() (Fixes #319)
2016-07-23 10:42:06 +10:00
6ff1e47341 Merge branch 'master' of https://github.com/Selz/plyr 2016-07-21 21:59:26 +10:00
e72a91de6e Fix for seek issues introduced in v1.8.9 2016-07-21 21:59:16 +10:00
52ec4c012d Update readme.md 2016-07-21 21:32:56 +10:00
ae89c92ab6 Update readme.md 2016-07-21 21:31:09 +10:00
57ad124ce8 v1.8.9 2016-07-21 21:25:27 +10:00
a85d45d2e5 Fix for fullscreen not being defined (Fixes #295) 2016-07-21 21:21:10 +10:00
a6f57fc034 Fix for multiline captions (Fixes #314) 2016-07-21 21:15:44 +10:00
04c9653b86 Merge branch 'master' of https://github.com/Selz/plyr 2016-07-21 21:14:29 +10:00
b8cdc71001 Clean up of type checks and fix for _restart() (Fixes #315) 2016-07-21 21:14:22 +10:00
277ebf0fd1 Merge pull request #312 from dpschen/patch-1
Add kirby-plyrtag
2016-07-14 22:03:50 +10:00
7682d998e7 Add kirby-plyrtag
Added a Kirby cms kirbytag https://getkirby.com/
2016-07-14 12:52:28 +02:00
05b9b9a831 Fix for MEDIA_ERR_SRC_NOT_SUPPORTED when calling .source() API method 2016-07-14 17:13:37 +10:00
eee699cec6 Version bump 2016-07-10 20:59:42 +10:00
3c9e9862d8 Added getCurrentTime API method (fixes #292) 2016-07-10 20:58:19 +10:00
39dc651a9d Fix for !hideControls on touch devices (fixes #303) 2016-07-10 20:50:55 +10:00
4effda125a Merge branch 'master' of https://github.com/Selz/plyr 2016-07-10 20:45:58 +10:00
bf9de231d8 Styling minor tweaks 2016-07-10 20:45:54 +10:00
ef12332505 Update readme.md 2016-06-29 16:23:38 +10:00
1b735f1727 Update readme.md 2016-06-26 22:21:19 +10:00
7f7ecf852e Line height fix 2016-06-26 09:07:42 +10:00
931672895f Reverted font size change 2016-06-26 09:04:38 +10:00
0952bc8239 Built JS 2016-06-26 08:45:06 +10:00
7e7508ca82 Fixed overflow issues (fixes #286) 2016-06-26 08:34:36 +10:00
095d100ba4 Version bump 2016-06-25 23:47:30 +10:00
c61fad51c1 Fix for z-index on large play button 2016-06-25 23:46:37 +10:00
7b11c6803d Merge pull request #283 from arrowthemes/patch-1
Make the player button clickable on small videos
2016-06-25 17:44:07 +04:00
9b75436380 v1.8.3
- Disabled iPad support for YouTube and Vimeo due to iOS limitations with iFrame playback
- Fixed IE11 icon loading (fixes #269)
- Updated screenshot (fixes #281)
- Added WordPress plugin (fixes #239)
- Added Neos plugin
- Added HLS, Shaka and dash.js examples (see #235 for more)
- Improvements for controls hiding and showing on touch devices
2016-06-25 23:39:00 +10:00
be19b72719 Merge branch 'master' of https://github.com/Selz/plyr
# Conflicts:
#	dist/plyr.css
#	src/less/plyr.less
#	src/scss/plyr.scss
2016-06-25 22:35:04 +10:00
2fdcc18356 Hide Shadow DOM elements 2016-06-25 22:33:23 +10:00
6425a33ccd Merge pull request #284 from Integer64/develop
fix name svg
2016-06-22 19:10:48 +01:00
12c5dbd290 fix name svg 2016-06-23 01:56:14 +08:00
cb591dac0c Make the player button clickable on small videos
If you set the plyr video to width of 300px, the plyr__controls overlays the play centered play button such that you can't click on the play button. Adding a z-index on the plyr .plyr__play-large fixes that.
2016-06-21 21:59:00 +03:00
4c1cdea56e Merge pull request #275 from wilsonmsalberto/master
Prevent error when verifying if play buttons exist
2016-06-13 18:49:20 +01:00
80cfabbaf9 Prevent error when verifying if play buttons exist 2016-06-13 17:01:46 +01:00
Sam
c7d28b09c0 Fixed event bubbling 2016-06-09 11:05:07 +01:00
Sam
161dd48312 Fixed log message 2016-06-09 09:57:16 +01:00
Sam
383515c1b7 Merge branch 'master' of https://github.com/Selz/plyr 2016-06-09 09:49:09 +01:00
Sam
98792168e4 Changes to setup return value, SVG bug fix (fixes #269) 2016-06-09 09:49:01 +01:00
01437a4a38 Merge pull request #271 from thegrammarnazi/patch-3
correct grammar
2016-06-09 09:46:49 +01:00
03ed86f5c2 correct grammar 2016-06-09 01:39:52 -05:00
Sam
1a745e1eaa Merge branch 'master' of https://github.com/Selz/plyr 2016-06-07 12:34:40 +01:00
Sam
70646ca907 See changelog (fixes #265, #253, #257) 2016-06-07 12:34:36 +01:00
af774b6f02 Merge pull request #260 from cytec/fix-control-icon-size
use $plyr-control-icon-size in sass file
2016-06-02 10:41:36 +01:00
7a9eac093a use $plyr-control-icon-size in sass file 2016-06-02 11:40:09 +02:00
Sam
4afd311ef6 Version bump 2016-06-02 10:19:35 +01:00
Sam
7eec6c6739 Fix for multiple sprites being requested (fixes #259) 2016-06-02 10:18:33 +01:00
Sam
521431e093 Fix for scroll direction on volume (fixes #258) 2016-06-01 09:38:29 +01:00
24bc415faf Merge pull request #256 from MrSnowflake/develop
In specific cases Plyr fails to initiate YT: YT.Player is not a constructor
2016-05-31 08:26:53 +01:00
152e94f229 Improved YT initialized check.
Added an extra check to see wether YT API has been initialized. The current check is inadequate as YT can be an object while the API still isn't completely initialized.
2016-05-30 00:35:07 +02:00
46 changed files with 3223 additions and 2217 deletions

28
.github/issue_template.md vendored Normal file
View File

@ -0,0 +1,28 @@
<!---
Please use this issue template as it makes replicating and fixing the issue easier!
--->
- [ ] Issue does not already exist
- [ ] Issue observed on https://plyr.io
### Expected behaviour
### Actual behaviour
### Environment
- Browser:
- Version:
- Operating System:
- Version:
Players affected:
- [ ] HTML5 Video
- [ ] HTML5 Audio
- [ ] YouTube
- [ ] Vimeo
### Steps to reproduce
-
### Relevant links

8
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,8 @@
### Link to related issue (if applicable)
### Sumary of proposed changes
### Task list
- [ ] Tested on [supported browsers](https://github.com/sampotts/plyr#browser-support)
- [ ] Gulp build completed

11
.jsbeautifyrc Normal file
View File

@ -0,0 +1,11 @@
{
"html": {
"allowed_file_extensions": []
},
"css": {
"allowed_file_extensions": []
},
"js": {
"allowed_file_extensions": []
}
}

View File

@ -8,11 +8,11 @@
"node" : false,
"rhino" : false,
"couch" : false,
"wsh" : true, // Windows Scripting Host.
"wsh" : false, // Windows Scripting Host.
"jquery" : false,
// Development.
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
"debug" : true, // Allow debugger statements e.g. browser breakpoints.
"devel" : true, // Allow developments statements e.g. `console.log();`.
// ECMAScript 5.
@ -25,7 +25,7 @@
"bitwise" : false, // Prohibit bitwise operators (&, |, ^, etc.).
"boss" : false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
"curly" : true, // Require {} for every new block or scope.
"eqeqeq" : false, // Require triple equals i.e. `===`.
"eqeqeq" : true, // Require triple equals i.e. `===`.
"eqnull" : false, // Tolerate use of `== null`.
"evil" : false, // Tolerate use of `eval`.
"expr" : false, // Tolerate `ExpressionStatement` as Programs.

View File

@ -9,13 +9,13 @@
"HTml5 Video"
],
"authors": [
"Sam Potts <me@sampotts.me>"
"Sam Potts <sam@potts.es>"
],
"dependencies": {},
"main": [
"dist/plyr.css",
"dist/plyr.js",
"dist/sprite.svg",
"dist/plyr.svg",
"src/less/plyr.less",
"src/scss/plyr.scss",
"src/js/plyr.js"
@ -27,7 +27,7 @@
],
"repository": {
"type": "git",
"url": "git://github.com/selz/plyr.git"
"url": "git://github.com/sampotts/plyr.git"
},
"license": "MIT"
}

View File

@ -10,14 +10,14 @@
"plyr.js": ["src/js/plyr.js"]
}
},
"docs": {
"demo": {
"less": {
"docs.css": ["docs/src/less/docs.less"]
"demo.css": ["demo/src/less/demo.less"]
},
"js": {
"docs.js": [
"docs/src/js/lib/classlist.js",
"docs/src/js/docs.js"
"demo.js": [
"demo/src/js/lib/classlist.js",
"demo/src/js/main.js"
]
}
}

View File

@ -1,12 +1,163 @@
# Changelog
# v1.6.18
## v2.0.14
- CDN URL updates. Sorry, still working on V3 as hard as I can...
## v2.0.13
- Repo moved and Vimeo demo fix
## v2.0.12
- Ability to set custom `blankUrl` for source changes (https://github.com/sampotts/plyr/pull/504)
- Ability to set caption button listener (https://github.com/sampotts/plyr/pull/468)
## v2.0.11
- Fix for `cleanUp` being called twice (thanks to @sebastiancarlsson)
- Fix for YouTube controls on iPad (fixes #391)
## v2.0.10
- Added seek event fixes for Vimeo and YouTube (fixes #409)
- Added support for embed URLs rather than ID only (fixes #345)
## v2.0.9
- Temporary patch for the YouTube API issues with `getDuration()` (relates to #374)
## v2.0.8
- Added `isPaused()` API method (thanks to @darrena092)
- Allowed `.on()` API method to be chainable (thanks to @gurupras) (fixes #357)
- Improved the "awful" rendering of captions on small screens in fullscreen mode (fixes #390)
- Fix for Firefox VTT compatibility (thanks to @magourex)
- Fix for Firefox Developer Edition blank video due to `-webkit-mask-image` issue (fixes #392)
- Added Issue and PR templates with the aim of reducing duplicate or duff issues
## v2.0.7
- Fixed `getCurrentTime()` method (fixes #351)
- Added `getVolume()` , `isMuted()` and `getDuration()` API methods (fixes #346)
## v2.0.6
- Fixed merge issue with `Updated define to work with AMD imports #326` PR
- Code formatting
## v2.0.5
- Fix for Vimeo in IE9 & IE10
- Fix for HTML5 elements not firing `ready` event
## v2.0.4
- Fix for Firefox full screen (fixes #343)
## v2.0.3
- Set 'global' keyboard shortcut option to false as default, added `<textarea>` to editable elements to be ignored
## v2.0.2
- Added 'global' keyboard shortcut option
## v2.0.1
- Version bump for NPM (sorry for folks who upgraded to the now deleted v1.9.0 through NPM)
# v2.0.0
This version contains several potential ***breaking changes***:
- `setup()` has been reverted to pre v1.8.0 behaviour; meaning it will return the *instance* rather than the *element*. This is because the reference to the instance is no longer added to the original element (see below).
- The reference to the `plyr` instance is now added to the media element rather than original container. This is because if a container with multiple children was passed to `setup()` the references to all instances would have been added to the container, creating issues. I would recommend using the return value from `setup()` or the new `get()` method to access the instance.
- Players will always be wrapped in their own div now - this makes `setup()` and `destroy()` cleaner. This *may* break any custom styling based on DOM position.
- Players no longer seek to 0 on 'ended' - this is to fix a bug with Microsoft Edge as it triggers 'ended' on media change for whatever reason. They'll never change ;-)
And some other changes and bug fixes:
- New `get()` method on the global plyr object to get all instances inside a container
- New API methods:
- `getOriginal()` to get the original, *unmodified* element plyr was setup on (`<video>`, `<audio>` or empty `<div>` for YouTube and Vimeo)
- `getContainer()` to get the players outer wrapper element
- `getMedia()` to get the players media element (`<video>`, `<audio>` or empty `<div>` for YouTube and Vimeo)
- `getEmbed()` to access the YouTube or Vimeo API directly
- `getType()` to get the type of the player
- `isReady()` to determine if an instance has completed setup and necessary APIs are loaded (for YouTube / Vimeo)
- `on()` to provide an easy way to listen to events
- `stop()` to, you guessed it, stop the player
- `destroy()` now works correctly for YouTube and Vimeo (fixes #272)
- New `destroyed` event when `destroy()` has completed (original element is passed as event.target)
- Default volume is now 10 (max) rather than 5
- Sprite is only loaded once (fixes #259)
- Fixes for Vimeo post message bugs on source change or destroy (fixes #318)
- Save caption state in storage (fixes #311)
- Added keyboard shortcuts to the current focused player (with `keyboardShortcuts` boolean option to disable) (fixes #309)
- Fix for captions bug (fixes #332)
- Change to AMD (fixes #298)
## v1.8.12
- Vimeo keyboard focus fix (Fixes #317)
- Fix for Vimeo on basic support devices
## v1.8.11
- Fix for keyboard navigation on Vimeo (Fixes #317)
- Fix for bug introduced in v1.8.9 related to additional controls
- Vimeo API upgrade
- Fix for YouTube bug introduced in v1.8.9
- Added support for passing array to .setup() (Fixes #319)
## v1.8.10
- Fix for seek issues introduced in v1.8.9
## v1.8.9
- Fix for fullscreen not being defined (Fixes #295)
- Fix for multiline captions (Fixes #314)
- Clean up of type checks and fix for `restart()` (Fixes #315)
- Fix for `MEDIA_ERR_SRC_NOT_SUPPORTED` when calling `.source()` API method
## v1.8.8
- Added getCurrentTime API method (fixes #292)
- Fix for !hideControls on touch devices (fixes #303)
## v1.8.7
- Line height fix
## v1.8.6
- Reverted font size change
## v1.8.5
- Fixed overflow issues (fixes #286)
## v1.8.4
- Fix for large play button on small videos
## v1.8.3
- Disabled iPad support for YouTube and Vimeo due to iOS limitations with iFrame playback
- Fixed IE11 icon loading (fixes #269)
- Updated screenshot (fixes #281)
- Added WordPress plugin (fixes #239)
- Added Neos plugin
- Added HLS, Shaka and dash.js examples (see #235 for more)
- Improvements for controls hiding and showing on touch devices
## v1.8.2
- Fixed event bubbling
## v1.8.1
- Fixed inaccurate log message
# v1.8.0
- ***(Important)*** `setup()` now returns the element Plyr was setup on rather than the `plyr` object. This means `var player = plyr.setup()[0];` would now be `var player = plyr.setup()[0].plyr;`. This improves support for React and other virtual dom frameworks as mentioned in #254
- Fixed using a relative URL for `iconUrl` in IE (fixes #269)
# v1.7.0
- SASS cleanup (fixes #265)
- Docs tidy up to help quick start (fixes #253)
- Fix for issues with data attribute options passing (fixes #257)
- ***(Important)*** Removed the requirement for a wrapper div to setup Plyr and removed the dependency on the `plyr` classname as a JS hook. By default it will now look for `<video>`, `<audio>` and `[data-type]` elements. If you are just calling `setup()` with a `<div class="plyr">` you may want to give it a good test after upgrading. You can probably remove the wrapper div. The reason behind this is to make setup easier for newcomers and prevent the styling being used on unsupported players (because the plyr classname was used as a CSS and JS hook - which isn't ideal)
- Renamed the 'docs' folder to `demo` to avoid confusion - the readme is the docs after all
## v1.6.20
- Fix for multiple sprites being requested (fixes #259)
## v1.6.19
- Fix for scroll direction issues on volume control (fixes #258)
## v1.6.18
- Reduced rounding of seek value from 1 decimal point to 4 (fixes #242)
# v1.6.17
## v1.6.17
- Added `disableContextMenu` option to hide the right click context menu (fixes #248 and #225)
# v1.6.16
## v1.6.16
- Always hide standard controls (fixes #225)
- Fix for Tooltips overflowing (fixes #230)
@ -21,7 +172,7 @@
- Decreased sensitivity and inverted scroll on volume slider (scroll up to increase, down to decrease)
## v1.6.12
- Fix for undefined buffer error
- Fix for undefined buffer error
- Add scroll listener on volume slider (PR #227 bty @igoradamenko)
## v1.6.11
@ -63,13 +214,13 @@
- Other minor bug fixes
## v1.6.1
- Tooltip changes for accessibility
- Tooltip changes for accessibility
## v1.6.0
- New, cleaner, UI:
- Controls are now overlaid, maintaining the video's ratio and making sizing easier
- A large play button can now be overlaid over videos
- Default number of control buttons reduced
- Default number of control buttons reduced
- New play, pause, rewind and fast forward icons
- Flexbox all the things!
- Tidied up the LESS (and SCSS) as part of the above, variables and mixins in seprate files amking customization and upgrades easier

1
demo/dist/demo.css vendored Normal file

File diff suppressed because one or more lines are too long

1
demo/dist/demo.js vendored Normal file
View File

@ -0,0 +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,o=arguments.length;for(i=0;i<o;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=e.Element.prototype,i=Object,o=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array.prototype.indexOf||function(e){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===e)return t;return-1},n=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},r=function(e,t){if(""===t)throw new n("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new n("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(e,t)},a=function(e){for(var t=o.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],s=0,n=i.length;s<n;s++)this.push(i[s]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=a.prototype=[],l=function(){return new a(this)};if(n.prototype=Error.prototype,c.item=function(e){return this[e]||null},c.contains=function(e){return e+="",-1!==r(this,e)},c.add=function(){var e,t=arguments,i=0,o=t.length,s=!1;do{e=t[i]+"",-1===r(this,e)&&(this.push(e),s=!0)}while(++i<o);s&&this._updateClassName()},c.remove=function(){var e,t,i=arguments,o=0,s=i.length,n=!1;do{for(e=i[o]+"",t=r(this,e);-1!==t;)this.splice(t,1),n=!0,t=r(this,e)}while(++o<s);n&&this._updateClassName()},c.toggle=function(e,t){e+="";var i=this.contains(e),o=i?!0!==t&&"remove":!1!==t&&"add";return o&&this[o](e),!0===t||!1===t?t:!i},c.toString=function(){return this.join(" ")},i.defineProperty){var u={get:l,enumerable:!0,configurable:!0};try{i.defineProperty(t,"classList",u)}catch(e){-2146823252===e.number&&(u.enumerable=!1,i.defineProperty(t,"classList",u))}}else i.prototype.__defineGetter__&&t.__defineGetter__("classList",l)}}(self)),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=o+(i?" "+t:"")}}function t(t,i){if(t in n&&(i||t!==r)&&(r.length||t!==n.video)){switch(t){case n.video:o.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:o.source({type:"audio",title:"Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;",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:o.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:o.source({type:"video",title:"View From A Blue Moon",sources:[{src:"147865858",type:"vimeo"}]})}r=t;for(var a=s.length-1;a>=0;a--)e(s[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}var i=plyr.setup({debug:!0,title:"Video demo",iconUrl:"../dist/plyr.svg",tooltips:{controls:!0},captions:{defaultActive:!0}});plyr.loadSprite("dist/demo.svg");for(var o=i[0],s=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},r=window.location.hash.replace("#",""),a=window.history&&window.history.pushState,c=s.length-1;c>=0;c--)s[c].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),a&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),a){var l=!r.length;l&&(r=n.video),r in n&&history.replaceState({type:r},"",l?"":"#"+r),r!==n.video&&t(r,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,o,s,n,r){e.GoogleAnalyticsObject=s,e[s]=e[s]||function(){(e[s].q=e[s].q||[]).push(arguments)},e[s].l=1*new Date,n=t.createElement(i),r=t.getElementsByTagName(i)[0],n.async=1,n.src="//www.google-analytics.com/analytics.js",r.parentNode.insertBefore(n,r)}(window,document,"script",0,"ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview"));

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Docs styles -->
<link rel="stylesheet" href="dist/docs.css">
<link rel="stylesheet" href="dist/demo.css">
</head>
<body>
<main>

99
demo/index.html Normal file
View File

@ -0,0 +1,99 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Plyr - A simple HTML5 media player</title>
<meta name="description" content="A simple HTML5 media player with custom controls and WebVTT captions.">
<meta name="author" content="Sam Potts">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Styles -->
<link rel="stylesheet" href="../dist/plyr.css">
<!-- Docs styles -->
<link rel="stylesheet" href="dist/demo.css">
</head>
<body>
<header>
<h1>Plyr</h1>
<p>A simple, accessible HTML5 media player by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a></p>
<nav>
<ul>
<li>
<a href="https://github.com/sampotts/plyr" target="_blank" class="btn btn--large btn--primary" data-shr-network="github">
<svg class="icon">
<use xlink:href="#icon-github" />
</svg>Download on GitHub
</a>
</li>
<li>
<a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts"
target="_blank" class="btn btn--large btn--twitter" data-shr-network="twitter">
<svg class="icon">
<use xlink:href="#icon-twitter" />
</svg>Tweet
</a>
</li>
</ul>
</nav>
</header>
<main role="main" id="main">
<nav class="btn__bar">
<ul>
<li class="active">
<button type="button" class="btn" data-source="video">Video</button>
</li>
<li>
<button type="button" class="btn" data-source="audio">Audio</button>
</li>
<li>
<button type="button" class="btn btn--youtube" data-source="youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</button>
</li>
<li>
<button type="button" class="btn btn--vimeo" data-source="vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</button>
</li>
</ul>
</nav>
<section>
<video poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg?v1" controls crossorigin>
<!-- Video files -->
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4" type="video/mp4">
<source src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.webm" type="video/webm">
<!-- Text track file -->
<track kind="captions" label="English" srclang="en" src="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.en.vtt"
default>
<!-- Fallback for browsers that don't support the <video> element -->
<a href="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.mp4" download>Download</a>
</video>
<ul>
<li class="plyr__cite plyr__cite--video"><small><a href="http://viewfromabluemoon.com/" target="_blank">View From A Blue Moon</a> &copy; Brainfarm</small></li>
<li class="plyr__cite plyr__cite--audio"><small><a href="http://www.kishibashi.com/" target="_blank">Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;</a> &copy; Kishi Bashi</small></li>
<li class="plyr__cite plyr__cite--youtube"><small><a href="https://www.youtube.com/watch?v=bTqVqk7FSmY" target="_blank">View From A Blue Moon</a> on <span class="color--youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</span></small></li>
<li class="plyr__cite plyr__cite--vimeo"><small><a href="https://vimeo.com/ondemand/viewfromabluemoon4k" target="_blank">View From A Blue Moon</a> on <span class="color--vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</span></small></li>
</ul>
</section>
</main>
<!-- Plyr core script -->
<script src="../dist/plyr.js"></script>
<!-- Docs script -->
<script src="dist/demo.js"></script>
<!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
<script src="https://cdn.rangetouch.com/1.0.1/rangetouch.js" async></script>
<!-- Sharing libary (https://shr.one) -->
<script src="https://cdn.shr.one/1.0.1/shr.js"></script>
<script>
if (window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }
</script>
</body>
</html>

185
demo/src/js/main.js Normal file
View File

@ -0,0 +1,185 @@
// ==========================================================================
// Plyr.io demo
// This code is purely for the plyr.io website
// Please see readme.md in the root or github.com/selz/plyr
// ==========================================================================
/*global plyr*/
// General functions
(function() {
//document.body.addEventListener('ready', function(event) { console.log(event); });
// Setup the player
var instances = plyr.setup({
debug: true,
title: 'Video demo',
iconUrl: '../dist/plyr.svg',
tooltips: {
controls: true
},
captions: {
defaultActive: true
}
});
plyr.loadSprite('dist/demo.svg');
// Plyr returns an array regardless
var player = instances[0];
// Setup type toggle
var buttons = document.querySelectorAll('[data-source]'),
types = {
video: 'video',
audio: 'audio',
youtube: 'youtube',
vimeo: 'vimeo'
},
currentType = window.location.hash.replace('#', ''),
historySupport = (window.history && window.history.pushState);
// Bind to each button
for (var i = buttons.length - 1; i >= 0; i--) {
buttons[i].addEventListener('click', function() {
var type = this.getAttribute('data-source');
newSource(type);
if (historySupport) {
history.pushState({ 'type': type }, '', '#' + type);
}
});
}
// List for backwards/forwards
window.addEventListener('popstate', function(event) {
if(event.state && 'type' in event.state) {
newSource(event.state.type);
}
});
// On load
if(historySupport) {
var video = !currentType.length;
// If there's no current type set, assume video
if(video) {
currentType = types.video;
}
// Replace current history state
if(currentType in types) {
history.replaceState({ 'type': currentType }, '', (video ? '' : '#' + currentType));
}
// If it's not video, load the source
if(currentType !== types.video) {
newSource(currentType, true);
}
}
// Toggle class on an element
function toggleClass(element, className, state) {
if (element) {
if (element.classList) {
element.classList[state ? 'add' : 'remove'](className);
}
else {
var name = (' ' + element.className + ' ').replace(/\s+/g, ' ').replace(' ' + className + ' ', '');
element.className = name + (state ? ' ' + className : '');
}
}
}
// Set a new source
function newSource(type, init) {
// Bail if new type isn't known, it's the current type, or current type is empty (video is default) and new type is video
if(!(type in types) || (!init && type === currentType) || (!currentType.length && type === types.video)) {
return;
}
switch(type) {
case types.video:
player.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: true
}]
});
break;
case types.audio:
player.source({
type: 'audio',
title: 'Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;',
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 types.youtube:
player.source({
type: 'video',
title: 'View From A Blue Moon',
sources: [{
src: 'bTqVqk7FSmY',
type: 'youtube'
}]
});
break;
case types.vimeo:
player.source({
type: 'video',
title: 'View From A Blue Moon',
sources: [{
src: '147865858',
type: 'vimeo'
}]
});
break;
}
// Set the current type for next time
currentType = type;
// Remove active classes
for (var x = buttons.length - 1; x >= 0; x--) {
toggleClass(buttons[x].parentElement, 'active', false);
}
// Set active on parent
toggleClass(document.querySelector('[data-source="'+ type +'"]').parentElement, 'active', true);
}
})();
// Google analytics
// For demo site (http://[www.]plyr.io) only
if(document.domain.indexOf('plyr.io') > -1) {
(function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40881672-11', 'auto');
ga('send', 'pageview');
}

View File

@ -39,9 +39,10 @@ header {
// Sections
section {
padding-bottom: @padding-base;
max-width: @example-width-video;
margin: 0 auto @padding-base;
@media (min-width: @screen-sm) {
padding-bottom: (@padding-base * 2);
margin-bottom: (@padding-base * 2);
}
}

View File

@ -2,11 +2,6 @@
// Examples
// ==========================================================================
section {
margin: 0 auto @padding-base;
max-width: @example-width-video;
}
// For non supported browsers
video {
max-width: 100%;
@ -21,7 +16,7 @@ video {
.plyr--audio {
max-width: @example-width-audio;
}
.plyr--video::after {
.plyr__video-wrapper::after {
content: "";
pointer-events: none;
position: absolute;

View File

@ -1,5 +1,5 @@
// ==========================================================================
// HTML5 Video Player Demo Page
// Plyr.io Demo Page
// ==========================================================================
// CSS Reset

View File

@ -0,0 +1,18 @@
// ==========================================================================
// Fonts
// ==========================================================================
@font-face {
font-family: "Avenir";
src: url("//cdn.plyr.io/static/fonts/avenir-medium.woff2") format("woff2"),
url("//cdn.plyr.io/static/fonts/avenir-medium.woff") format("woff");
font-style: normal;
font-weight: @font-weight-base;
}
@font-face {
font-family: "Avenir";
src: url("//cdn.plyr.io/static/fonts/avenir-bold.woff2") format("woff2"),
url("//cdn.plyr.io/static/fonts/avenir-bold.woff") format("woff");
font-style: normal;
font-weight: @font-weight-bold;
}

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 981 B

After

Width:  |  Height:  |  Size: 981 B

View File

Before

Width:  |  Height:  |  Size: 779 B

After

Width:  |  Height:  |  Size: 779 B

View File

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 739 B

2
dist/plyr.css vendored

File diff suppressed because one or more lines are too long

3
dist/plyr.js vendored

File diff suppressed because one or more lines are too long

1
docs/dist/docs.css vendored

File diff suppressed because one or more lines are too long

1
docs/dist/docs.js vendored
View File

@ -1 +0,0 @@
"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 &ndash; &ldquo;It All Began With A Burst&rdquo;",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"));

View File

@ -1,90 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Plyr - A simple HTML5 media player</title>
<meta name="description" content="A simple HTML5 media player with custom controls and WebVTT captions.">
<meta name="author" content="Sam Potts">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Styles -->
<link rel="stylesheet" href="../dist/plyr.css">
<!-- Docs styles -->
<link rel="stylesheet" href="dist/docs.css">
</head>
<body>
<header>
<h1>Plyr</h1>
<p>A simple, accessible HTML5 media player by <a href="https://twitter.com/sam_potts" target="_blank">@sam_potts</a> from <a href="https://twitter.com/selz" target="_blank">@selz</a></p>
<nav>
<ul>
<li>
<a href="https://github.com/selz/plyr" target="_blank" class="btn btn--large btn--primary" data-shr-network="github">
<svg class="icon"><use xlink:href="#icon-github"/></svg>Download on GitHub
</a>
</li>
<li>
<a href="https://twitter.com/intent/tweet?text=A+simple+HTML5+media+player+with+custom+controls+and+WebVTT+captions.&url=http%3A%2F%2Fplyr.io&via=Sam_Potts" target="_blank" class="btn btn--large btn--twitter" data-shr-network="twitter">
<svg class="icon"><use xlink:href="#icon-twitter"/></svg>Tweet
</a>
</li>
</ul>
</nav>
</header>
<main role="main" id="main">
<nav class="btn__bar">
<ul>
<li class="active">
<button type="button" class="btn" data-source="video">Video</button>
</li>
<li>
<button type="button" class="btn" data-source="audio">Audio</button>
</li>
<li>
<button type="button" class="btn btn--youtube" data-source="youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</button>
</li>
<li>
<button type="button" class="btn btn--vimeo" data-source="vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</button>
</li>
</ul>
</nav>
<section>
<div class="js-media-player">
<video poster="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg" controls crossorigin>
<!-- Video files -->
<source src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4" type="video/mp4">
<source src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm" type="video/webm">
<!-- Text track file -->
<track kind="captions" label="English" srclang="en" src="https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt" default>
<!-- Fallback for browsers that don't support the <video> element -->
<a href="https://cdn.selz.com/plyr/1.0/movie.mp4">Download</a>
</video>
</div>
<ul>
<li class="plyr__cite plyr__cite--video"><small><a href="http://viewfromabluemoon.com/" target="_blank">View From A Blue Moon</a> &copy; Brainfarm</small></li>
<li class="plyr__cite plyr__cite--audio"><small><a href="http://www.kishibashi.com/" target="_blank">Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;</a> &copy; Kishi Bashi</small></li>
<li class="plyr__cite plyr__cite--youtube"><small><a href="https://www.youtube.com/watch?v=bTqVqk7FSmY" target="_blank">View From A Blue Moon</a> on <span class="color--youtube"><svg class="icon"><use xlink:href="#icon-youtube"/></svg>YouTube</span></small>
<li class="plyr__cite plyr__cite--vimeo"><small><a href="https://vimeo.com/ondemand/viewfromabluemoon4k" target="_blank">View From A Blue Moon</a> on <span class="color--vimeo"><svg class="icon"><use xlink:href="#icon-vimeo"/></svg>Vimeo</span></small>
</ul>
</section>
</main>
<!-- Plyr core script -->
<script src="../dist/plyr.js"></script>
<!-- Docs script -->
<script src="dist/docs.js"></script>
<!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
<script src="https://cdn.rangetouch.com/0.0.9/rangetouch.js"></script>
<!-- Sharing libary (https://shr.one) -->
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
<script>if(window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }</script>
</body>
</html>

View File

@ -1,180 +0,0 @@
// ==========================================================================
// Docs example
// ==========================================================================
/*global plyr*/
// Setup the player
plyr.setup('.js-media-player', {
debug: true,
title: 'Video demo',
iconUrl: '../dist/plyr.svg',
tooltips: {
controls: true
},
captions: {
defaultActive: true
}
});
plyr.loadSprite('dist/docs.svg');
// General functions
(function() {
var buttons = document.querySelectorAll('[data-source]'),
types = {
video: 'video',
audio: 'audio',
youtube: 'youtube',
vimeo: 'vimeo'
},
currentType = window.location.hash.replace('#', ''),
historySupport = (window.history && window.history.pushState);
// Bind to each button
for (var i = buttons.length - 1; i >= 0; i--) {
buttons[i].addEventListener('click', function() {
var type = this.getAttribute('data-source');
newSource(type);
if (historySupport) {
history.pushState({ 'type': type }, '', '#' + type);
}
});
}
// List for backwards/forwards
window.addEventListener('popstate', function(event) {
if(event.state && 'type' in event.state) {
newSource(event.state.type);
}
});
// On load
if(historySupport) {
var video = !currentType.length;
// If there's no current type set, assume video
if(video) {
currentType = types.video;
}
// Replace current history state
if(currentType in types) {
history.replaceState({ 'type': currentType }, '', (video ? '' : '#' + currentType));
}
// If it's not video, load the source
if(currentType !== types.video) {
newSource(currentType, true);
}
}
// Toggle class on an element
function toggleClass(element, className, state) {
if (element) {
if (element.classList) {
element.classList[state ? 'add' : 'remove'](className);
}
else {
var name = (' ' + element.className + ' ').replace(/\s+/g, ' ').replace(' ' + className + ' ', '');
element.className = name + (state ? ' ' + className : '');
}
}
}
// Set a new source
function newSource(type, init) {
// Bail if new type isn't known, it's the current type, or current type is empty (video is default) and new type is video
if(!(type in types) || (!init && type == currentType) || (!currentType.length && type == types.video)) {
return;
}
// Get plyr instance
var player = document.querySelector('.js-media-player').plyr;
switch(type) {
case types.video:
player.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: true
}]
});
break;
case types.audio:
player.source({
type: 'audio',
title: 'Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;',
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 types.youtube:
player.source({
type: 'video',
title: 'View From A Blue Moon',
sources: [{
src: 'bTqVqk7FSmY',
type: 'youtube'
}]
});
break;
case types.vimeo:
player.source({
type: 'video',
title: 'View From A Blue Moon',
sources: [{
src: '143418951',
type: 'vimeo'
}]
});
break;
}
// Set the current type for next time
currentType = type;
// Remove active classes
for (var x = buttons.length - 1; x >= 0; x--) {
toggleClass(buttons[x].parentElement, 'active', false);
}
// Set active on parent
toggleClass(document.querySelector('[data-source="'+ type +'"]').parentElement, 'active', true);
}
})();
// Google analytics
// For demo site (http://[www.]plyr.io) only
if(document.domain.indexOf('plyr.io') > -1) {
(function(i,s,o,g,r,a,m){i.GoogleAnalyticsObject=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40881672-11', 'auto');
ga('send', 'pageview');
}

View File

@ -1,18 +0,0 @@
// ==========================================================================
// Fonts
// ==========================================================================
@font-face {
font-family: "Avenir";
src: url("//cdn.plyr.io/fonts/avenir-medium.woff2") format("woff2"),
url("//cdn.plyr.io/fonts/avenir-medium.woff") format("woff");
font-style: normal;
font-weight: @font-weight-base;
}
@font-face {
font-family: "Avenir";
src: url("//cdn.plyr.io/fonts/avenir-bold.woff2") format("woff2"),
url("//cdn.plyr.io/fonts/avenir-bold.woff") format("woff");
font-style: normal;
font-weight: @font-weight-bold;
}

View File

@ -37,19 +37,19 @@ paths = {
// Output paths
output: path.join(root, "dist/")
},
docs: {
demo: {
// Source paths
src: {
less: path.join(root, "docs/src/less/**/*"),
js: path.join(root, "docs/src/js/**/*"),
sprite: path.join(root, "docs/src/sprite/**/*")
less: path.join(root, "demo/src/less/**/*"),
js: path.join(root, "demo/src/js/**/*"),
sprite: path.join(root, "demo/src/sprite/**/*")
},
// Output paths
output: path.join(root, "docs/dist/"),
// Docs
root: path.join(root, "docs/")
output: path.join(root, "demo/dist/"),
// Demo
root: path.join(root, "demo/")
},
upload: [path.join(root, "dist/**"), path.join(root, "docs/dist/**")]
upload: [path.join(root, "dist/**"), path.join(root, "demo/dist/**")]
},
// Task arrays
@ -77,20 +77,20 @@ 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
var src = require('stream').Readable({
objectMode: true
});
src._read = function () {
this.push(new gutil.File({
cwd: "",
base: "",
path: filename,
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);
}
@ -178,10 +178,10 @@ build.less(bundles.plyr.less, "plyr");
build.scss(bundles.plyr.scss, "plyr");
build.sprite("plyr");
// Docs files
build.less(bundles.docs.less, "docs");
build.js(bundles.docs.js, "docs");
build.sprite("docs");
// Demo files
build.less(bundles.demo.less, "demo");
build.js(bundles.demo.js, "demo");
build.sprite("demo");
// Build all JS
gulp.task("js", function(){
@ -200,10 +200,10 @@ gulp.task("watch", function () {
gulp.watch(paths.plyr.src.less, tasks.less);
gulp.watch(paths.plyr.src.sprite, tasks.sprite);
// Docs
gulp.watch(paths.docs.src.js, tasks.js);
gulp.watch(paths.docs.src.less, tasks.less);
gulp.watch(paths.docs.src.sprite, tasks.sprite);
// Demo
gulp.watch(paths.demo.src.js, tasks.js);
gulp.watch(paths.demo.src.less, tasks.less);
gulp.watch(paths.demo.src.sprite, tasks.sprite);
});
// Default gulp task
@ -211,7 +211,7 @@ gulp.task("default", function(){
run(tasks.js, tasks.less, tasks.sprite, "watch");
});
// Publish a version to CDN and docs
// Publish a version to CDN and demo
// --------------------------------------------
// Some options
@ -225,7 +225,7 @@ options = {
"Vary": "Accept-Encoding"
}
},
docs: {
demo: {
headers: {
"Cache-Control": "no-cache, no-store, must-revalidate, max-age=0",
"Vary": "Accept-Encoding"
@ -245,15 +245,15 @@ options = {
// If aws is setup
if("cdn" in aws) {
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.domain + "\/" + regex, "gi"),
semver = new RegExp("v" + regex, "gi"),
localPath = new RegExp("(\.\.\/)?dist", "gi"),
versionPath = "https://" + aws.cdn.bucket + "/" + version;
versionPath = "https://" + aws.cdn.domain + "/" + version;
}
// Publish version to CDN bucket
gulp.task("cdn", function () {
console.log("Uploading " + version + " to " + aws.cdn.bucket + "...");
console.log("Uploading " + version + " to " + aws.cdn.domain + "...");
// Upload to CDN
return gulp.src(paths.upload)
@ -268,34 +268,34 @@ gulp.task("cdn", function () {
.pipe(s3(aws.cdn, options.cdn));
});
// Publish to Docs bucket
gulp.task("docs", function () {
console.log("Uploading " + version + " docs to " + aws.docs.bucket + "...");
// Publish to demo bucket
gulp.task("demo", function () {
console.log("Uploading " + version + " demo to " + aws.demo.domain + "...");
// Replace versioned files in readme.md
gulp.src([root + "/readme.md"])
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
.pipe(replace(cdnpath, aws.cdn.domain + "/" + version))
.pipe(gulp.dest(root));
// Replace versioned files in plyr.js
gulp.src(path.join(root, "src/js/plyr.js"))
.pipe(replace(semver, "v" + version))
.pipe(replace(cdnpath, aws.cdn.bucket + "/" + version))
.pipe(replace(cdnpath, aws.cdn.domain + "/" + version))
.pipe(gulp.dest(path.join(root, "src/js/")));
// Replace local file paths with remote paths in docs HTML
// Replace local file paths with remote paths in demo HTML
// e.g. "../dist/plyr.js" to "https://cdn.plyr.io/x.x.x/plyr.js"
gulp.src([paths.docs.root + "*.html"])
gulp.src([paths.demo.root + "*.html"])
.pipe(replace(localPath, versionPath))
.pipe(s3(aws.docs, options.docs));
.pipe(s3(aws.demo, options.demo));
// Upload error.html to cdn (as well as docs site)
return gulp.src([paths.docs.root + "error.html"])
// Upload error.html to cdn (as well as demo site)
return gulp.src([paths.demo.root + "error.html"])
.pipe(replace(localPath, versionPath))
.pipe(s3(aws.cdn, options.docs));
.pipe(s3(aws.cdn, options.demo));
});
// Open the docs site to check it's sweet
// Open the demo site to check it's sweet
gulp.task("symlinks", function () {
console.log("Updating symlinks...");
@ -318,20 +318,20 @@ gulp.task("symlinks", function () {
}));
});
// Open the docs site to check it's sweet
// Open the demo site to check it's sweet
gulp.task("open", function () {
console.log("Opening " + aws.docs.bucket + "...");
console.log("Opening " + aws.demo.domain + "...");
// A file must be specified or gulp will skip the task
// Doesn't matter which file since we set the URL above
// Weird, I know...
return gulp.src([paths.docs.root + "index.html"])
return gulp.src([paths.demo.root + "index.html"])
.pipe(open("", {
url: "http://" + aws.docs.bucket
url: "http://" + aws.demo.domain
}));
});
// Do everything
gulp.task("publish", function () {
run(tasks.js, tasks.less, tasks.sprite, "cdn", "docs", "symlinks");
run(tasks.js, tasks.less, tasks.sprite, "cdn", "demo", "symlinks");
});

View File

@ -1,6 +1,6 @@
The MIT License (MIT)
Copyright (c) 2015 Selz.com
Copyright (c) 2017 Sam Potts
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,47 +1,43 @@
{
"name": "plyr",
"version": "1.6.18",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "http://plyr.io",
"main": "src/js/plyr.js",
"dependencies": {},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-clean-css": "^2.0.6",
"gulp-concat": "^2.3.3",
"gulp-less": "^3.0.5",
"gulp-open": "^2.0.0",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.3",
"gulp-s3": "^0.3.0",
"gulp-sass": "^2.3.1",
"gulp-size": "^2.1.0",
"gulp-svgmin": "^1.2.2",
"gulp-svgstore": "^5.0.5",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"run-sequence": "^1.1.5",
"through2": "^2.0.1"
},
"keywords": [
"HTML5 Video",
"HTML5 Audio",
"Media Player"
],
"repository": {
"type": "git",
"url": "git://github.com/selz/plyr.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/selz/plyr/issues"
},
"directories": {
"doc": "docs"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Sam Potts <sam@selz.com>"
"name": "plyr",
"version": "2.0.14",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "http://plyr.io",
"main": "src/js/plyr.js",
"dependencies": {},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-clean-css": "^2.0.6",
"gulp-concat": "^2.3.3",
"gulp-less": "^3.0.5",
"gulp-open": "^2.0.0",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.3",
"gulp-s3": "^0.3.0",
"gulp-sass": "^2.3.1",
"gulp-size": "^2.1.0",
"gulp-svgmin": "^1.2.2",
"gulp-svgstore": "^5.0.5",
"gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"run-sequence": "^1.1.5",
"through2": "^2.0.1"
},
"keywords": ["HTML5 Video", "HTML5 Audio", "Media Player", "DASH", "Shaka", "WordPress", "HLS"],
"repository": {
"type": "git",
"url": "git://github.com/sampotts/plyr.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/sampotts/plyr/issues"
},
"directories": {
"doc": "readme.md"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Sam Potts <sam@potts.es>"
}

1047
readme.md

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
position: relative;
max-width: 100%;
min-width: 200px;
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
font-family: @plyr-font-family;
direction: ltr;
& when (@plyr-border-box = true) {
@ -40,6 +40,11 @@
}
}
// Focus
&:focus {
outline: 0;
}
// Media elements
video,
audio {
@ -56,14 +61,14 @@
height: (@plyr-range-thumb-height * @plyr-range-thumb-active-scale);
width: 100%;
margin: 0;
padding: 0;
padding: 0;
vertical-align: middle;
appearance: none;
cursor: pointer;
border: none;
background: transparent;
// WebKit
&::-webkit-slider-runnable-track {
.plyr-range-track();
@ -81,7 +86,7 @@
&::-moz-range-thumb {
.plyr-range-thumb();
}
// Microsoft
&::-ms-track {
height: @plyr-range-track-height;
@ -99,7 +104,7 @@
&::-ms-thumb {
.plyr-range-thumb();
// For some reason, Edge uses the -webkit margin above
margin-top: 0;
margin-top: 0;
}
&::-ms-tooltip {
display: none;
@ -111,11 +116,11 @@
}
&::-moz-focus-outer {
border: 0;
}
}
&.tab-focus:focus {
outline-offset: 3px;
}
// Pressed styles
&:active {
&::-webkit-slider-thumb {
@ -168,18 +173,18 @@
position: relative;
background: #000;
border-radius: inherit;
// Cleaner radius, also forces iframe radius
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
}
// Container for embeds
.plyr__video-embed {
padding-bottom: 56.25%; /* 16:9 */
height: 0;
overflow: hidden;
border-radius: inherit;
// Require overflow and z-index to force border-radius
overflow: hidden;
z-index: 0;
iframe {
position: absolute;
top: 0;
@ -226,6 +231,8 @@
border-radius: 2px;
padding: floor(@plyr-control-spacing / 3) @plyr-control-spacing;
background: @plyr-captions-bg;
box-decoration-break: clone;
line-height: 150%;
}
span:empty {
display: none;
@ -238,12 +245,15 @@
.plyr--captions-active .plyr__captions {
display: block;
}
.plyr--fullscreen-active .plyr__captions {
font-size: @plyr-font-size-captions-large;
}
.plyr--hide-controls .plyr__captions {
transform: translateY(-(@plyr-control-spacing * 1.5));
}
// Large captions in full screen on larger screens
@media (min-width: @plyr-bp-screen-lg) {
.plyr--fullscreen-active .plyr__captions {
font-size: @plyr-font-size-captions-large;
}
}
// Controls
// --------------------------------------------------------------
@ -255,13 +265,10 @@
// Playback controls
.plyr__controls {
display: flex;
align-items: center;
align-items: center;
line-height: 1;
text-align: center;
transition: opacity .3s ease;
// Spacing
> button,
.plyr__progress,
@ -322,9 +329,10 @@
}
}
}
// Hide controls
// Hide controls
.plyr--hide-controls .plyr__controls {
opacity: 0;
pointer-events: none;
}
// Video controls
@ -333,11 +341,13 @@
left: 0;
right: 0;
bottom: 0;
z-index: 2;
padding: (@plyr-control-spacing * 5) @plyr-control-spacing @plyr-control-spacing;
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%));
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
color: @plyr-video-control-color;
transition: opacity .3s ease;
button {
// Hover and tab focus
@ -355,7 +365,6 @@
border-radius: inherit;
background: @plyr-audio-controls-bg;
border: @plyr-audio-controls-border;
box-shadow: @plyr-audio-controls-box-shadow;
color: @plyr-audio-control-color;
button {
@ -372,6 +381,7 @@
.plyr__play-large {
display: none;
position: absolute;
z-index: 1;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@ -379,7 +389,7 @@
background: @plyr-video-control-bg-hover;
border: 4px solid currentColor;
border-radius: 100%;
box-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%);
box-shadow: 0 1px 1px fade(#000, 15%);
color: @plyr-video-control-color;
transition: all .3s ease;
@ -467,7 +477,7 @@
height: 0;
left: 50%;
transform: translateX(-50%);
// The background triangle
bottom: -@plyr-tooltip-arrow-size;
border-right: @plyr-tooltip-arrow-size solid transparent;
@ -615,16 +625,16 @@
}
&::-moz-progress-bar {
transition: width .2s ease;
}
}
&::-ms-fill {
transition: width .2s ease;
}
}
}
.plyr--video .plyr__progress--buffer,
.plyr--video .plyr__volume--display {
background: @plyr-video-range-track-bg;
}
.plyr--video .plyr__progress--buffer {
.plyr--video .plyr__progress--buffer {
color: @plyr-video-progress-buffered-bg;
}
.plyr--audio .plyr__progress--buffer,
@ -664,7 +674,6 @@
display: inline-block;
vertical-align: middle;
font-size: @plyr-font-size-small;
line-height: .95;
}
// Media duration hidden on small screens
.plyr__time + .plyr__time {
@ -713,7 +722,6 @@
// Fullscreen
// --------------------------------------------------------------
.plyr--fullscreen,
.plyr--fullscreen-active {
position: fixed;
top: 0;
@ -724,7 +732,7 @@
width: 100%;
z-index: 10000000;
background: #000;
border-radius: 0;
border-radius: 0 !important;
video {
height: 100%;
@ -733,6 +741,10 @@
height: 100%;
width: 100%;
}
.plyr__video-embed {
// Revert overflow change
overflow: visible;
}
.plyr__controls {
position: absolute;
bottom: 0;

View File

@ -11,7 +11,8 @@
// Colors
@plyr-color-main: #3498db;
// Font sizes
// Font
@plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif;
@plyr-font-size-small: 14px;
@plyr-font-size-base: 16px;
@ -32,7 +33,6 @@
@plyr-video-control-bg-hover: @plyr-color-main;
@plyr-audio-controls-bg: #fff;
@plyr-audio-controls-border: 1px solid #dbe3e8;
@plyr-audio-controls-box-shadow: 0 1px 1px fade(#000, 5%);
@plyr-audio-control-color: #565D64;
@plyr-audio-control-color-hover: #fff;
@plyr-audio-control-bg-hover: @plyr-color-main;
@ -68,4 +68,5 @@
// Breakpoints
@plyr-bp-screen-sm: 480px;
@plyr-bp-screen-md: 768px;
@plyr-bp-screen-md: 768px;
@plyr-bp-screen-lg: 1024px;

View File

@ -19,7 +19,7 @@
position: relative;
max-width: 100%;
min-width: 200px;
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
font-family: $plyr-font-family;
direction: ltr;
@if $plyr-border-box == true {
@ -40,6 +40,11 @@
}
}
// Focus
&:focus {
outline: 0;
}
// Media elements
video,
audio {
@ -56,14 +61,14 @@
height: ($plyr-range-thumb-height * $plyr-range-thumb-active-scale);
width: 100%;
margin: 0;
padding: 0;
padding: 0;
vertical-align: middle;
appearance: none;
cursor: pointer;
border: none;
background: transparent;
// WebKit
&::-webkit-slider-runnable-track {
@include plyr-range-track();
@ -81,7 +86,7 @@
&::-moz-range-thumb {
@include plyr-range-thumb();
}
// Microsoft
&::-ms-track {
height: $plyr-range-track-height;
@ -99,7 +104,7 @@
&::-ms-thumb {
@include plyr-range-thumb();
// For some reason, Edge uses the -webkit margin above
margin-top: 0;
margin-top: 0;
}
&::-ms-tooltip {
display: none;
@ -111,11 +116,11 @@
}
&::-moz-focus-outer {
border: 0;
}
}
&.tab-focus:focus {
outline-offset: 3px;
}
// Pressed styles
&:active {
&::-webkit-slider-thumb {
@ -167,18 +172,18 @@
position: relative;
background: #000;
border-radius: inherit;
// Cleaner radius, also forces iframe radius
-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
}
// Container for embeds
.plyr__video-embed {
padding-bottom: 56.25%; /* 16:9 */
height: 0;
overflow: hidden;
border-radius: inherit;
// Require overflow and z-index to force border-radius
overflow: hidden;
z-index: 0;
iframe {
position: absolute;
top: 0;
@ -225,6 +230,8 @@
border-radius: 2px;
padding: floor($plyr-control-spacing / 3) $plyr-control-spacing;
background: $plyr-captions-bg;
box-decoration-break: clone;
line-height: 150%;
}
span:empty {
display: none;
@ -237,12 +244,15 @@
.plyr--captions-active .plyr__captions {
display: block;
}
.plyr--fullscreen-active .plyr__captions {
font-size: $plyr-font-size-captions-large;
}
.plyr--hide-controls .plyr__captions {
transform: translateY(-($plyr-control-spacing * 2));
}
// Large captions in full screen on larger screens
@media (min-width: $plyr-bp-screen-lg) {
.plyr--fullscreen-active .plyr__captions {
font-size: $plyr-font-size-captions-large;
}
}
// Controls
// --------------------------------------------------------------
@ -254,13 +264,10 @@
// Playback controls
.plyr__controls {
display: flex;
align-items: center;
align-items: center;
line-height: 1;
text-align: center;
transition: opacity .3s ease;
// Spacing
> button,
.plyr__progress,
@ -294,8 +301,8 @@
color: inherit;
svg {
width: 18px;
height: 18px;
width: $plyr-control-icon-size;
height: $plyr-control-icon-size;
display: block;
fill: currentColor;
}
@ -321,9 +328,10 @@
}
}
}
// Hide controls
// Hide controls
.plyr--hide-controls .plyr__controls {
opacity: 0;
pointer-events: none;
}
// Video controls
@ -337,6 +345,7 @@
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
color: $plyr-video-control-color;
transition: opacity .3s ease;
button {
// Hover and tab focus
@ -354,7 +363,6 @@
border-radius: inherit;
background: $plyr-audio-controls-bg;
border: $plyr-audio-controls-border;
box-shadow: $plyr-audio-controls-box-shadow;
color: $plyr-audio-control-color;
button {
@ -371,6 +379,7 @@
.plyr__play-large {
display: none;
position: absolute;
z-index: 1;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@ -378,7 +387,7 @@
background: $plyr-video-control-bg-hover;
border: 4px solid currentColor;
border-radius: 100%;
box-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85);
box-shadow: 0 1px 1px transparentize(#000, .85);
color: $plyr-video-control-color;
transition: all .3s ease;
@ -466,7 +475,7 @@
height: 0;
left: 50%;
transform: translateX(-50%);
// The background triangle
bottom: -$plyr-tooltip-arrow-size;
border-right: $plyr-tooltip-arrow-size solid transparent;
@ -487,7 +496,6 @@
// First tooltip
.plyr__controls button:first-child .plyr__tooltip {
$tooltip-arrow-offset: ;
left: 0;
transform: translate(0, 10px) scale(.8);
transform-origin: 0 100%;
@ -614,16 +622,16 @@
}
&::-moz-progress-bar {
transition: width .2s ease;
}
}
&::-ms-fill {
transition: width .2s ease;
}
}
}
.plyr--video .plyr__progress--buffer,
.plyr--video .plyr__volume--display {
background: $plyr-video-range-track-bg;
}
.plyr--video .plyr__progress--buffer {
.plyr--video .plyr__progress--buffer {
color: $plyr-video-progress-buffered-bg;
}
.plyr--audio .plyr__progress--buffer,
@ -663,7 +671,6 @@
display: inline-block;
vertical-align: middle;
font-size: $plyr-font-size-small;
line-height: .95;
}
// Media duration hidden on small screens
.plyr__time + .plyr__time {
@ -712,7 +719,6 @@
// Fullscreen
// --------------------------------------------------------------
.plyr--fullscreen,
.plyr--fullscreen-active {
position: fixed;
top: 0;
@ -723,7 +729,7 @@
width: 100%;
z-index: 10000000;
background: #000;
border-radius: 0;
border-radius: 0 !important;
video {
height: 100%;
@ -732,6 +738,10 @@
height: 100%;
width: 100%;
}
.plyr__video-embed {
// Revert overflow change
overflow: visible;
}
.plyr__controls {
position: absolute;
bottom: 0;

View File

@ -13,6 +13,7 @@ $plyr-sr-only-important: true !default;
$plyr-color-main: #3498db !default;
// Font sizes
$plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif !default;
$plyr-font-size-small: 14px !default;
$plyr-font-size-base: 16px !default;
@ -33,7 +34,6 @@ $plyr-video-control-color-hover: #fff !default;
$plyr-video-control-bg-hover: $plyr-color-main !default;
$plyr-audio-controls-bg: #fff !default;
$plyr-audio-controls-border: 1px solid #dbe3e8 !default;
$plyr-audio-controls-box-shadow: 0 1px 1px transparentize(#000, .95) !default;
$plyr-audio-control-color: #565D64 !default;
$plyr-audio-control-color-hover: #fff !default;
$plyr-audio-control-bg-hover: $plyr-color-main;
@ -69,4 +69,5 @@ $plyr-range-selected-bg: $plyr-color-main !default;
// Breakpoints
$plyr-bp-screen-sm: 480px !default;
$plyr-bp-screen-md: 768px !default;
$plyr-bp-screen-md: 768px !default;
$plyr-bp-screen-lg: 1024px !default;