Compare commits
114 Commits
Author | SHA1 | Date | |
---|---|---|---|
a3ed309342 | |||
08b4c09b89 | |||
a509a5e1bc | |||
bec10e7836 | |||
f9a184800b | |||
f428c3ff8b | |||
97eb40a8e3 | |||
8211631950 | |||
a17cbb0e8b | |||
8098be6f93 | |||
1c73c9fbfe | |||
978606edb4 | |||
435b5c74bf | |||
15fd7041ab | |||
1ced6b4d67 | |||
6694c1e6cf | |||
19ca906e50 | |||
12e94775d6 | |||
df7f52d885 | |||
d5b5faafbb | |||
a318e8588b | |||
51fb252cd8 | |||
86b2f61b56 | |||
232a9fe868 | |||
e8bfe73b1d | |||
ab0d762675 | |||
a6a314e011 | |||
514bdff92e | |||
745e56a3a3 | |||
130fb78b4c | |||
3718ec69ba | |||
4610f4a8c9 | |||
a8062354ec | |||
aac0a5a3a9 | |||
92b9e3400b | |||
bea513f5dd | |||
9d109bf02d | |||
fc45ab48c9 | |||
58e9b02405 | |||
b578fb4840 | |||
f18d9589eb | |||
35c6ec9461 | |||
56d9730d0a | |||
6e18bc8b31 | |||
81756a1af9 | |||
05e1ab1165 | |||
a0ddc5e6eb | |||
dc40b1f93a | |||
d7cc29f2fb | |||
0505e49038 | |||
6ff1e47341 | |||
e72a91de6e | |||
52ec4c012d | |||
ae89c92ab6 | |||
57ad124ce8 | |||
a85d45d2e5 | |||
a6f57fc034 | |||
04c9653b86 | |||
b8cdc71001 | |||
277ebf0fd1 | |||
7682d998e7 | |||
05b9b9a831 | |||
eee699cec6 | |||
3c9e9862d8 | |||
39dc651a9d | |||
4effda125a | |||
bf9de231d8 | |||
ef12332505 | |||
1b735f1727 | |||
7f7ecf852e | |||
931672895f | |||
0952bc8239 | |||
7e7508ca82 | |||
095d100ba4 | |||
c61fad51c1 | |||
7b11c6803d | |||
9b75436380 | |||
be19b72719 | |||
2fdcc18356 | |||
6425a33ccd | |||
12c5dbd290 | |||
cb591dac0c | |||
4c1cdea56e | |||
80cfabbaf9 | |||
c7d28b09c0 | |||
161dd48312 | |||
383515c1b7 | |||
98792168e4 | |||
01437a4a38 | |||
03ed86f5c2 | |||
1a745e1eaa | |||
70646ca907 | |||
af774b6f02 | |||
7a9eac093a | |||
4afd311ef6 | |||
7eec6c6739 | |||
521431e093 | |||
24bc415faf | |||
552f448ccd | |||
152e94f229 | |||
cb318dd6ad | |||
9ee0d00a35 | |||
c0909095e3 | |||
1e732694eb | |||
30922246e9 | |||
edf5a14171 | |||
1c9f7901bc | |||
1bd6ffc84d | |||
845ed000fc | |||
c7b2347ccd | |||
a2f18c4e31 | |||
37c8948d2c | |||
341fd59cf6 | |||
a6c8b7e506 |
18
.github/issue_template.md
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
- [ ] Issue does not already exist
|
||||
- [ ] Issue observed on https://plyr.io
|
||||
|
||||
### Expected behaviour
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Environment
|
||||
|
||||
- Browser:
|
||||
- Version:
|
||||
- Operating System:
|
||||
- Version:
|
||||
|
||||
### Steps to reproduce
|
||||
-
|
||||
|
||||
### Relevant links
|
8
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
### Link to related issue (if applicable)
|
||||
|
||||
### Sumary of proposed changes
|
||||
|
||||
### Task list
|
||||
|
||||
- [ ] Tested on [supported browsers](https://github.com/Selz/plyr#browser-support)
|
||||
- [ ] Gulp build completed
|
11
.jsbeautifyrc
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"html": {
|
||||
"allowed_file_extensions": []
|
||||
},
|
||||
"css": {
|
||||
"allowed_file_extensions": []
|
||||
},
|
||||
"js": {
|
||||
"allowed_file_extensions": []
|
||||
}
|
||||
}
|
@ -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.
|
||||
|
@ -15,7 +15,7 @@
|
||||
"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"
|
||||
|
10
bundles.json
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
183
changelog.md
@ -1,7 +1,146 @@
|
||||
# Changelog
|
||||
|
||||
# v1.6.16
|
||||
- Always hide standard controls (Fixes #225)
|
||||
## 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
|
||||
- Added `disableContextMenu` option to hide the right click context menu (fixes #248 and #225)
|
||||
|
||||
## v1.6.16
|
||||
- Always hide standard controls (fixes #225)
|
||||
- Fix for Tooltips overflowing (fixes #230)
|
||||
|
||||
## v1.6.15
|
||||
@ -89,18 +228,18 @@
|
||||
- Docs fixes inc controls HTML (fixes #180)
|
||||
|
||||
## v1.5.17
|
||||
- Expose YouTube and Vimeo API (docs update required) (Fixes #176)
|
||||
- Expose YouTube and Vimeo API (docs update required) (fixes #176)
|
||||
- Auto set title based on YouTube getVideoData() title property
|
||||
- Bug fix for Vimeo API change (Uncaught TypeError: Cannot read property 'value' of undefined) due to a change their end
|
||||
|
||||
## v1.5.16
|
||||
- Cancel requests on source change (Fixes #174)
|
||||
- Cancel requests on source change (fixes #174)
|
||||
|
||||
## v1.5.15
|
||||
- Fix for CustomEvent polyfill and related bug (See #172)
|
||||
- Fix for CustomEvent polyfill and related bug (see #172)
|
||||
|
||||
## v1.5.14
|
||||
- Volume storage fix (Fixes #171)
|
||||
- Volume storage fix (fixes #171)
|
||||
|
||||
## v1.5.13
|
||||
- Fix for manual caption rendering
|
||||
@ -203,11 +342,11 @@
|
||||
## v1.2.3
|
||||
- Fix for YouTube on iPhone or unsupported browsers (fallback to YouTube native)
|
||||
- Docs tidy up
|
||||
- Fullscreen for Safari fix (Fixes #96)
|
||||
- Fullscreen for Safari fix (fixes #96)
|
||||
|
||||
## v1.2.2
|
||||
- Fix for :focus keyboard vs mouse (Fixes #61)
|
||||
- Fix for caption positioning in full screen (Fixes #92)
|
||||
- Fix for :focus keyboard vs mouse (fixes #61)
|
||||
- Fix for caption positioning in full screen (fixes #92)
|
||||
|
||||
## v1.2.1
|
||||
- Tooltip bug fix
|
||||
@ -234,7 +373,7 @@
|
||||
- Bug fix for 1.1.8
|
||||
|
||||
## v1.1.8
|
||||
- setVolume API method improvements (Fixes #83)
|
||||
- setVolume API method improvements (fixes #83)
|
||||
|
||||
## v1.1.7
|
||||
- Restore classname on destroy()
|
||||
@ -243,7 +382,7 @@
|
||||
- New API methods (fixes #77), Fix for non strict mode (fixes #78)
|
||||
|
||||
## v1.1.5
|
||||
- Fix for incorrect `isFullscreen()` return value in Mozilla (Fixes #38)
|
||||
- Fix for incorrect `isFullscreen()` return value in Mozilla (fixes #38)
|
||||
|
||||
## v1.1.4
|
||||
- Minor bug fixes
|
||||
@ -267,17 +406,17 @@
|
||||
- Display duration on `metadataloaded`
|
||||
|
||||
## v1.0.30
|
||||
- Fixed bug with media longer than 60 minutes (Fixes #69)
|
||||
- Fixed bug with media longer than 60 minutes (fixes #69)
|
||||
|
||||
## v1.0.29
|
||||
- Added option to hide controls on fullscreen (default `true`) while palying, after 1s. Pause, mouse hover on progress, or focus on a child control re-shows the controls. On touch a tap of the video (which plays/pauses the video by default) is required. (Fixes #47)
|
||||
- Added option to hide controls on fullscreen (default `true`) while palying, after 1s. Pause, mouse hover on progress, or focus on a child control re-shows the controls. On touch a tap of the video (which plays/pauses the video by default) is required. (fixes #47)
|
||||
- Fixed a bug with caption toggle in 1.0.28
|
||||
|
||||
## v1.0.28
|
||||
- Added API support for browsers that don't have full plyr support (pretty much <=IE9 and `<video>` on iPhone/iPod)
|
||||
|
||||
## v1.0.27
|
||||
- Keyboard accessibility improvements (Fixes #66)
|
||||
- Keyboard accessibility improvements (fixes #66)
|
||||
|
||||
## v1.0.26
|
||||
- Fixes for SASS (cheers @brunowego)
|
||||
@ -288,29 +427,29 @@
|
||||
- Classnames for left/right controls changed
|
||||
|
||||
## v1.0.24
|
||||
- Added tooltip option to display labels as tooltips (Fixes #50)
|
||||
- Added tooltip option to display labels as tooltips (fixes #50)
|
||||
|
||||
## v1.0.23
|
||||
- Handling loading states in the UI (Fixes #36)
|
||||
- Handling loading states in the UI (fixes #36)
|
||||
|
||||
## v1.0.22
|
||||
- Added support() API method for checking mimetype support
|
||||
- Added source() API method for setting media source(s) (Fixes #44)
|
||||
- Added source() API method for setting media source(s) (fixes #44)
|
||||
- Added poster() API method for setting poster source
|
||||
- Refactored captions logic for manual captions
|
||||
|
||||
## v1.0.21
|
||||
- Added an <input type="range"> for seeking to improve experience (and support dragging) (Fixes #40, #42)
|
||||
- Icons for restart and captions improved (and some IDs changed) (Fixes #49)
|
||||
- Added an <input type="range"> for seeking to improve experience (and support dragging) (fixes #40, #42)
|
||||
- Icons for restart and captions improved (and some IDs changed) (fixes #49)
|
||||
|
||||
## v1.0.20
|
||||
- Default controls included (Fixes #45)
|
||||
- Volume changes on `input` as well as `change` (Fixes #43)
|
||||
- Volume changes on `input` as well as `change` (fixes #43)
|
||||
- Fix for undefined Play text
|
||||
- License changed to MIT
|
||||
|
||||
## v1.0.19
|
||||
- Fixed firefox fullscreen issue (Fixes #38)
|
||||
- Fixed firefox fullscreen issue (fixes #38)
|
||||
|
||||
## v1.0.18
|
||||
- Added CDN references
|
||||
@ -334,7 +473,7 @@
|
||||
- Minor tweaks
|
||||
|
||||
## v1.0.12
|
||||
- Handle native events (Issue #34)
|
||||
- Handle native events (issue #34)
|
||||
|
||||
## v1.0.11
|
||||
- Bug fixes for fullscreen mode
|
||||
|
1
demo/dist/demo.css
vendored
Normal file
1
demo/dist/demo.js
vendored
Normal 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,s=arguments.length;for(i=0;i<s;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;t<i;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;s<o;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+="",c(this,e)!==-1},u.add=function(){var e,t=arguments,i=0,s=t.length,o=!1;do e=t[i]+"",c(this,e)===-1&&(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);t!==-1;)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(e){e.number===-2146823252&&(p.enumerable=!1,o.defineProperty(s,t,p))}}else o[i].__defineGetter__&&s.__defineGetter__(t,d)}}(self)),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,i){if(t in n&&(i||t!=r)&&(r.length||t!=n.video)){switch(t){case n.video:s.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:s.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:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:s.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}r=t;for(var a=o.length-1;a>=0;a--)e(o[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 s=i[0],o=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=o.length-1;c>=0;c--)o[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,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"));
|
0
docs/dist/docs.svg → demo/dist/demo.svg
vendored
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@ -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>
|
@ -11,7 +11,7 @@
|
||||
<link rel="stylesheet" href="../dist/plyr.css">
|
||||
|
||||
<!-- Docs styles -->
|
||||
<link rel="stylesheet" href="dist/docs.css">
|
||||
<link rel="stylesheet" href="dist/demo.css">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
@ -51,19 +51,17 @@
|
||||
</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">
|
||||
<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>
|
||||
<!-- 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>
|
||||
<!-- Fallback for browsers that don't support the <video> element -->
|
||||
<a href="https://cdn.selz.com/plyr/1.5/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> © Brainfarm</small></li>
|
||||
@ -78,10 +76,10 @@
|
||||
<script src="../dist/plyr.js"></script>
|
||||
|
||||
<!-- Docs script -->
|
||||
<script src="dist/docs.js"></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/0.0.9/rangetouch.js"></script>
|
||||
<script src="https://cdn.rangetouch.com/0.0.9/rangetouch.js" async></script>
|
||||
|
||||
<!-- Sharing libary (https://shr.one) -->
|
||||
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
|
185
demo/src/js/main.js
Normal 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 – “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 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');
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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;
|
@ -1,5 +1,5 @@
|
||||
// ==========================================================================
|
||||
// HTML5 Video Player Demo Page
|
||||
// Plyr.io Demo Page
|
||||
// ==========================================================================
|
||||
|
||||
// CSS Reset
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 981 B After Width: | Height: | Size: 981 B |
Before Width: | Height: | Size: 779 B After Width: | Height: | Size: 779 B |
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 739 B |
2
dist/plyr.css
vendored
4
dist/plyr.js
vendored
1
docs/dist/docs.css
vendored
1
docs/dist/docs.js
vendored
@ -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 – “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"));
|
@ -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 – “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 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');
|
||||
}
|
76
gulpfile.js
@ -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
|
||||
@ -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");
|
||||
});
|
||||
|
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "plyr",
|
||||
"version": "1.6.16",
|
||||
"version": "2.0.9",
|
||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||
"homepage": "http://plyr.io",
|
||||
"main": "src/js/plyr.js",
|
||||
@ -27,7 +27,11 @@
|
||||
"keywords": [
|
||||
"HTML5 Video",
|
||||
"HTML5 Audio",
|
||||
"Media Player"
|
||||
"Media Player",
|
||||
"DASH",
|
||||
"Shaka",
|
||||
"WordPress",
|
||||
"HLS"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -38,7 +42,7 @@
|
||||
"url": "https://github.com/selz/plyr/issues"
|
||||
},
|
||||
"directories": {
|
||||
"doc": "docs"
|
||||
"doc": "readme.md"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
|
1956
src/js/plyr.js
@ -19,7 +19,8 @@
|
||||
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) {
|
||||
// border-box everything
|
||||
@ -39,6 +40,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Focus
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
// Media elements
|
||||
video,
|
||||
audio {
|
||||
@ -167,9 +173,6 @@
|
||||
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
|
||||
@ -177,7 +180,9 @@
|
||||
padding-bottom: 56.25%; /* 16:9 */
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
border-radius: inherit;
|
||||
|
||||
// Require z-index to force border-radius
|
||||
z-index: 0;
|
||||
|
||||
iframe {
|
||||
position: absolute;
|
||||
@ -187,6 +192,7 @@
|
||||
height: 100%;
|
||||
border: 0;
|
||||
user-select: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
// Vimeo hack
|
||||
@ -225,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;
|
||||
@ -237,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,12 +266,9 @@
|
||||
.plyr__controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
|
||||
transition: opacity .3s ease;
|
||||
|
||||
// Spacing
|
||||
> button,
|
||||
.plyr__progress,
|
||||
@ -324,6 +332,7 @@
|
||||
// Hide controls
|
||||
.plyr--hide-controls .plyr__controls {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Video controls
|
||||
@ -337,6 +346,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 +364,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 +380,7 @@
|
||||
.plyr__play-large {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
@ -378,7 +388,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;
|
||||
|
||||
@ -663,7 +673,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 +721,6 @@
|
||||
|
||||
// Fullscreen
|
||||
// --------------------------------------------------------------
|
||||
.plyr--fullscreen,
|
||||
.plyr--fullscreen-active {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
@ -723,7 +731,7 @@
|
||||
width: 100%;
|
||||
z-index: 10000000;
|
||||
background: #000;
|
||||
border-radius: 0;
|
||||
border-radius: 0 !important;
|
||||
|
||||
video {
|
||||
height: 100%;
|
||||
|
@ -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;
|
@ -19,7 +19,8 @@
|
||||
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 {
|
||||
// border-box everything
|
||||
@ -39,6 +40,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Focus
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
// Media elements
|
||||
video,
|
||||
audio {
|
||||
@ -166,9 +172,6 @@
|
||||
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
|
||||
@ -178,6 +181,9 @@
|
||||
overflow: hidden;
|
||||
border-radius: inherit;
|
||||
|
||||
// Require z-index to force border-radius
|
||||
z-index: 0;
|
||||
|
||||
iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -224,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;
|
||||
@ -236,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,12 +265,9 @@
|
||||
.plyr__controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
|
||||
transition: opacity .3s ease;
|
||||
|
||||
// Spacing
|
||||
> button,
|
||||
.plyr__progress,
|
||||
@ -293,8 +301,8 @@
|
||||
color: inherit;
|
||||
|
||||
svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
width: $plyr-control-icon-size;
|
||||
height: $plyr-control-icon-size;
|
||||
display: block;
|
||||
fill: currentColor;
|
||||
}
|
||||
@ -323,6 +331,7 @@
|
||||
// Hide controls
|
||||
.plyr--hide-controls .plyr__controls {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Video controls
|
||||
@ -336,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
|
||||
@ -353,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 {
|
||||
@ -370,6 +379,7 @@
|
||||
.plyr__play-large {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
@ -377,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;
|
||||
|
||||
@ -486,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%;
|
||||
@ -662,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 {
|
||||
@ -711,7 +719,6 @@
|
||||
|
||||
// Fullscreen
|
||||
// --------------------------------------------------------------
|
||||
.plyr--fullscreen,
|
||||
.plyr--fullscreen-active {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
@ -722,7 +729,7 @@
|
||||
width: 100%;
|
||||
z-index: 10000000;
|
||||
background: #000;
|
||||
border-radius: 0;
|
||||
border-radius: 0 !important;
|
||||
|
||||
video {
|
||||
height: 100%;
|
||||
|
@ -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;
|