Converted to SASS/SCSS

This commit is contained in:
Sam Potts 2017-12-20 15:14:05 +00:00
parent aab53fa91f
commit 6864149989
79 changed files with 7008 additions and 9976 deletions

View File

@ -30,7 +30,9 @@
"name": "error",
"message": "Use local parameter instead."
}
]
],
"array-bracket-newline": [2, { "minItems": 2 }],
"array-element-newline": [2, { "minItems": 2 }]
},
"parserOptions": {
"sourceType": "module"

View File

@ -1,7 +1,24 @@
{
"extends": ["stylelint-config-standard", "stylelint-config-prettier"],
"plugins": ["stylelint-selector-bem-pattern", "stylelint-scss"],
"extends": ["stylelint-config-sass-guidelines", "stylelint-config-prettier"],
"rules": {
"selector-class-pattern": null,
"selector-no-qualifying-type": [
true,
{
"ignore": ["attribute", "class"]
}
],
"indentation": 4,
"string-quotes": "single"
"string-quotes": "single",
"max-nesting-depth": 2,
"plugin/selector-bem-pattern": {
"preset": "bem",
"componentName": "(([a-z0-9]+(?!-$)-?)+)",
"componentSelectors": {
"initial": "\\.{componentName}(((__|--)(([a-z0-9\\[\\]'=]+(?!-$)-?)+))+)?$"
},
"ignoreSelectors": [".*\\.has-.*", ".*\\.is-.*"]
}
}
}

View File

@ -1,19 +1,16 @@
{
"plyr": {
"less": {
"plyr.css": "src/less/bundle.less"
},
"sass": {
"plyr.css": "src/scss/plyr.scss"
"plyr.css": "src/sass/plyr.scss"
},
"js": {
"plyr.js": "src/js/plyr.js"
}
},
"demo": {
"less": {
"demo.css": "demo/src/less/bundles/demo.less",
"error.css": "demo/src/less/bundles/error.less"
"sass": {
"demo.css": "demo/src/sass/bundles/demo.scss",
"error.css": "demo/src/sass/bundles/error.csss"
},
"js": {
"demo.js": "demo/src/js/demo.js"

View File

@ -1,530 +1,646 @@
# Changelog
## 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)
* 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)
* 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)
* 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)
* 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
* 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)
* 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
* 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
* Fix for Vimeo in IE9 & IE10
* Fix for HTML5 elements not firing `ready` event
## v2.0.4
- Fix for Firefox full screen (fixes #343)
* 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
* 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
* 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)
* 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 ;-)
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)
* 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
* 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)
* 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
* 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
* 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)
* Added getCurrentTime API method (fixes #292)
* Fix for !hideControls on touch devices (fixes #303)
## v1.8.7
- Line height fix
* Line height fix
## v1.8.6
- Reverted font size change
* Reverted font size change
## v1.8.5
- Fixed overflow issues (fixes #286)
* Fixed overflow issues (fixes #286)
## v1.8.4
- Fix for large play button on small videos
* 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
* 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
* Fixed event bubbling
## v1.8.1
- Fixed inaccurate log message
* 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)
* **_(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
* 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)
* Fix for multiple sprites being requested (fixes #259)
## v1.6.19
- Fix for scroll direction issues on volume control (fixes #258)
* 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)
* 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)
* 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)
* Always hide standard controls (fixes #225)
* Fix for Tooltips overflowing (fixes #230)
## v1.6.15
- Restore scroll position when exiting full screen (fixes #236)
* Restore scroll position when exiting full screen (fixes #236)
## v1.6.14
- SVG sprite loading automatically for an easier setup
- Touch devices now show controls on touch rather than pausing playback
* SVG sprite loading automatically for an easier setup
* Touch devices now show controls on touch rather than pausing playback
## v1.6.13
- Decreased sensitivity and inverted scroll on volume slider (scroll up to increase, down to decrease)
* Decreased sensitivity and inverted scroll on volume slider (scroll up to increase, down to decrease)
## v1.6.12
- Fix for undefined buffer error
- Add scroll listener on volume slider (PR #227 bty @igoradamenko)
* Fix for undefined buffer error
* Add scroll listener on volume slider (PR #227 bty @igoradamenko)
## v1.6.11
- Fix for Vimeo fullscreen (fixes #214)
* Fix for Vimeo fullscreen (fixes #214)
## v1.6.10
- Changed default icon prefix from 'icon' to 'plyr' to avoid clashes
* Changed default icon prefix from 'icon' to 'plyr' to avoid clashes
## v1.6.9
- Added 'latest' CDN option
- Renamed `sprite.svg` to `plyr.svg` to be inline with the other package files
* Added 'latest' CDN option
* Renamed `sprite.svg` to `plyr.svg` to be inline with the other package files
## v1.6.8
- Fix for bug introduced in v1.6.7
* Fix for bug introduced in v1.6.7
## v1.6.7
- Fixes for using `source` API method on iOS
* Fixes for using `source` API method on iOS
## v1.6.6
- Icons cleaned up
- IE11 button fix for tooltips (fixes #210)
* Icons cleaned up
* IE11 button fix for tooltips (fixes #210)
## v1.6.5
- IE UI bug fixes
* IE UI bug fixes
## v1.6.4
- Bug fix for undefined progress bar
* Bug fix for undefined progress bar
## v1.6.3
- Seek back to 0 for all media on ended
- Check for HTML5 video on ended reload
- Update to docs for `showPosterOnEnd` option
* Seek back to 0 for all media on ended
* Check for HTML5 video on ended reload
* Update to docs for `showPosterOnEnd` option
## v1.6.2
- Fix for tooltip displaying when duration is not set (fixes #177)
- `showPosterOnEnd` option to show poster when HTML5 video ended (fixes #59)
- Error handler for YouTube (fixes #189)
- Initial SoundCloud support (fixes #194)
- Other minor bug fixes
* Fix for tooltip displaying when duration is not set (fixes #177)
* `showPosterOnEnd` option to show poster when HTML5 video ended (fixes #59)
* Error handler for YouTube (fixes #189)
* Initial SoundCloud support (fixes #194)
* Other minor bug fixes
## v1.6.1
- Tooltip changes for accessibility
* 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
- 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
- Toggle mute bug fix; if a player was muted previously and the user refreshed, unmuting would have meant volume was still zero (effectively muted), now the config default value is used. Not ideal but good for now
- New `iconUrl` option allowing specifying a same origin SVG sprite location. Loading this way means you don't need the AJAX sprite loading JavaScript
- `click` option renamed to `clickToPlay` to make it a bit more self explanatory. Unfortunately cross origin SVG sprites is not supported in any browser yet :-(
- `hideControls` is now a global option, rather than being exclusive to fullscreen. Controls are now hidden after 2 seconds of no mouse movement. Controls are always shown when media is paused or stopped. This is defaulted to true.
- `sass` folder in `src` renamed from to `scss`
* 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 - 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
* Toggle mute bug fix; if a player was muted previously and the user refreshed, unmuting would have meant volume was still zero (effectively muted), now the config default value is used. Not ideal but good for now
* New `iconUrl` option allowing specifying a same origin SVG sprite location. Loading this way means you don't need the AJAX sprite loading JavaScript
* `click` option renamed to `clickToPlay` to make it a bit more self explanatory. Unfortunately cross origin SVG sprites is not supported in any browser yet :-(
* `hideControls` is now a global option, rather than being exclusive to fullscreen. Controls are now hidden after 2 seconds of no mouse movement. Controls are always shown when media is paused or stopped. This is defaulted to true.
* `sass` folder in `src` renamed from to `scss`
## v1.5.21
- Bug fix for embeds: `play` not being defined (fixes #185 and #186)
* Bug fix for embeds: `play` not being defined (fixes #185 and #186)
## v1.5.20
- Bug fix for autoplay option
* Bug fix for autoplay option
## v1.5.19
- Fix for accessing `embed` property after `ready` event fired
* Fix for accessing `embed` property after `ready` event fired
## v1.5.18
- Added 'ready' event for initial setup complete or source change occurs
- Fixed SASS stylesheet references to transparentize
- Added default font stack to controls
- Docs fixes inc controls HTML (fixes #180)
* Added 'ready' event for initial setup complete or source change occurs
* Fixed SASS stylesheet references to transparentize
* Added default font stack to controls
* Docs fixes inc controls HTML (fixes #180)
## v1.5.17
- 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
* 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
* Fix for manual caption rendering
## v1.5.12
- Added a duration option to pass the duration of the file
- Added the ability to set options per element by setting a data-plyr attribute on the target elements (this might be useful for the duration option for example)
- Fixes for Chrome and Safari caption rendering, they now use the default texttrack and cuechange events
- Firefox bug fix for event not defined
* Added a duration option to pass the duration of the file
* Added the ability to set options per element by setting a data-plyr attribute on the target elements (this might be useful for the duration option for example)
* Fixes for Chrome and Safari caption rendering, they now use the default texttrack and cuechange events
* Firefox bug fix for event not defined
## v1.5.11
- iOS embed bug fixes (fixes #166)
- Hide IE/Edge <input type='range'> tooltip (since we have a styled one) (fixes #160)
- SASS bug fix for default values (fixes #158)
* iOS embed bug fixes (fixes #166)
* Hide IE/Edge <input type='range'> tooltip (since we have a styled one) (fixes #160)
* SASS bug fix for default values (fixes #158)
## v1.5.9 + v1.5.10
- NPM bug fixes
* NPM bug fixes
## v1.5.8
- Fix for touch device seek tooltip
- Seek improvements
* Fix for touch device seek tooltip
* Seek improvements
## v1.5.7
- Fix for control tooltips always showing
* Fix for control tooltips always showing
## v1.5.6
- Seek tooltip (option for tooltips changed, please check docs)
- SASS compile error fixes (fixes #148)
- Fullscreen fixes for controls not always hiding/showing (fixes #149)
- Screen reader icon fixes (title was being read twice due to the tooltip/hidden label)
* Seek tooltip (option for tooltips changed, please check docs)
* SASS compile error fixes (fixes #148)
* Fullscreen fixes for controls not always hiding/showing (fixes #149)
* Screen reader icon fixes (title was being read twice due to the tooltip/hidden label)
## v1.5.5
- Fixed controls.md example
- Bug fix for docs error page
- Bug fix for controls tooltips
* Fixed controls.md example
* Bug fix for docs error page
* Bug fix for controls tooltips
## v1.5.4
- Minor bug fix for clicking video to play/pause after source change
* Minor bug fix for clicking video to play/pause after source change
## v1.5.3
- Minor bug fix for occasional display of 0:00 as the media duration
* Minor bug fix for occasional display of 0:00 as the media duration
## v1.5.2
- `handlers` option renamed to `listeners`
- Added event listeners for all types to the plyr container (playback, fullscreen, captions etc - see docs)
- Removed onSetup config option (use the 'setup' event instead, plyr element is event.plyr)
- Style bug fixes
- Vimeo seek bug fix (requires whole seconds when seeking)
- Fix for fullscreen player (using class hook, not browser fullscreen)
* `handlers` option renamed to `listeners`
* Added event listeners for all types to the plyr container (playback, fullscreen, captions etc - see docs)
* Removed onSetup config option (use the 'setup' event instead, plyr element is event.plyr)
* Style bug fixes
* Vimeo seek bug fix (requires whole seconds when seeking)
* Fix for fullscreen player (using class hook, not browser fullscreen)
## v1.5.1
- Fix for event listeners being duplicated on source change
* Fix for event listeners being duplicated on source change
# v1.5.0
- Vimeo support (fixes #8)
- New options for initialization (you can now pass a selector, HTMLElement or NodeList) (fixes #118)
- Switched to BEM methodology (you will need to change CSS and probably HTML)
- Decoupled CSS and JS hooks (fixes #129)
- Custom controls container (fixes #98)
- Fix for private/incognito mode local storage bug (fixes #131)
- UMD module setup (fixes #121)
- Specify iframe title for Vimeo and YouTube (fixes #124)
- Better handling of mission controls (fixes #132)
- Retain classname on source change (fixes #120)
- Increased thumb size on seek (partially fixes #130)
- Passing no argument to `source` api method, now returns current source (by @gurupras)
- Ability to add custom handlers to controls prior to Plyr bindings (by @gurupras)
- Keyboard navigation improvements (focus on seek, focus trap in fullscreen) (fixes #135)
* Vimeo support (fixes #8)
* New options for initialization (you can now pass a selector, HTMLElement or NodeList) (fixes #118)
* Switched to BEM methodology (you will need to change CSS and probably HTML)
* Decoupled CSS and JS hooks (fixes #129)
* Custom controls container (fixes #98)
* Fix for private/incognito mode local storage bug (fixes #131)
* UMD module setup (fixes #121)
* Specify iframe title for Vimeo and YouTube (fixes #124)
* Better handling of mission controls (fixes #132)
* Retain classname on source change (fixes #120)
* Increased thumb size on seek (partially fixes #130)
* Passing no argument to `source` api method, now returns current source (by @gurupras)
* Ability to add custom handlers to controls prior to Plyr bindings (by @gurupras)
* Keyboard navigation improvements (focus on seek, focus trap in fullscreen) (fixes #135)
## v1.3.5
- Fixed bug with API use on basic supported browsers
* Fixed bug with API use on basic supported browsers
## v1.3.4
- Code cleanup by @calvintam236
* Code cleanup by @calvintam236
## v1.3.3
- Removed captions being read by screen readers
* Removed captions being read by screen readers
## v1.3.2
- Voiceover fix for captions
* Voiceover fix for captions
## v1.3.1
- ARIA improvements for captions being read
* ARIA improvements for captions being read
## v1.3.0
- Internationalization support (i18n) using default controls (required markup changes to controls)
- ARIA enhancements for controls (required markup changes to controls)
- Captions legibility improvements
- YouTube bug fixes
* Internationalization support (i18n) using default controls (required markup changes to controls)
* ARIA enhancements for controls (required markup changes to controls)
* Captions legibility improvements
* YouTube bug fixes
## v1.2.6
- SASS updates and fixes (cheers @ChristianPV)
* SASS updates and fixes (cheers @ChristianPV)
## v1.2.5
- Fix for YouTube quality (let them decide quality)
* Fix for YouTube quality (let them decide quality)
## v1.2.4
- Fix for omitted kind attribute on <track> (fixes #88)
* Fix for omitted kind attribute on <track> (fixes #88)
## v1.2.3
- Fix for YouTube on iPhone or unsupported browsers (fallback to YouTube native)
- Docs tidy up
- Fullscreen for Safari fix (fixes #96)
* Fix for YouTube on iPhone or unsupported browsers (fallback to YouTube native)
* Docs tidy up
* 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
* Tooltip bug fix
# v1.2.0
- Added YouTube support
* Added YouTube support
## v1.1.13
- Added icon prefix option for when using default controls
* Added icon prefix option for when using default controls
## v1.1.13
- Logic tweaks for hiding controls in fullscreen
* Logic tweaks for hiding controls in fullscreen
## v1.1.12
- Bug fix for Chrome Canary
* Bug fix for Chrome Canary
## v1.1.11
- Bug fix
* Bug fix
## v1.1.10
- Bug fix
* Bug fix
## v1.1.9
- Bug fix for 1.1.8
* 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()
* Restore classname on destroy()
## v1.1.6
- New API methods (fixes #77), Fix for non strict mode (fixes #78)
* 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
* Minor bug fixes
## v1.1.3
- Fixes for random id used in controls with multiple instances and one call to setup
- Audio player UI improvements
* Fixes for random id used in controls with multiple instances and one call to setup
* Audio player UI improvements
## v1.1.2
- Added an onSetup callback option
- Added fullscreen API methods `toggleFullscreen()` (must be user iniated), and `isFullscreen()`
* Added an onSetup callback option
* Added fullscreen API methods `toggleFullscreen()` (must be user iniated), and `isFullscreen()`
## v1.1.1
- Fix for unsupported browser handling
- Fix for config.controls having no effect
* Fix for unsupported browser handling
* Fix for config.controls having no effect
## v1.1.0
- Added config option to set which controls are shown (if using the default controls html) and better handling of missing controls
* Added config option to set which controls are shown (if using the default controls html) and better handling of missing controls
## v1.0.31
- Display duration on `metadataloaded`
* 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)
- Fixed a bug with caption toggle in 1.0.28
* 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)
* 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)
- Indentation reset to 4 spaces
* Fixes for SASS (cheers @brunowego)
* Indentation reset to 4 spaces
## v1.0.25
- Fixes for iOS volume controls (hidden)
- Classnames for left/right controls changed
* Fixes for iOS volume controls (hidden)
* 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 poster() API method for setting poster source
- Refactored captions logic for manual captions
* Added support() API method for checking mimetype support
* 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)
- Fix for undefined Play text
- License changed to MIT
* Default controls included (Fixes #45)
* Volume changes on `input` as well as `change` (fixes #43)
* Fix for undefined Play text
* License changed to MIT
## v1.0.19
- Fixed firefox fullscreen issue (fixes #38)
* Fixed firefox fullscreen issue (fixes #38)
## v1.0.18
- Added CDN references
* Added CDN references
## v1.0.17
- SASS support added (thanks to @brunowego)
- Docs completely separated to avoid any confusion
- New gulp tasks (will add more documentation for this)
* SASS support added (thanks to @brunowego)
* Docs completely separated to avoid any confusion
* New gulp tasks (will add more documentation for this)
## v1.0.16
- Aria label is now dynamic
* Aria label is now dynamic
## v1.0.15
- Fix for seek time display in controls
- More documentation for controls html
* Fix for seek time display in controls
* More documentation for controls html
## v1.0.14
- Minor change for bootstrap compatibility
* Minor change for bootstrap compatibility
## v1.0.13
- Minor tweaks
* Minor tweaks
## v1.0.12
- Handle native events (issue #34)
* Handle native events (issue #34)
## v1.0.11
- Bug fixes for fullscreen mode
* Bug fixes for fullscreen mode
## v1.0.10
- Bower includes src files now
- Folder re-arrangement
* Bower includes src files now
* Folder re-arrangement
## v1.0.9
- Added buffer progress bar
- Fixed Safari 8 caption track (it needs to be removed from the DOM like in Safari 7)
- Added validation (it works or it doesn't basically) of the `html` option passed
* Added buffer progress bar
* Fixed Safari 8 caption track (it needs to be removed from the DOM like in Safari 7)
* Added validation (it works or it doesn't basically) of the `html` option passed
## v1.0.8
- Bug fix
* Bug fix
## v1.0.7
- Storing user selected volume in local storage
* Storing user selected volume in local storage
## v1.0.6
- Fullscreen fallback for older browsers to use "full window"
* Fullscreen fallback for older browsers to use "full window"
## v1.0.5
- More minor bug fixes and improvements
* More minor bug fixes and improvements
## v1.0.4
- Fixed caption legibility issues
* Fixed caption legibility issues
## v1.0.3
- Minor bug fixes
* Minor bug fixes
## v1.0.2
- Added OGG to <audio> example for Firefox
- Fixed IE11 fullscreen issues
* Added OGG to <audio> example for Firefox
* Fixed IE11 fullscreen issues
## v1.0.1
- Bug fixes for IE (as per usual)
- Added CSS hooks for media type
- Return instances of Plyr to the element
* Bug fixes for IE (as per usual)
* Added CSS hooks for media type
* Return instances of Plyr to the element
## v1.0.0
- Initial release
* Initial release

2
demo/dist/demo.css vendored

File diff suppressed because one or more lines are too long

2
demo/dist/demo.js vendored
View File

@ -1,3 +1,3 @@
document.addEventListener("DOMContentLoaded",function(){function e(e,t,o){e&&e.classList[o?"add":"remove"](t)}function t(t,n){if(t in r&&(n||t!==a)&&(a.length||t!==r.video)){switch(t){case r.video:o.source={type:"video",title:"View From A Blue Moon",sources:[{src:"media/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"}],poster:"media/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"media/View_From_A_Blue_Moon_Trailer-HD.en.vtt",default:!0},{kind:"captions",label:"French",srclang:"fr",src:"media/View_From_A_Blue_Moon_Trailer-HD.fr.vtt"}]};break;case r.audio:o.source={type:"audio",title:"Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;",sources:[{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]};break;case r.youtube:o.source={type:"video",title:"View From A Blue Moon",sources:[{src:"https://youtube.com/watch?v=bTqVqk7FSmY",provider:"youtube"}]};break;case r.vimeo:o.source={type:"video",sources:[{src:"https://vimeo.com/76979871",provider:"vimeo"}]}}a=t,Array.from(i).forEach(function(t){return e(t.parentElement,"active",!1)}),e(document.querySelector('[data-source="'+t+'"]'),"active",!0),Array.from(document.querySelectorAll(".plyr__cite")).forEach(function(e){e.setAttribute("hidden","")}),document.querySelector(".plyr__cite--"+t).removeAttribute("hidden")}}window.shr&&window.shr.setup({count:{classname:"button__count"}});document.addEventListener("focusout",function(e){e.target.classList.remove("tab-focus")}),document.addEventListener("keydown",function(e){9===e.keyCode&&window.setTimeout(function(){document.activeElement.classList.add("tab-focus")},0)});var o=new window.Plyr("#player",{debug:!0,title:"View From A Blue Moon",iconUrl:"../dist/plyr.svg",keyboard:{global:!0},tooltips:{controls:!0},captions:{active:!0},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","fullscreen","pip","airplay"],keys:{google:"AIzaSyDrNwtN3nLH_8rjCmu5Wq3ZCm4MNAVdc0c"}});window.player=o;var i=document.querySelectorAll("[data-source]"),r={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},a=window.location.hash.replace("#",""),n=window.history&&window.history.pushState;if(Array.from(i).forEach(function(e){e.addEventListener("click",function(){var o=e.getAttribute("data-source");t(o),n&&window.history.pushState({type:o},"","#"+o)})}),window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),n){var s=!a.length;s&&(a=r.video),a in r&&window.history.replaceState({type:a},"",s?"":"#"+a),a!==r.video&&t(a,!0)}}),"plyr.io"===window.location.host&&(!function(e,t,o,i,r,a,n){e.GoogleAnalyticsObject="ga",e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,a=t.createElement("script"),n=t.getElementsByTagName("script")[0],a.async=1,a.src="//www.google-analytics.com/analytics.js",n.parentNode.insertBefore(a,n)}(window,document),window.ga("create","UA-40881672-11","auto"),window.ga("send","pageview"));
document.addEventListener("DOMContentLoaded",function(){function e(e,t,o){e&&e.classList[o?"add":"remove"](t)}function t(t,o){if(t in a&&(o||t!==n)&&(n.length||t!==a.video)){switch(t){case a.video:i.source={type:"video",title:"View From A Blue Moon",sources:[{src:"media/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"}],poster:"media/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"media/View_From_A_Blue_Moon_Trailer-HD.en.vtt",default:!0},{kind:"captions",label:"French",srclang:"fr",src:"media/View_From_A_Blue_Moon_Trailer-HD.fr.vtt"}]};break;case a.audio:i.source={type:"audio",title:"Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;",sources:[{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.plyr.io/static/demo/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]};break;case a.youtube:i.source={type:"video",title:"View From A Blue Moon",sources:[{src:"https://youtube.com/watch?v=bTqVqk7FSmY",provider:"youtube"}]};break;case a.vimeo:i.source={type:"video",sources:[{src:"https://vimeo.com/76979871",provider:"vimeo"}]}}n=t,Array.from(r).forEach(function(t){return e(t.parentElement,"active",!1)}),e(document.querySelector('[data-source="'+t+'"]'),"active",!0),Array.from(document.querySelectorAll(".plyr__cite")).forEach(function(e){e.setAttribute("hidden","")}),document.querySelector(".plyr__cite--"+t).removeAttribute("hidden")}}window.shr&&window.shr.setup({count:{classname:"button__count"}});var o="tab-focus";document.addEventListener("focusout",function(e){e.target.classList.remove(o)}),document.addEventListener("keydown",function(e){9===e.keyCode&&window.setTimeout(function(){document.activeElement.classList.add(o)},0)});var i=new window.Plyr("#player",{debug:!0,title:"View From A Blue Moon",iconUrl:"../dist/plyr.svg",keyboard:{global:!0},tooltips:{controls:!0},captions:{active:!0},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","fullscreen","pip","airplay"],keys:{google:"AIzaSyDrNwtN3nLH_8rjCmu5Wq3ZCm4MNAVdc0c"}});window.player=i;var r=document.querySelectorAll("[data-source]"),a={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},n=window.location.hash.replace("#",""),s=window.history&&window.history.pushState;if(Array.from(r).forEach(function(e){e.addEventListener("click",function(){var o=e.getAttribute("data-source");t(o),s&&window.history.pushState({type:o},"","#"+o)})}),window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),s){var c=!n.length;c&&(n=a.video),n in a&&window.history.replaceState({type:n},"",c?"":"#"+n),n!==a.video&&t(n,!0)}}),"plyr.io"===window.location.host&&(!function(e,t,o,i,r,a,n){e.GoogleAnalyticsObject="ga",e.ga=e.ga||function(){(e.ga.q=e.ga.q||[]).push(arguments)},e.ga.l=1*new Date,a=t.createElement("script"),n=t.getElementsByTagName("script")[0],a.async=1,a.src="//www.google-analytics.com/analytics.js",n.parentNode.insertBefore(a,n)}(window,document),window.ga("create","UA-40881672-11","auto"),window.ga("send","pageview"));
//# sourceMappingURL=demo.js.map

File diff suppressed because one or more lines are too long

1
demo/dist/error.css vendored

File diff suppressed because one or more lines are too long

View File

@ -1,9 +0,0 @@
// ==========================================================================
// Breakpoints
// ==========================================================================
@screen-sm: 480px;
@screen-md: 768px;
@mq-sm: ~'only screen and (min-width: @{screen-sm}) ';
@mq-md: ~'only screen and (min-width: @{screen-md}) ';

View File

@ -1,27 +0,0 @@
// ==========================================================================
// Colors
// ==========================================================================
// Greyscale
@gray-dark: #343f4a;
@gray: #55646b;
@gray-light: #cbd0d3;
@gray-lighter: #dbe3e8;
@off-white: #f2f5f7;
// Text
@color-text: #fff;
// Plyr
@color-brand-primary: #1aafff;
// Brands
@color-twitter: #4baaf4;
@color-youtube: #cc181e;
@color-vimeo: #19b7ed;
// Elements
@color-link: #fff;
// Focus
@tab-focus-default-color: #fff;

View File

@ -1,18 +0,0 @@
// ==========================================================================
// Plyr Settings
// ==========================================================================
// Font
@plyr-font-family: inherit;
// Sizes
@plyr-font-size-base: 13px;
@plyr-font-size-small: 12px;
@plyr-font-size-time: 11px;
@plyr-font-size-badges: 9px;
// Captions
@plyr-font-size-captions-base: @plyr-font-size-base;
@plyr-font-size-captions-small: @plyr-font-size-small;
@plyr-font-size-captions-medium: 18px;
@plyr-font-size-captions-large: 21px;

View File

@ -1,20 +0,0 @@
// ==========================================================================
// Typography
// ==========================================================================
@font-sans-serif: 'Gordita', 'Avenir', 'Helvetica Neue', sans-serif;
@font-size-base: 15;
@font-size-small: 13;
@font-size-large: 18;
@font-size-h1: 64;
@font-weight-light: 300;
@font-weight-regular: 400;
@font-weight-medium: 500;
@font-weight-bold: 600;
@font-weight-black: 900;
@line-height-base: 1.75;
@letter-spacing-headings: -0.025em;

View File

@ -3,12 +3,6 @@
// ==========================================================================
@charset 'UTF-8';
// Libs
@import '../lib/fontface';
@import '../lib/animation';
@import '../lib/mixins';
@import '../lib/normalize';
// Settings
@import '../settings/breakpoints';
@import '../settings/colors';
@ -19,6 +13,12 @@
@import '../settings/spacing';
@import '../settings/type';
// Libs
@import '../lib/fontface';
@import '../lib/animation';
@import '../lib/mixins';
@import '../lib/normalize';
// Layout
@import '../layout/core';
@import '../layout/grid';
@ -37,5 +37,5 @@
@import '../components/players';
// Plyr
@import '../../../../src/less/bundle';
@import '../settings/plyr';
@import '../../../../src/sass/bundle';

View File

@ -5,30 +5,30 @@
// Shared
.button,
.button__count {
position: relative;
display: inline-flex;
vertical-align: middle;
align-items: center;
padding: (@spacing-base * 0.75);
border-radius: @border-radius-base;
box-shadow: 0 1px 1px fade(#000, 10%);
background: #fff;
border: 0;
user-select: none;
border-radius: $border-radius-base;
box-shadow: 0 1px 1px rgba(#000, 0.1);
color: $gray;
display: inline-flex;
padding: ($spacing-base * 0.75);
position: relative;
text-shadow: none;
color: @gray;
user-select: none;
vertical-align: middle;
}
// Buttons
.button {
padding-left: @spacing-base;
padding-right: @spacing-base;
font-weight: $font-weight-bold;
padding-left: $spacing-base;
padding-right: $spacing-base;
transition: all 0.2s ease;
font-weight: @font-weight-bold;
&:hover,
&:focus {
color: @gray-dark;
color: $gray-dark;
// Remove the underline/border
&::after {
@ -37,8 +37,8 @@
}
&:hover {
box-shadow: 0 2px 2px rgba(#000, 0.1);
transform: translateY(-1px);
box-shadow: 0 2px 2px fade(#000, 10%);
}
&:focus {
@ -46,7 +46,7 @@
}
&.tab-focus {
.tab-focus();
@include tab-focus();
}
&:active {
@ -65,19 +65,19 @@
// Count bubble
.button__count {
margin-left: (@spacing-base / 2);
animation: fadein 0.2s ease;
margin-left: ($spacing-base / 2);
&::before {
border: $arrow-size solid transparent;
border-left-width: 0;
border-right-color: #fff;
content: '';
position: absolute;
width: 0;
height: 0;
position: absolute;
right: 100%;
top: 50%;
transform: translateY(-50%);
border: @arrow-size solid transparent;
border-right-color: #fff;
border-left-width: 0;
width: 0;
}
}

View File

@ -3,17 +3,17 @@
// ==========================================================================
header {
padding-bottom: @spacing-base;
padding-bottom: $spacing-base;
text-align: center;
.call-to-action {
margin-top: (@spacing-base * 1.5);
margin-top: ($spacing-base * 1.5);
}
@media @mq-md {
@media only screen and (min-width: $screen-md) {
margin-right: ($spacing-base * 3);
max-width: 360px;
margin-right: (@spacing-base * 3);
padding-bottom: (@spacing-base * 2);
padding-bottom: ($spacing-base * 2);
text-align: left;
}
}

View File

@ -5,9 +5,9 @@
// Base size icon styles
.icon {
fill: currentColor;
width: @icon-size;
height: @icon-size;
height: $icon-size;
vertical-align: -3px;
width: $icon-size;
}
// Within elements
@ -19,5 +19,5 @@ label svg {
a .icon,
.btn .icon {
margin-right: floor(@spacing-base / 3);
margin-right: floor($spacing-base / 3);
}

View File

@ -4,30 +4,29 @@
// Make a <button> look like an <a>
button.faux-link {
.cancel-button-styles();
&:extend(a all);
@extend a; // stylelint-disable-line
@include cancel-button-styles();
}
// Links
a {
position: relative;
border-bottom: 1px dotted currentColor;
transition: all 0.2s ease;
color: $color-link;
font-weight: $font-weight-bold;
position: relative;
text-decoration: none;
color: @color-link;
font-weight: @font-weight-bold;
transition: all 0.2s ease;
&::after {
background: currentColor;
content: '';
height: 1px;
left: 50%;
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 1px;
transition: width 0.2s ease;
background: currentColor;
width: 0;
}
&:hover,
@ -41,6 +40,6 @@ a {
}
&.tab-focus {
.tab-focus();
@include tab-focus();
}
}

View File

@ -5,5 +5,5 @@
nav {
display: flex;
justify-content: center;
margin-bottom: @spacing-base;
margin-bottom: $spacing-base;
}

View File

@ -10,9 +10,9 @@ video {
// Example players
.plyr {
margin: @spacing-base auto;
border-radius: @border-radius-base;
box-shadow: 0 2px 5px fade(#000, 20%);
border-radius: $border-radius-base;
box-shadow: 0 2px 5px rgba(#000, 0.2);
margin: $spacing-base auto;
&.plyr--audio {
max-width: 480px;
@ -20,24 +20,24 @@ video {
}
.plyr__video-wrapper::after {
border: 1px solid rgba(#000, 0.15);
border-radius: inherit;
bottom: 0;
content: '';
left: 0;
pointer-events: none;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
border: 1px solid fade(#000, 15%);
border-radius: inherit;
top: 0;
}
// Style full supported player
.plyr__cite {
display: none;
margin-top: @spacing-base;
margin-top: $spacing-base;
.icon {
margin-right: ceil(@spacing-base / 6);
margin-right: ceil($spacing-base / 6);
}
}

View File

@ -2,12 +2,6 @@
// Core
// ==========================================================================
*,
*::after,
*::before {
box-sizing: border-box;
}
html,
body {
display: flex;
@ -15,16 +9,16 @@ body {
}
html {
background: @page-background;
background: $page-background;
background-attachment: fixed;
height: 100%;
}
body {
display: flex;
min-height: 100%;
align-items: center;
display: flex;
flex-direction: column;
min-height: 100%;
}
.grid {
@ -38,21 +32,21 @@ main {
}
aside {
position: relative;
align-items: center;
background: #fff;
color: $gray;
display: flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 100%;
padding: (@spacing-base * 0.75);
background: #fff;
padding: ($spacing-base * 0.75);
position: relative;
text-align: center;
color: @gray;
text-shadow: none;
width: 100%;
.icon {
margin-right: (@spacing-base / 2);
fill: @color-twitter;
fill: $color-twitter;
margin-right: ($spacing-base / 2);
}
p {
@ -60,10 +54,10 @@ aside {
}
a {
color: @color-twitter;
color: $color-twitter;
&.tab-focus {
.tab-focus(@color-twitter);
@include tab-focus($color-twitter);
}
}
}

View File

@ -9,22 +9,22 @@ html.error,
}
html.error {
background: @page-background;
background: $page-background;
background-attachment: fixed;
}
.error body {
width: 100%;
display: flex;
align-items: center;
display: flex;
width: 100%;
}
.error main {
width: 100%;
padding: @spacing-base;
padding: $spacing-base;
text-align: center;
width: 100%;
p {
.font-size(@font-size-large);
@include font-size($font-size-large);
}
}

View File

@ -4,13 +4,13 @@
.grid {
margin: 0 auto;
padding: @spacing-base;
padding: $spacing-base;
@media @mq-md {
display: flex;
@media only screen and (min-width: $screen-md) {
align-items: center;
display: flex;
max-width: $container-max-width;
width: 100%;
max-width: @container-max-width;
> * {
flex: 1;

View File

@ -7,7 +7,6 @@
0% {
opacity: 0;
}
100% {
opacity: 1;
}

View File

@ -0,0 +1,79 @@
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
// decimal-round(0.333, 1) => 0.3
// decimal-round(0.333, 2) => 0.33
// decimal-round(0.666) => 1
// decimal-round(0.666, 1) => 0.7
// decimal-round(0.666, 2) => 0.67
//
@function decimal-round ($number, $digits: 0, $mode: round) {
$n: 1;
// $number must be a number
@if type-of($number) != number {
@warn '#{ $number } is not a number.';
@return $number;
}
// $digits must be a unitless number
@if type-of($digits) != number {
@warn '#{ $digits } is not a number.';
@return $number;
} @else if not unitless($digits) {
@warn '#{ $digits } has a unit.';
@return $number;
}
@for $i from 1 through $digits {
$n: $n * 10;
}
@if $mode == round {
@return round($number * $n) / $n;
} @else if $mode == ceil {
@return ceil($number * $n) / $n;
} @else if $mode == floor {
@return floor($number * $n) / $n;
} @else {
@warn '#{ $mode } is undefined keyword.';
@return $number;
}
}
// Ceil a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @return {Number} A ceiled number
// @example
// decimal-ceil(0.333) => 1
// decimal-ceil(0.333, 1) => 0.4
// decimal-ceil(0.333, 2) => 0.34
// decimal-ceil(0.666) => 1
// decimal-ceil(0.666, 1) => 0.7
// decimal-ceil(0.666, 2) => 0.67
//
@function decimal-ceil ($number, $digits: 0) {
@return decimal-round($number, $digits, ceil);
}
// Floor a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @return {Number} A floored number
// @example
// decimal-floor(0.333) => 0
// decimal-floor(0.333, 1) => 0.3
// decimal-floor(0.333, 2) => 0.33
// decimal-floor(0.666) => 0
// decimal-floor(0.666, 1) => 0.6
// decimal-floor(0.666, 2) => 0.66
//
@function decimal-floor ($number, $digits: 0) {
@return decimal-round($number, $digits, floor);
}

View File

@ -3,43 +3,43 @@
// ==========================================================================
@font-face {
font-family: 'Gordita';
src: url('https://cdn.plyr.io/static/fonts/gordita-light.woff2') format('woff2'), url('https://cdn.plyr.io/static/fonts/gordita-light.woff') format('woff');
font-weight: @font-weight-light;
font-style: normal;
font-display: swap;
font-family: 'Gordita';
font-style: normal;
font-weight: $font-weight-light;
src: url('https://cdn.plyr.io/static/fonts/gordita-light.woff2') format('woff2'), url('https://cdn.plyr.io/static/fonts/gordita-light.woff') format('woff');
}
@font-face {
font-display: swap;
font-family: 'Gordita';
font-style: normal;
font-weight: $font-weight-regular;
src: url('https://cdn.plyr.io/static/fonts/gordita-regular.woff2') format('woff2'),
url('https://cdn.plyr.io/static/fonts/gordita-regular.woff') format('woff');
font-weight: @font-weight-regular;
font-style: normal;
font-display: swap;
}
@font-face {
font-display: swap;
font-family: 'Gordita';
font-style: normal;
font-weight: $font-weight-medium;
src: url('https://cdn.plyr.io/static/fonts/gordita-medium.woff2') format('woff2'),
url('https://cdn.plyr.io/static/fonts/gordita-medium.woff') format('woff');
font-weight: @font-weight-medium;
font-style: normal;
font-display: swap;
}
@font-face {
font-display: swap;
font-family: 'Gordita';
font-style: normal;
font-weight: $font-weight-bold;
src: url('https://cdn.plyr.io/static/fonts/gordita-bold.woff2') format('woff2'), url('https://cdn.plyr.io/static/fonts/gordita-bold.woff') format('woff');
font-weight: @font-weight-bold;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Gordita';
src: url('https://cdn.plyr.io/static/fonts/gordita-black.woff2') format('woff2'), url('https://cdn.plyr.io/static/fonts/gordita-black.woff') format('woff');
font-weight: @font-weight-black;
font-style: normal;
font-display: swap;
font-family: 'Gordita';
font-style: normal;
font-weight: $font-weight-black;
src: url('https://cdn.plyr.io/static/fonts/gordita-black.woff2') format('woff2'), url('https://cdn.plyr.io/static/fonts/gordita-black.woff') format('woff');
}

View File

@ -4,47 +4,48 @@
// Convert a <button> into an <a>
// ---------------------------------------
.cancel-button-styles() {
position: relative;
@mixin cancel-button-styles() {
background: transparent;
border: 0;
border-radius: 0;
cursor: pointer;
font: inherit;
line-height: $line-height-base;
margin: 0;
padding: 0;
width: auto;
border: 0;
background: transparent;
vertical-align: baseline;
position: relative;
text-align: inherit;
font: inherit;
line-height: @line-height-base;
cursor: pointer;
-moz-user-select: text;
text-shadow: inherit;
border-radius: 0;
-moz-user-select: text; // stylelint-disable-line
vertical-align: baseline;
width: auto;
}
// Nicer focus styles
// ---------------------------------------
.tab-focus(@color: @tab-focus-default-color) {
@mixin tab-focus($color: $tab-focus-default-color) {
box-shadow: 0 0 0 3px rgba($color, 0.35);
outline: 0;
box-shadow: 0 0 0 3px fade(@color, 35%);
}
// Use rems for font sizing
// Leave <body> at 100%/16px
// ---------------------------------------
.font-size(@font-size: 16) {
@rem: round((@font-size / 16), 3);
@mixin font-size($font-size: 16) {
$rem: decimal-round(($font-size / 16), 3);
font-size: (@font-size * 1px);
font-size: ~'@{rem}rem';
font-size: ($font-size * 1px);
font-size: '#{$rem}rem';
}
// Font smoothing
// ---------------------------------------
.font-smoothing(@mode: on) when (@mode = on) {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
.font-smoothing(@mode: on) when (@mode = off) {
-moz-osx-font-smoothing: auto;
-webkit-font-smoothing: subpixel-antialiased;
@mixin font-smoothing($enabled: true) {
@if $enabled {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
} @else {
-moz-osx-font-smoothing: auto;
-webkit-font-smoothing: subpixel-antialiased;
}
}

View File

@ -0,0 +1,6 @@
// ==========================================================================
// Breakpoints
// ==========================================================================
$screen-sm: 480px;
$screen-md: 768px;

View File

@ -0,0 +1,27 @@
// ==========================================================================
// Colors
// ==========================================================================
// Greyscale
$gray-dark: #343f4a;
$gray: #55646b;
$gray-light: #cbd0d3;
$gray-lighter: #dbe3e8;
$off-white: #f2f5f7;
// Text
$color-text: #fff;
// Plyr
$color-brand-primary: #1aafff;
// Brands
$color-twitter: #4baaf4;
$color-youtube: #cc181e;
$color-vimeo: #19b7ed;
// Elements
$color-link: #fff;
// Focus
$tab-focus-default-color: #fff;

View File

@ -3,10 +3,10 @@
// ==========================================================================
// Button count arrow size
@arrow-size: 5px;
$arrow-size: 5px;
// Radii
@border-radius-base: 4px;
$border-radius-base: 4px;
// Background
@page-background: linear-gradient(to left top, lighten(@color-brand-primary, 10%), darken(@color-brand-primary, 20%));
$page-background: linear-gradient(to left top, lighten($color-brand-primary, 10%), darken($color-brand-primary, 20%));

View File

@ -2,4 +2,4 @@
// Icons
// ==========================================================================
@icon-size: 16px;
$icon-size: 16px;

View File

@ -2,4 +2,4 @@
// Layout
// ==========================================================================
@container-max-width: 1280px;
$container-max-width: 1280px;

View File

@ -0,0 +1,18 @@
// ==========================================================================
// Plyr Settings
// ==========================================================================
// Font
$plyr-font-family: inherit;
// Sizes
$plyr-font-size-base: 13px;
$plyr-font-size-small: 12px;
$plyr-font-size-time: 11px;
$plyr-font-size-badges: 9px;
// Captions
$plyr-font-size-captions-base: $plyr-font-size-base;
$plyr-font-size-captions-small: $plyr-font-size-small;
$plyr-font-size-captions-medium: 18px;
$plyr-font-size-captions-large: 21px;

View File

@ -2,4 +2,4 @@
// Colors
// ==========================================================================
@spacing-base: 20px;
$spacing-base: 20px;

View File

@ -0,0 +1,20 @@
// ==========================================================================
// Typography
// ==========================================================================
$font-sans-serif: 'Gordita', 'Avenir', 'Helvetica Neue', sans-serif;
$font-size-base: 15;
$font-size-small: 13;
$font-size-large: 18;
$font-size-h1: 64;
$font-weight-light: 300;
$font-weight-regular: 400;
$font-weight-medium: 500;
$font-weight-bold: 600;
$font-weight-black: 900;
$line-height-base: 1.75;
$letter-spacing-headings: -0.025em;

View File

@ -8,13 +8,13 @@ html {
}
body {
font-family: @font-sans-serif;
line-height: @line-height-base;
color: @color-text;
font-weight: @font-weight-medium;
text-shadow: 0 1px 1px fade(#000, 15%);
.font-smoothing();
.font-size(@font-size-base);
@include font-smoothing();
@include font-size($font-size-base);
color: $color-text;
font-family: $font-sans-serif;
font-weight: $font-weight-medium;
line-height: $line-height-base;
text-shadow: 0 1px 1px rgba(#000, 0.15);
}
button,
@ -26,10 +26,10 @@ textarea {
p,
small {
margin: 0 0 @spacing-base;
margin: 0 0 $spacing-base;
}
small {
@include font-size($font-size-small);
display: block;
.font-size(@font-size-small);
}

View File

@ -3,8 +3,8 @@
// ==========================================================================
h1 {
margin: 0 0 (@spacing-base / 2);
font-weight: @font-weight-bold;
letter-spacing: @letter-spacing-headings;
.font-size(@font-size-h1);
@include font-size($font-size-h1);
font-weight: $font-weight-bold;
letter-spacing: $letter-spacing-headings;
margin: 0 0 ($spacing-base / 2);
}

View File

@ -3,9 +3,9 @@
// ==========================================================================
.color--vimeo {
color: @color-vimeo;
color: $color-vimeo;
}
.color--youtube {
color: @color-youtube;
color: $color-youtube;
}

1
dist/plyr.css vendored

File diff suppressed because one or more lines are too long

2
dist/plyr.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,6 @@ const path = require('path');
const gulp = require('gulp');
const gutil = require('gulp-util');
const concat = require('gulp-concat');
const less = require('gulp-less');
const sass = require('gulp-sass');
const cleancss = require('gulp-clean-css');
const run = require('run-sequence');
@ -39,8 +38,7 @@ const paths = {
plyr: {
// Source paths
src: {
less: path.join(root, 'src/less/**/*'),
sass: path.join(root, 'src/sass/**/*'),
sass: path.join(root, 'src/sass/**/*.scss'),
js: path.join(root, 'src/js/**/*'),
sprite: path.join(root, 'src/sprite/*.svg'),
},
@ -51,7 +49,7 @@ const paths = {
demo: {
// Source paths
src: {
less: path.join(root, 'demo/src/less/**/*'),
sass: path.join(root, 'demo/src/sassgu/**/*.scss'),
js: path.join(root, 'demo/src/js/**/*'),
},
@ -61,12 +59,14 @@ const paths = {
// Demo
root: path.join(root, 'demo/'),
},
upload: [path.join(root, 'dist/**'), path.join(root, 'demo/dist/**')],
upload: [
path.join(root, 'dist/**'),
path.join(root, 'demo/dist/**'),
],
};
// Task arrays
const tasks = {
less: [],
sass: [],
js: [],
sprite: [],
@ -81,18 +81,16 @@ const browsers = ['> 1%'];
// Babel config
const babelrc = {
presets: [
[
'env',
{
targets: {
browsers,
},
useBuiltIns: true,
modules: false,
presets: [[
'env',
{
targets: {
browsers,
},
],
],
useBuiltIns: true,
modules: false,
},
]],
plugins: ['external-helpers'],
babelrc: false,
exclude: 'node_modules/**',
@ -100,7 +98,10 @@ const babelrc = {
// Clean out /dist
gulp.task('clean', () => {
const dirs = [paths.plyr.output, paths.demo.output].map(dir => path.join(dir, '**/*'));
const dirs = [
paths.plyr.output,
paths.demo.output,
].map(dir => path.join(dir, '**/*'));
// Don't delete the mp4
dirs.push(`!${path.join(paths.plyr.output, '**/*.mp4')}`);
@ -122,7 +123,12 @@ const build = {
.pipe(
rollup(
{
plugins: [resolve(), commonjs(), babel(babelrc), uglify({}, minify)],
plugins: [
resolve(),
commonjs(),
babel(babelrc),
uglify({}, minify),
],
},
options
)
@ -133,24 +139,6 @@ const build = {
);
});
},
less(files, bundle) {
Object.keys(files).forEach(key => {
const name = `less:${key}`;
tasks.less.push(name);
gulp.task(name, () =>
gulp
.src(bundles[bundle].less[key])
.pipe(less())
.on('error', gutil.log)
.pipe(concat(key))
.pipe(prefix(browsers, { cascade: false }))
.pipe(cleancss())
.pipe(size(sizeOptions))
.pipe(gulp.dest(paths[bundle].output))
);
});
},
sass(files, bundle) {
Object.keys(files).forEach(key => {
const name = `sass:${key}`;
@ -179,11 +167,9 @@ const build = {
.src(paths[bundle].src.sprite)
.pipe(
svgmin({
plugins: [
{
removeDesc: true,
},
],
plugins: [{
removeDesc: true,
}],
})
)
.pipe(svgstore())
@ -196,12 +182,11 @@ const build = {
// Plyr core files
build.js(bundles.plyr.js, 'plyr', { name: 'Plyr', format: 'umd' });
build.less(bundles.plyr.less, 'plyr');
build.sass(bundles.plyr.sass, 'plyr');
build.sprite('plyr');
// Demo files
build.less(bundles.demo.less, 'demo');
build.sass(bundles.demo.sass, 'demo');
build.js(bundles.demo.js, 'demo', { format: 'es' });
// Build all JS
@ -209,26 +194,21 @@ gulp.task('js', () => {
run(tasks.js);
});
// Build sass (for testing, default is LESS)
gulp.task('sass', () => {
run(tasks.sass);
});
// Watch for file changes
gulp.task('watch', () => {
// Plyr core
gulp.watch(paths.plyr.src.js, tasks.js);
gulp.watch(paths.plyr.src.less, tasks.less);
gulp.watch(paths.plyr.src.sass, tasks.sass);
gulp.watch(paths.plyr.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.sass, tasks.sass);
});
// Default gulp task
gulp.task('default', () => {
run(tasks.clean, tasks.js, tasks.less, tasks.sprite, 'watch');
run(tasks.clean, tasks.js, tasks.sass, tasks.sprite, 'watch');
});
// Publish a version to CDN and demo
@ -360,6 +340,6 @@ if ('cdn' in aws) {
// Do everything
gulp.task('publish', () => {
run(tasks.clean, tasks.js, tasks.less, tasks.sprite, 'cdn', 'demo');
run(tasks.clean, tasks.js, tasks.sass, tasks.sprite, 'cdn', 'demo');
});
}

8112
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,6 @@
"gulp-better-rollup": "^2.0.0",
"gulp-clean-css": "^3.9.0",
"gulp-concat": "^2.6.1",
"gulp-less": "^3.3.2",
"gulp-open": "^2.0.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
@ -32,14 +31,18 @@
"gulp-svgmin": "^1.2.4",
"gulp-svgstore": "^6.1.0",
"gulp-util": "^3.0.8",
"rollup-plugin-babel": "^3.0.2",
"rollup-plugin-babel": "^3.0.3",
"rollup-plugin-commonjs": "^8.2.6",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-uglify": "^2.0.1",
"run-sequence": "^2.2.0",
"stylelint": "^8.4.0",
"stylelint-config-prettier": "^2.0.0",
"stylelint-config-sass-guidelines": "^4.0.1",
"stylelint-config-standard": "^18.0.0",
"stylelint-order": "^0.8.0",
"stylelint-scss": "^2.2.0",
"stylelint-selector-bem-pattern": "^2.0.0",
"uglify-es": "^3.2.2"
},
"keywords": ["HTML5 Video", "HTML5 Audio", "Media Player", "DASH", "Shaka", "WordPress", "HLS"],

View File

@ -109,7 +109,10 @@ const captions = {
}
// Only get accepted kinds
return Array.from(this.media.textTracks || []).filter(track => ['captions', 'subtitles'].includes(track.kind));
return Array.from(this.media.textTracks || []).filter(track => [
'captions',
'subtitles',
].includes(track.kind));
},
// Get the current track for the current language

33
src/js/controls.js vendored
View File

@ -46,7 +46,10 @@ const controls = {
}
// Insert new one
styleSheet.insertRule([selector, styles].join(' '));
styleSheet.insertRule([
selector,
styles,
].join(' '));
},
// Get icon URL
@ -417,7 +420,10 @@ const controls = {
// Show/hide the tooltip
// If the event is a moues in/out and percentage is inside bounds
if (utils.is.event(event) && ['mouseenter', 'mouseleave'].includes(event.type)) {
if (utils.is.event(event) && [
'mouseenter',
'mouseleave',
].includes(event.type)) {
utils.toggleClass(this.elements.display.seekTooltip, visible, event.type === 'mouseenter');
}
},
@ -701,7 +707,15 @@ const controls = {
// Set the default speeds
if (!utils.is.object(this.options.speed) || !Object.keys(this.options.speed).length) {
this.options.speed = [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
this.options.speed = [
0.5,
0.75,
1,
1.25,
1.5,
1.75,
2,
];
}
// Set options if passed and filter based on config
@ -841,7 +855,10 @@ const controls = {
// Restore auto height/width
const restore = e => {
// We're only bothered about height and width on the container
if (e.target !== container || !['width', 'height'].includes(e.propertyName)) {
if (e.target !== container || ![
'width',
'height',
].includes(e.propertyName)) {
return;
}
@ -1211,7 +1228,13 @@ const controls = {
if (this.config.tooltips.controls) {
const labels = utils.getElements.call(
this,
[this.config.selectors.controls.wrapper, ' ', this.config.selectors.labels, ' .', this.config.classNames.hidden].join('')
[
this.config.selectors.controls.wrapper,
' ',
this.config.selectors.labels,
' .',
this.config.classNames.hidden,
].join('')
);
Array.from(labels).forEach(label => {

View File

@ -61,7 +61,17 @@ const defaults = {
// Quality default
quality: {
default: 'default',
options: ['hd2160', 'hd1440', 'hd1080', 'hd720', 'large', 'medium', 'small', 'tiny', 'default'],
options: [
'hd2160',
'hd1440',
'hd1080',
'hd720',
'large',
'medium',
'small',
'tiny',
'default',
],
},
// Set loops
@ -74,7 +84,15 @@ const defaults = {
// Speed default and options to display
speed: {
selected: 1,
options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2],
options: [
0.5,
0.75,
1,
1.25,
1.5,
1.75,
2,
],
},
// Keyboard shortcut settings
@ -108,8 +126,25 @@ const defaults = {
},
// Default controls
controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'pip', 'airplay', 'fullscreen'],
settings: ['captions', 'quality', 'speed', 'loop'],
controls: [
'play-large',
'play',
'progress',
'current-time',
'mute',
'volume',
'captions',
'settings',
'pip',
'airplay',
'fullscreen',
],
settings: [
'captions',
'quality',
'speed',
'loop',
],
// Localisation
i18n: {

View File

@ -12,7 +12,13 @@ const prefix = (() => {
value = '';
} else {
// Check for fullscreen support by vendor prefix
['webkit', 'o', 'moz', 'ms', 'khtml'].some(pre => {
[
'webkit',
'o',
'moz',
'ms',
'khtml',
].some(pre => {
if (utils.is.function(document[`${pre}CancelFullScreen`])) {
value = pre;
return true;

View File

@ -46,7 +46,29 @@ const listeners = {
// Reset on keyup
if (pressed) {
// Which keycodes should we prevent default
const preventDefault = [48, 49, 50, 51, 52, 53, 54, 56, 57, 32, 75, 38, 40, 77, 39, 37, 70, 67, 73, 76, 79];
const preventDefault = [
48,
49,
50,
51,
52,
53,
54,
56,
57,
32,
75,
38,
40,
77,
39,
37,
70,
67,
73,
76,
79,
];
// Check focused element
// and if the focused element is not editable (e.g. text input)
@ -325,7 +347,10 @@ const listeners = {
// Proxy events to container
// Bubble up key events for Edge
utils.on(this.media, this.config.events.concat(['keyup', 'keydown']).join(' '), event => {
utils.on(this.media, this.config.events.concat([
'keyup',
'keydown',
]).join(' '), event => {
let detail = {};
// Get error details from media
@ -499,7 +524,10 @@ const listeners = {
// Watch for cursor over controls so they don't hide when trying to interact
utils.on(this.elements.controls, 'mousedown mouseup touchstart touchend touchcancel', event => {
this.elements.controls.pressed = ['mousedown', 'touchstart'].includes(event.type);
this.elements.controls.pressed = [
'mousedown',
'touchstart',
].includes(event.type);
});
// Focus in/out on controls

View File

@ -939,10 +939,20 @@ class Plyr {
isEnterFullscreen = toggle.type === 'enterfullscreen';
// Whether to show controls
show = ['mouseenter', 'mousemove', 'touchstart', 'touchmove', 'focusin'].includes(toggle.type);
show = [
'mouseenter',
'mousemove',
'touchstart',
'touchmove',
'focusin',
].includes(toggle.type);
// Delay hiding on move events
if (['mousemove', 'touchmove', 'touchend'].includes(toggle.type)) {
if ([
'mousemove',
'touchmove',
'touchend',
].includes(toggle.type)) {
delay = 2000;
}

View File

@ -153,7 +153,10 @@ const ui = {
// Check if media is loading
checkLoading(event) {
this.loading = ['stalled', 'waiting'].includes(event.type);
this.loading = [
'stalled',
'waiting',
].includes(event.type);
// Clear timer
clearTimeout(this.timers.loading);

View File

@ -1,112 +0,0 @@
// ==========================================================================
// Plyr variables
// https://github.com/sampotts/plyr
// ==========================================================================
// Settings
@plyr-border-box: true;
@plyr-touch-action: true;
@plyr-sr-only-important: true;
// Colors
@plyr-color-main: #1aafff;
@plyr-color-gunmetal: #2f343d;
@plyr-color-fiord: #4f5b5f;
@plyr-color-lynch: #6b7d85;
@plyr-color-heather: #b7c5cd;
// Type
@plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif;
@plyr-font-size-base: 16px;
@plyr-font-size-small: 14px;
@plyr-font-size-time: 14px;
@plyr-font-size-badge: 10px;
@plyr-font-weight-regular: 500;
@plyr-font-weight-bold: 600;
@plyr-line-height: 1.7;
@plyr-font-smoothing: on;
// Focus
@plyr-tab-focus-default-color: @plyr-color-main;
// Captions
@plyr-captions-bg: fade(#000, 80%);
@plyr-captions-color: #fff;
@plyr-font-size-captions-base: @plyr-font-size-base;
@plyr-font-size-captions-small: @plyr-font-size-small;
@plyr-font-size-captions-medium: 18px;
@plyr-font-size-captions-large: 21px;
// Controls
@plyr-control-icon-size: 18px;
@plyr-control-icon-size-large: 20px;
@plyr-control-spacing: 10px;
@plyr-control-padding: (@plyr-control-spacing * 0.7);
@plyr-control-radius: 3px;
@plyr-video-controls-bg: #000;
@plyr-video-control-color: #fff;
@plyr-video-control-color-hover: #fff;
@plyr-video-control-bg-hover: @plyr-color-main;
@plyr-audio-controls-bg: #fff;
@plyr-audio-control-color: @plyr-color-fiord;
@plyr-audio-control-color-hover: #fff;
@plyr-audio-control-bg-hover: @plyr-color-main;
// Tooltips
@plyr-tooltip-bg: fade(#fff, 90%);
@plyr-tooltip-color: @plyr-color-fiord;
@plyr-tooltip-padding: (@plyr-control-spacing / 2);
@plyr-tooltip-arrow-size: 4px;
@plyr-tooltip-radius: 3px;
@plyr-tooltip-shadow: 0 1px 2px fade(#000, 15%);
// Menus
@plyr-menu-bg: @plyr-tooltip-bg;
@plyr-menu-color: @plyr-tooltip-color;
@plyr-menu-arrow-size: 6px;
@plyr-menu-border-color: @plyr-color-heather;
@plyr-menu-border-shadow-color: #fff;
@plyr-menu-shadow: 0 1px 2px fade(#000, 15%);
// Progress
@plyr-progress-loading-size: 25px;
@plyr-progress-loading-bg: fade(@plyr-color-gunmetal, 20%);
@plyr-video-progress-buffered-bg: fade(#fff, 25%);
@plyr-audio-progress-buffered-bg: fade(@plyr-color-heather, 66%);
// Range sliders
@plyr-range-track-height: 6px;
@plyr-range-thumb-height: 14px;
@plyr-range-thumb-bg: #fff;
@plyr-range-thumb-border: 2px solid transparent;
@plyr-range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%), 0 0 0 1px fade(@plyr-color-gunmetal, 20%);
@plyr-range-fill-bg: @plyr-color-main;
@plyr-range-thumb-active-border-color: #fff;
@plyr-range-thumb-active-bg: @plyr-video-control-bg-hover;
@plyr-range-thumb-active-height: 20px;
@plyr-video-range-track-bg: @plyr-video-progress-buffered-bg;
@plyr-audio-range-track-bg: @plyr-audio-progress-buffered-bg;
// Breakpoints
@plyr-bp-sm: 480px;
@plyr-bp-md: 768px;
@plyr-bp-lg: 1024px;
// Max-width media queries
@plyr-bp-xs-max: (@plyr-bp-sm - 1);
@plyr-bp-sm-max: (@plyr-bp-md - 1);
@plyr-bp-md-max: (@plyr-bp-lg - 1);
// Mobile first
@plyr-mq-sm: ~'only screen and (min-width: @{plyr-bp-sm}) ';
@plyr-mq-md: ~'only screen and (min-width: @{plyr-bp-md}) ';
@plyr-mq-lg: ~'only screen and (min-width: @{plyr-bp-lg}) ';
// Mobile last
@plyr-mq-xs-max: ~'only screen and (max-width: @{plyr-bp-xs-max}) ';
@plyr-mq-sm-max: ~'only screen and (max-width: @{plyr-bp-sm-max}) ';
@plyr-mq-md-max: ~'only screen and (max-width: @{plyr-bp-md-max}) ';

View File

@ -4,24 +4,25 @@
// Base
.plyr {
position: relative;
@include plyr-font-smoothing($plyr-font-smoothing);
direction: ltr;
font-family: $plyr-font-family;
font-weight: $plyr-font-weight-regular;
line-height: $plyr-line-height;
max-width: 100%;
min-width: 200px;
font-family: @plyr-font-family;
font-weight: @plyr-font-weight-regular;
line-height: @plyr-line-height;
direction: ltr;
position: relative;
text-shadow: none;
transition: box-shadow 0.3s ease;
.plyr-font-smoothing(@plyr-font-smoothing);
// Media elements
video,
audio {
width: 100%;
border-radius: inherit;
height: auto;
vertical-align: middle;
border-radius: inherit;
width: 100%;
}
// Ignore focus
@ -30,21 +31,23 @@
}
}
// Full UI only
.plyr--full-ui {
& when(@plyr-border-box = true) {
// border-box everything
// http://paulirish.com/2012/box-sizing-border-box-ftw/
&,
// border-box everything
// http://paulirish.com/2012/box-sizing-border-box-ftw/
@if $plyr-border-box == true {
.plyr--full-ui {
box-sizing: border-box;
*,
*::after,
*::before {
box-sizing: border-box;
box-sizing: inherit;
}
}
}
& when(@plyr-touch-action = true) {
// Fix 300ms delay
// Fix 300ms delay
@if $plyr-touch-action == true {
.plyr--full-ui {
a,
button,
input,

View File

@ -3,10 +3,10 @@
// --------------------------------------------------------------
.plyr__badge {
padding: 3px 4px;
background: $plyr-menu-color;
border-radius: 2px;
background: @plyr-menu-color;
color: @plyr-menu-bg;
font-size: @plyr-font-size-badge;
color: $plyr-menu-bg;
font-size: $plyr-font-size-badge;
line-height: 1;
padding: 3px 4px;
}

View File

@ -8,25 +8,25 @@
}
.plyr__captions {
display: none;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: @plyr-control-spacing;
transform: translateY(-(@plyr-control-spacing * 4));
transition: transform 0.4s ease-in-out;
animation: plyr-fade-in 0.3s ease;
color: @plyr-captions-color;
font-size: @plyr-font-size-captions-small;
bottom: 0;
color: $plyr-captions-color;
display: none;
font-size: $plyr-font-size-captions-small;
left: 0;
padding: $plyr-control-spacing;
position: absolute;
text-align: center;
transform: translateY(-($plyr-control-spacing * 4));
transition: transform 0.4s ease-in-out;
width: 100%;
span {
background: $plyr-captions-bg;
border-radius: 2px;
padding: 0.2em 0.5em;
background: @plyr-captions-bg;
box-decoration-break: clone;
line-height: 185%;
padding: 0.2em 0.5em;
white-space: pre-wrap;
// Firefox adds a <div> when using getCueAsHTML()
@ -39,13 +39,13 @@
display: none;
}
@media @plyr-mq-sm {
padding: (@plyr-control-spacing * 2);
font-size: @plyr-font-size-captions-base;
@media (min-width: $plyr-bp-sm) {
font-size: $plyr-font-size-captions-base;
padding: ($plyr-control-spacing * 2);
}
@media @plyr-mq-md {
font-size: @plyr-font-size-captions-medium;
@media (min-width: $plyr-bp-md) {
font-size: $plyr-font-size-captions-medium;
}
}
@ -54,5 +54,5 @@
}
.plyr--hide-controls .plyr__captions {
transform: translateY(-(@plyr-control-spacing * 1.5));
transform: translateY(-($plyr-control-spacing * 1.5));
}

View File

@ -3,23 +3,23 @@
// --------------------------------------------------------------
.plyr__control {
position: relative;
background: transparent;
border: 0;
border-radius: $plyr-control-radius;
color: inherit;
cursor: pointer;
flex-shrink: 0;
overflow: visible; // IE11
padding: @plyr-control-padding;
border: 0;
background: transparent;
border-radius: @plyr-control-radius;
cursor: pointer;
padding: $plyr-control-padding;
position: relative;
transition: all 0.3s ease;
color: inherit;
svg {
width: @plyr-control-icon-size;
height: @plyr-control-icon-size;
display: block;
fill: currentColor;
height: $plyr-control-icon-size;
pointer-events: none;
width: $plyr-control-icon-size;
}
// Default focus
@ -29,15 +29,15 @@
// Tab focus
&.plyr__tab-focus {
.plyr-tab-focus();
@include plyr-tab-focus();
}
}
// Change icons on state change
.plyr__control[aria-pressed='false'] .icon--pressed,
.plyr__control[aria-pressed='true'] .icon--not-pressed,
.plyr__control[aria-pressed='false'] .label--pressed,
.plyr__control[aria-pressed='true'] .label--not-pressed {
.plyr__control[aria-pressed='true'] .icon--not-pressed,
.plyr__control[aria-pressed='false'] .label--pressed,
.plyr__control[aria-pressed='true'] .label--not-pressed {
display: none;
}
@ -46,36 +46,36 @@
&.plyr__tab-focus,
&:hover,
&[aria-expanded='true'] {
background: @plyr-audio-control-bg-hover;
color: @plyr-audio-control-color-hover;
background: $plyr-audio-control-bg-hover;
color: $plyr-audio-control-color-hover;
}
}
// Large play button (video only)
.plyr__control--overlaid {
display: none;
position: absolute;
z-index: 2;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: ceil(@plyr-control-spacing * 1.5);
background: fade(@plyr-video-control-bg-hover, 80%);
background: rgba($plyr-video-control-bg-hover, 0.8);
border: 0;
border-radius: 100%;
box-shadow: 0 1px 1px fade(#000, 15%);
color: @plyr-video-control-color;
box-shadow: 0 1px 1px rgba(#000, 0.15);
color: $plyr-video-control-color;
display: none;
left: 50%;
padding: ceil($plyr-control-spacing * 1.5);
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
z-index: 2;
svg {
position: relative;
height: $plyr-control-icon-size-large;
left: 2px; // Offset to make the play button look right
width: @plyr-control-icon-size-large;
height: @plyr-control-icon-size-large;
position: relative;
width: $plyr-control-icon-size-large;
}
&:hover,
&:focus {
background: @plyr-video-control-bg-hover;
background: $plyr-video-control-bg-hover;
}
}

View File

@ -9,8 +9,8 @@
// Playback controls
.plyr__controls {
display: flex;
align-items: center;
display: flex;
text-align: center;
// Spacing
@ -18,7 +18,7 @@
.plyr__progress,
.plyr__time,
.plyr__menu {
margin-left: (@plyr-control-spacing / 2);
margin-left: ($plyr-control-spacing / 2);
&:first-child,
&:first-child + [data-plyr='pause'] {
@ -27,79 +27,79 @@
}
.plyr__volume {
margin-left: (@plyr-control-spacing / 2);
margin-left: ($plyr-control-spacing / 2);
}
@media @plyr-mq-sm {
@media (min-width: $plyr-bp-sm) {
> .plyr__control,
.plyr__progress,
.plyr__time,
.plyr__menu {
margin-left: @plyr-control-spacing;
margin-left: $plyr-control-spacing;
}
> .plyr__control + .plyr__control,
.plyr__menu + .plyr__control,
> .plyr__control + .plyr__menu {
margin-left: (@plyr-control-spacing / 2);
margin-left: ($plyr-control-spacing / 2);
}
}
}
// Video controls
.plyr--video .plyr__controls {
position: absolute;
left: 0;
right: 0;
bottom: 0;
z-index: 2;
padding: (@plyr-control-spacing * 3.5) @plyr-control-spacing @plyr-control-spacing;
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 70%));
background: linear-gradient(rgba($plyr-video-controls-bg, 0), rgba($plyr-video-controls-bg, 0.7));
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
color: @plyr-video-control-color;
bottom: 0;
color: $plyr-video-control-color;
left: 0;
padding: ($plyr-control-spacing * 3.5) $plyr-control-spacing $plyr-control-spacing;
position: absolute;
right: 0;
transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
z-index: 2;
.plyr__control {
svg {
filter: drop-shadow(0 1px 1px fade(#000, 15%));
filter: drop-shadow(0 1px 1px rgba(#000, 0.15));
}
// Hover and tab focus
&.plyr__tab-focus,
&:hover,
&[aria-expanded='true'] {
background: @plyr-video-control-bg-hover;
color: @plyr-video-control-color-hover;
background: $plyr-video-control-bg-hover;
color: $plyr-video-control-color-hover;
}
}
}
// Audio controls
.plyr--audio .plyr__controls {
padding: @plyr-control-spacing;
background: $plyr-audio-controls-bg;
border-radius: inherit;
background: @plyr-audio-controls-bg;
color: @plyr-audio-control-color;
color: $plyr-audio-control-color;
padding: $plyr-control-spacing;
}
// Hide controls
.plyr--video.plyr--hide-controls .plyr__controls {
opacity: 0;
transform: translateY(100%);
pointer-events: none;
transform: translateY(100%);
}
// Some options are hidden by default
.plyr [data-plyr='captions'],
.plyr [data-plyr='pip'],
.plyr [data-plyr='airplay'],
.plyr [data-plyr='fullscreen'] {
.plyr [data-plyr='pip'],
.plyr [data-plyr='airplay'],
.plyr [data-plyr='fullscreen'] {
display: none;
}
.plyr--captions-enabled [data-plyr='captions'],
.plyr--pip-supported [data-plyr='pip'],
.plyr--airplay-supported [data-plyr='airplay'],
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
.plyr--pip-supported [data-plyr='pip'],
.plyr--airplay-supported [data-plyr='airplay'],
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
display: inline-block;
}

View File

@ -5,28 +5,28 @@
.plyr__video-embed {
// Default to 16:9 ratio but this is set by JavaScript based on config
@padding: ((100 / 16) * 9);
@height: 200;
@offset: unit((@height - @padding) / (@height / 50), ~'%');
$padding: ((100 / 16) * 9);
$height: 200;
$offset: percentage(($height - $padding) / ($height / 50));
padding-bottom: unit(@padding, ~'%');
height: 0;
padding-bottom: percentage($padding);
iframe {
border: 0;
height: 100%;
left: 0;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
user-select: none;
width: 100%;
}
// Vimeo hack
> div {
padding-bottom: percentage($height);
position: relative;
padding-bottom: unit(@height, ~'%');
transform: translateY(-@offset);
transform: translateY(-$offset);
}
}
// To allow mouse events to be captured if full support

View File

@ -23,19 +23,19 @@
// The actual menu container
&__container {
position: absolute;
z-index: 1;
bottom: 100%;
right: -3px;
margin-bottom: 10px;
animation: plyr-popup 0.2s ease;
background: @plyr-menu-bg;
background: $plyr-menu-bg;
border-radius: 4px;
box-shadow: @plyr-menu-shadow;
white-space: nowrap;
bottom: 100%;
box-shadow: $plyr-menu-shadow;
color: $plyr-menu-color;
font-size: $plyr-font-size-base;
margin-bottom: 10px;
position: absolute;
right: -3px;
text-align: left;
color: @plyr-menu-color;
font-size: @plyr-font-size-base;
white-space: nowrap;
z-index: 1;
> div {
overflow: hidden;
@ -44,47 +44,47 @@
// Arrow
&::after {
content: '';
position: absolute;
top: 100%;
right: 15px;
height: 0;
width: 0;
border: 4px solid transparent;
border-top-color: @plyr-menu-bg;
border-top-color: $plyr-menu-bg;
content: '';
height: 0;
position: absolute;
right: 15px;
top: 100%;
width: 0;
}
ul {
margin: 0;
padding: @plyr-control-padding;
list-style: none;
margin: 0;
overflow: hidden;
padding: $plyr-control-padding;
}
// Options
.plyr__control {
display: flex;
align-items: center;
width: 100%;
padding: ceil(@plyr-control-padding / 2) (@plyr-control-padding * 2);
color: @plyr-menu-color;
color: $plyr-menu-color;
display: flex;
padding: ceil($plyr-control-padding / 2) ($plyr-control-padding * 2);
user-select: none;
width: 100%;
&::after {
border: 4px solid transparent;
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
border: 4px solid transparent;
transition: border-color 0.2s ease;
}
&--forward {
padding-right: ceil(@plyr-control-padding * 4);
padding-right: ceil($plyr-control-padding * 4);
&::after {
border-left-color: rgba($plyr-menu-color, 0.8);
right: 5px;
border-left-color: fade(@plyr-menu-color, 80%);
}
&.plyr__tab-focus::after,
@ -94,31 +94,31 @@
}
&--back {
$horizontal-padding: ($plyr-control-padding * 2);
font-weight: $plyr-font-weight-regular;
margin: $plyr-control-padding;
margin-bottom: floor($plyr-control-padding / 2);
padding-left: ceil($plyr-control-padding * 4);
position: relative;
@horizontal-padding: (@plyr-control-padding * 2);
width: ~'calc(100% - @{horizontal-padding})';
margin: @plyr-control-padding;
margin-bottom: floor(@plyr-control-padding / 2);
padding-left: ceil(@plyr-control-padding * 4);
font-weight: @plyr-font-weight-regular;
width: calc(100% - #{$horizontal-padding});
&::after {
left: @plyr-control-padding;
border-right-color: fade(@plyr-menu-color, 80%);
border-right-color: rgba($plyr-menu-color, 0.8);
left: $plyr-control-padding;
}
&::before {
background: $plyr-menu-border-color;
box-shadow: 0 1px 0 $plyr-menu-border-shadow-color;
content: '';
position: absolute;
top: 100%;
left: 0;
right: 0;
height: 1px;
left: 0;
margin-top: ceil($plyr-control-padding / 2);
overflow: hidden;
margin-top: ceil(@plyr-control-padding / 2);
background: @plyr-menu-border-color;
box-shadow: 0 1px 0 @plyr-menu-border-shadow-color;
position: absolute;
right: 0;
top: 100%;
}
&.plyr__tab-focus::after,
@ -129,62 +129,62 @@
}
label.plyr__control {
padding-left: @plyr-control-padding;
padding-left: $plyr-control-padding;
input[type='radio'] + span {
position: relative;
background: rgba(#000, 0.1);
border-radius: 100%;
display: block;
flex-shrink: 0;
height: 16px;
width: 16px;
border-radius: 100%;
background: fade(#000, 10%);
margin-right: @plyr-control-spacing;
margin-right: $plyr-control-spacing;
position: relative;
transition: all 0.3s ease;
width: 16px;
&::after {
content: '';
position: absolute;
height: 6px;
width: 6px;
top: 5px;
left: 5px;
transform: scale(0);
opacity: 0;
background: #fff;
border-radius: 100%;
content: '';
height: 6px;
left: 5px;
opacity: 0;
position: absolute;
top: 5px;
transform: scale(0);
transition: transform 0.3s ease, opacity 0.3s ease;
width: 6px;
}
}
input[type='radio']:checked + span {
background: @plyr-color-main;
background: $plyr-color-main;
&::after {
transform: scale(1);
opacity: 1;
transform: scale(1);
}
}
input[type='radio']:focus + span {
.plyr-tab-focus();
@include plyr-tab-focus();
}
&.plyr__tab-focus input[type='radio'] + span,
&:hover input[type='radio'] + span {
background: fade(#000, 10%);
background: rgba(#000, 0.1);
}
}
// Option value
.plyr__menu__value {
display: flex;
align-items: center;
display: flex;
margin-left: auto;
margin-right: -@plyr-control-padding;
padding-left: ceil(@plyr-control-padding * 3.5);
pointer-events: none;
margin-right: -$plyr-control-padding;
overflow: hidden;
padding-left: ceil($plyr-control-padding * 3.5);
pointer-events: none;
}
}
}

View File

@ -3,9 +3,9 @@
// --------------------------------------------------------------
.plyr__progress {
position: relative;
display: flex;
flex: 1;
position: relative;
input[type='range'] {
position: relative;
@ -14,25 +14,23 @@
// Seek tooltip to show time
.plyr__tooltip {
font-size: $plyr-font-size-time;
left: 0;
font-size: @plyr-font-size-time;
}
}
.plyr__progress--buffer {
position: absolute;
-webkit-appearance: none; /* stylelint-disable-line */
background: transparent;
border: 0;
border-radius: 100px;
height: $plyr-range-track-height;
left: 0;
margin: -($plyr-range-track-height / 2) 0 0;
padding: 0;
position: absolute;
top: 50%;
width: 100%;
height: @plyr-range-track-height;
margin: -(@plyr-range-track-height / 2) 0 0;
padding: 0;
background: transparent;
border: none;
border-radius: 100px;
// WebKit
-webkit-appearance: none;
&::-webkit-progress-bar {
background: transparent;
@ -42,14 +40,14 @@
&::-webkit-progress-value {
background: currentColor;
border-radius: 100px;
min-width: @plyr-range-track-height;
min-width: $plyr-range-track-height;
}
// Mozilla
&::-moz-progress-bar {
background: currentColor;
border-radius: 100px;
min-width: @plyr-range-track-height;
min-width: $plyr-range-track-height;
transition: width 0.2s ease;
}
@ -61,36 +59,36 @@
}
.plyr--video .plyr__progress--buffer {
box-shadow: 0 1px 1px fade(#000, 15%);
color: @plyr-video-progress-buffered-bg;
box-shadow: 0 1px 1px rgba(#000, 0.15);
color: $plyr-video-progress-buffered-bg;
}
.plyr--audio .plyr__progress--buffer {
color: @plyr-audio-progress-buffered-bg;
color: $plyr-audio-progress-buffered-bg;
}
// Loading state
.plyr--loading .plyr__progress--buffer {
animation: plyr-progress 1s linear infinite;
background-size: @plyr-progress-loading-size @plyr-progress-loading-size;
background-repeat: repeat-x;
background-image: linear-gradient(
-45deg,
@plyr-progress-loading-bg 25%,
$plyr-progress-loading-bg 25%,
transparent 25%,
transparent 50%,
@plyr-progress-loading-bg 50%,
@plyr-progress-loading-bg 75%,
$plyr-progress-loading-bg 50%,
$plyr-progress-loading-bg 75%,
transparent 75%,
transparent
);
background-repeat: repeat-x;
background-size: $plyr-progress-loading-size $plyr-progress-loading-size;
color: transparent;
}
.plyr--video.plyr--loading .plyr__progress--buffer {
background-color: @plyr-video-progress-buffered-bg;
background-color: $plyr-video-progress-buffered-bg;
}
.plyr--audio.plyr--loading .plyr__progress--buffer {
background-color: @plyr-audio-progress-buffered-bg;
background-color: $plyr-audio-progress-buffered-bg;
}

View File

@ -2,68 +2,65 @@
// Slider inputs - <input type="range">
// --------------------------------------------------------------
// Specificity is for bootstrap compatibility
.plyr--full-ui input[type='range'] {
// WebKit
-webkit-appearance: none; /* stylelint-disable-line */
background: transparent;
border: 0;
border-radius: ($plyr-range-thumb-height * 2);
// color is used in JS to populate lower fill for WebKit
color: $plyr-range-fill-bg;
cursor: pointer;
display: block;
height: @plyr-range-thumb-active-height;
width: 100%;
height: $plyr-range-thumb-active-height;
margin: 0;
padding: 0;
cursor: pointer;
border: none;
background: transparent;
transition: box-shadow 0.3s ease;
border-radius: (@plyr-range-thumb-height * 2);
// Used in JS to populate lower fill for WebKit
color: @plyr-range-fill-bg;
// WebKit
-webkit-appearance: none;
width: 100%;
&::-webkit-slider-runnable-track {
.plyr-range-track();
@include plyr-range-track();
}
&::-webkit-slider-thumb {
-webkit-appearance: none;
margin-top: -((@plyr-range-thumb-height - @plyr-range-track-height) / 2);
.plyr-range-thumb();
@include plyr-range-thumb();
-webkit-appearance: none; /* stylelint-disable-line */
margin-top: -(($plyr-range-thumb-height - $plyr-range-track-height) / 2);
}
// Mozilla
&::-moz-range-track {
.plyr-range-track();
@include plyr-range-track();
}
&::-moz-range-thumb {
.plyr-range-thumb();
@include plyr-range-thumb();
}
&::-moz-range-progress {
height: @plyr-range-track-height;
background: currentColor;
border-radius: (@plyr-range-track-height / 2);
border-radius: ($plyr-range-track-height / 2);
height: $plyr-range-track-height;
}
// Microsoft
&::-ms-track {
@include plyr-range-track();
color: transparent;
.plyr-range-track();
}
&::-ms-fill-upper {
.plyr-range-track();
@include plyr-range-track();
}
&::-ms-fill-lower {
.plyr-range-track();
@include plyr-range-track();
background: currentColor;
}
&::-ms-thumb {
.plyr-range-thumb();
@include plyr-range-thumb();
// For some reason, Edge uses the -webkit margin above
margin-top: 0;
}
@ -83,30 +80,30 @@
&.plyr__tab-focus {
&::-webkit-slider-runnable-track {
.plyr-tab-focus();
@include plyr-tab-focus();
}
&::-moz-range-track {
.plyr-tab-focus();
@include plyr-tab-focus();
}
&::-ms-track {
.plyr-tab-focus();
@include plyr-tab-focus();
}
}
// Pressed styles
&:active {
&::-webkit-slider-thumb {
.plyr-range-thumb-active();
@include plyr-range-thumb-active();
}
&::-moz-range-thumb {
.plyr-range-thumb-active();
@include plyr-range-thumb-active();
}
&::-ms-thumb {
.plyr-range-thumb-active();
@include plyr-range-thumb-active();
}
}
}
@ -114,29 +111,29 @@
// Video range inputs
.plyr--full-ui.plyr--video input[type='range'] {
&::-webkit-slider-runnable-track {
background: @plyr-video-range-track-bg;
background: $plyr-video-range-track-bg;
}
&::-moz-range-track {
background: @plyr-video-range-track-bg;
background: $plyr-video-range-track-bg;
}
&::-ms-track {
background: @plyr-video-range-track-bg;
background: $plyr-video-range-track-bg;
}
}
// Audio range inputs
.plyr--full-ui.plyr--audio input[type='range'] {
&::-webkit-slider-runnable-track {
background: @plyr-audio-range-track-bg;
background: $plyr-audio-range-track-bg;
}
&::-moz-range-track {
background: @plyr-audio-range-track-bg;
background: $plyr-audio-range-track-bg;
}
&::-ms-track {
background: @plyr-audio-range-track-bg;
background: $plyr-audio-range-track-bg;
}
}

View File

@ -3,7 +3,7 @@
// --------------------------------------------------------------
.plyr__time {
font-size: @plyr-font-size-time;
font-size: $plyr-font-size-time;
}
// Media duration hidden on small screens
@ -11,14 +11,14 @@
// Add a slash in before
&::before {
content: '\2044';
margin-right: @plyr-control-spacing;
margin-right: $plyr-control-spacing;
}
@media @plyr-mq-sm-max {
@media (max-width: $plyr-bp-sm-max) {
display: none;
}
}
.plyr--video .plyr__time {
text-shadow: 0 1px 1px fade(#000, 15%);
text-shadow: 0 1px 1px rgba(#000, 0.15);
}

View File

@ -3,38 +3,36 @@
// --------------------------------------------------------------
.plyr__tooltip {
position: absolute;
z-index: 2;
background: $plyr-tooltip-bg;
border-radius: $plyr-tooltip-radius;
bottom: 100%;
margin-bottom: (@plyr-tooltip-padding * 2);
padding: @plyr-tooltip-padding (@plyr-tooltip-padding * 1.5);
pointer-events: none;
opacity: 0;
background: @plyr-tooltip-bg;
border-radius: @plyr-tooltip-radius;
box-shadow: @plyr-tooltip-shadow;
color: @plyr-tooltip-color;
font-size: @plyr-font-size-small;
font-weight: @plyr-font-weight-regular;
box-shadow: $plyr-tooltip-shadow;
color: $plyr-tooltip-color;
font-size: $plyr-font-size-small;
font-weight: $plyr-font-weight-regular;
line-height: 1.3;
margin-bottom: ($plyr-tooltip-padding * 2);
opacity: 0;
padding: $plyr-tooltip-padding ($plyr-tooltip-padding * 1.5);
pointer-events: none;
position: absolute;
transform: translate(-50%, 10px) scale(0.8);
transform-origin: 50% 100%;
transition: transform 0.2s 0.1s ease, opacity 0.2s 0.1s ease;
z-index: 2;
// The background triangle
&::before {
// Arrows
border-left: $plyr-tooltip-arrow-size solid transparent;
border-right: $plyr-tooltip-arrow-size solid transparent;
border-top: $plyr-tooltip-arrow-size solid $plyr-tooltip-bg;
bottom: -$plyr-tooltip-arrow-size;
content: '';
position: absolute;
width: 0;
height: 0;
left: 50%;
position: absolute;
transform: translateX(-50%);
// The background triangle
bottom: -@plyr-tooltip-arrow-size;
border-right: @plyr-tooltip-arrow-size solid transparent;
border-top: @plyr-tooltip-arrow-size solid @plyr-tooltip-bg;
border-left: @plyr-tooltip-arrow-size solid transparent;
width: 0;
z-index: 2;
}
}
@ -59,7 +57,7 @@
transform-origin: 0 100%;
&::before {
left: (@plyr-control-icon-size / 2) + @plyr-control-padding;
left: ($plyr-control-icon-size / 2) + $plyr-control-padding;
}
}
@ -71,7 +69,7 @@
&::before {
left: auto;
right: (@plyr-control-icon-size / 2) + @plyr-control-padding;
right: ($plyr-control-icon-size / 2) + $plyr-control-padding;
transform: translateX(50%);
}
}

View File

@ -12,10 +12,10 @@
}
.plyr__video-wrapper {
position: relative;
background: #000;
border-radius: inherit;
overflow: hidden;
position: relative;
// Require z-index to force border-radius
z-index: 0;
overflow: hidden;
}

View File

@ -11,11 +11,11 @@
z-index: 2;
}
@media @plyr-mq-sm {
@media (min-width: $plyr-bp-sm) {
max-width: 50px;
}
@media @plyr-mq-md {
@media (min-width: $plyr-bp-md) {
max-width: 80px;
}
}

View File

@ -4,19 +4,19 @@
@keyframes plyr-progress {
to {
background-position: @plyr-progress-loading-size 0;
background-position: $plyr-progress-loading-size 0;
}
}
@keyframes plyr-popup {
from {
transform: translateY(10px);
0% {
opacity: 0.5;
transform: translateY(10px);
}
to {
transform: translateY(0);
opacity: 1;
transform: translateY(0);
}
}

View File

@ -5,59 +5,60 @@
// Nicer focus styles
// ---------------------------------------
.plyr-tab-focus(@color: @plyr-tab-focus-default-color) {
@mixin plyr-tab-focus($color: $plyr-tab-focus-default-color) {
box-shadow: 0 0 0 3px rgba($color, 0.35);
outline: 0;
box-shadow: 0 0 0 3px fade(@color, 35%);
}
// Font smoothing
// ---------------------------------------
.plyr-font-smoothing(@mode: on) when(@mode = on) {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
}
.plyr-font-smoothing(@mode: on) when(@mode = off) {
-moz-osx-font-smoothing: auto;
-webkit-font-smoothing: subpixel-antialiased;
@mixin plyr-font-smoothing($mode: true) {
@if $mode {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
} @else {
-moz-osx-font-smoothing: auto;
-webkit-font-smoothing: subpixel-antialiased;
}
}
// <input type="range"> styling
// ---------------------------------------
.plyr-range-track() {
height: @plyr-range-track-height;
@mixin plyr-range-track() {
background: transparent;
border: 0;
border-radius: (@plyr-range-track-height / 2);
user-select: none;
border-radius: ($plyr-range-track-height / 2);
height: $plyr-range-track-height;
transition: all 0.3s ease;
user-select: none;
}
.plyr-range-thumb() {
position: relative;
height: @plyr-range-thumb-height;
width: @plyr-range-thumb-height;
background: @plyr-range-thumb-bg;
border: @plyr-range-thumb-border;
@mixin plyr-range-thumb() {
background: $plyr-range-thumb-bg;
border: $plyr-range-thumb-border;
border-radius: 100%;
transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
box-shadow: @plyr-range-thumb-shadow;
box-shadow: $plyr-range-thumb-shadow;
box-sizing: border-box;
height: $plyr-range-thumb-height;
position: relative;
transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
width: $plyr-range-thumb-height;
}
.plyr-range-thumb-active() {
background: @plyr-range-thumb-active-bg;
border-color: @plyr-range-thumb-active-border-color;
transform: scale(unit(@plyr-range-thumb-active-height / @plyr-range-thumb-height));
@mixin plyr-range-thumb-active() {
background: $plyr-range-thumb-active-bg;
border-color: $plyr-range-thumb-active-border-color;
transform: scale(unit($plyr-range-thumb-active-height / $plyr-range-thumb-height));
}
// Fullscreen styles
// ---------------------------------------
.plyr-fullscreen-active() {
height: 100%;
width: 100%;
margin: 0;
@mixin plyr-fullscreen-active() {
background: #000;
border-radius: 0 !important;
height: 100%;
margin: 0;
width: 100%;
video {
height: 100%;
@ -90,9 +91,9 @@
}
// Large captions in full screen on larger screens
@media @plyr-mq-lg {
@media (min-width: $plyr-bp-lg) {
.plyr__captions {
font-size: @plyr-font-size-captions-large;
font-size: $plyr-font-size-captions-large;
}
}
}

102
src/sass/settings.scss Normal file
View File

@ -0,0 +1,102 @@
// ==========================================================================
// Plyr variables
// https://github.com/sampotts/plyr
// ==========================================================================
// Settings
$plyr-border-box: true !default;
$plyr-touch-action: true !default;
$plyr-sr-only-important: true !default;
// Colors
$plyr-color-main: #1aafff !default;
$plyr-color-gunmetal: #2f343d !default;
$plyr-color-fiord: #4f5b5f !default;
$plyr-color-lynch: #6b7d85 !default;
$plyr-color-heather: #b7c5cd !default;
// Type
$plyr-font-family: Avenir, 'Avenir Next', 'Helvetica Neue', 'Segoe UI', Helvetica, Arial, sans-serif !default;
$plyr-font-size-base: 16px !default;
$plyr-font-size-small: 14px !default;
$plyr-font-size-time: 14px !default;
$plyr-font-size-badge: 10px !default;
$plyr-font-weight-regular: 500 !default;
$plyr-font-weight-bold: 600 !default;
$plyr-line-height: 1.7 !default;
$plyr-font-smoothing: true !default;
// Focus
$plyr-tab-focus-default-color: $plyr-color-main !default;
// Captions
$plyr-captions-bg: rgba(#000, 0.8) !default;
$plyr-captions-color: #fff !default;
$plyr-font-size-captions-base: $plyr-font-size-base !default;
$plyr-font-size-captions-small: $plyr-font-size-small !default;
$plyr-font-size-captions-medium: 18px !default;
$plyr-font-size-captions-large: 21px !default;
// Controls
$plyr-control-icon-size: 18px !default;
$plyr-control-icon-size-large: 20px !default;
$plyr-control-spacing: 10px !default;
$plyr-control-padding: ($plyr-control-spacing * 0.7) !default;
$plyr-control-radius: 3px !default;
$plyr-video-controls-bg: #000 !default;
$plyr-video-control-color: #fff !default;
$plyr-video-control-color-hover: #fff !default;
$plyr-video-control-bg-hover: $plyr-color-main !default;
$plyr-audio-controls-bg: #fff !default;
$plyr-audio-control-color: $plyr-color-fiord !default;
$plyr-audio-control-color-hover: #fff !default;
$plyr-audio-control-bg-hover: $plyr-color-main !default;
// Tooltips
$plyr-tooltip-bg: rgba(#fff, 0.9) !default;
$plyr-tooltip-color: $plyr-color-fiord !default;
$plyr-tooltip-padding: ($plyr-control-spacing / 2) !default;
$plyr-tooltip-arrow-size: 4px !default;
$plyr-tooltip-radius: 3px !default;
$plyr-tooltip-shadow: 0 1px 2px rgba(#000, 0.15) !default;
// Menus
$plyr-menu-bg: $plyr-tooltip-bg !default;
$plyr-menu-color: $plyr-tooltip-color !default;
$plyr-menu-arrow-size: 6px !default;
$plyr-menu-border-color: $plyr-color-heather !default;
$plyr-menu-border-shadow-color: #fff !default;
$plyr-menu-shadow: 0 1px 2px rgba(#000, 0.15) !default;
// Progress
$plyr-progress-loading-size: 25px !default;
$plyr-progress-loading-bg: rgba($plyr-color-gunmetal, 0.2) !default;
$plyr-video-progress-buffered-bg: rgba(#fff, 0.25) !default;
$plyr-audio-progress-buffered-bg: rgba($plyr-color-heather, 0.66) !default;
// Range sliders
$plyr-range-track-height: 6px !default;
$plyr-range-thumb-height: 14px !default;
$plyr-range-thumb-bg: #fff !default;
$plyr-range-thumb-border: 2px solid transparent !default;
$plyr-range-thumb-shadow: 0 1px 1px rgba($plyr-video-controls-bg, 0.15), 0 0 0 1px rgba($plyr-color-gunmetal, 0.2) !default;
$plyr-range-fill-bg: $plyr-color-main !default;
$plyr-range-thumb-active-border-color: #fff !default;
$plyr-range-thumb-active-bg: $plyr-video-control-bg-hover !default;
$plyr-range-thumb-active-height: 20px !default;
$plyr-video-range-track-bg: $plyr-video-progress-buffered-bg !default;
$plyr-audio-range-track-bg: $plyr-audio-progress-buffered-bg !default;
// Breakpoints
$plyr-bp-sm: 480px !default;
$plyr-bp-md: 768px !default;
$plyr-bp-lg: 1024px !default;
// Max-width media queries
$plyr-bp-xs-max: ($plyr-bp-sm - 1) !default;
$plyr-bp-sm-max: ($plyr-bp-md - 1) !default;
$plyr-bp-md-max: ($plyr-bp-lg - 1) !default;

View File

@ -3,29 +3,29 @@
// --------------------------------------------------------------
.plyr:fullscreen {
.plyr-fullscreen-active();
@include plyr-fullscreen-active();
}
.plyr:-webkit-full-screen {
.plyr-fullscreen-active();
@include plyr-fullscreen-active();
}
.plyr:-moz-full-screen {
.plyr-fullscreen-active();
@include plyr-fullscreen-active();
}
.plyr:-ms-fullscreen {
.plyr-fullscreen-active();
@include plyr-fullscreen-active();
}
// Fallback for unsupported browsers
.plyr--fullscreen-fallback {
.plyr-fullscreen-active();
@include plyr-fullscreen-active();
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10000000;
}

View File

@ -6,6 +6,7 @@
.plyr--full-ui [hidden] {
display: none;
}
.plyr--full-ui [aria-hidden='true'] {
display: none;
}
@ -16,18 +17,19 @@
overflow: hidden;
// !important is not always needed
& when(@plyr-sr-only-important = true) {
position: absolute !important;
padding: 0 !important;
@if $plyr-sr-only-important == true {
border: 0 !important;
height: 1px !important;
padding: 0 !important;
position: absolute !important;
width: 1px !important;
}
& when(@plyr-sr-only-important = false) {
position: absolute;
padding: 0;
@if $plyr-sr-only-important == false {
border: 0;
height: 1px;
padding: 0;
position: absolute;
width: 1px;
}
}

View File

@ -1,29 +0,0 @@
// ==========================================================================
// Plyr mixins
// https://github.com/sampotts/plyr
// ==========================================================================
// <input type="range"> styling
@mixin plyr-range-track() {
height: $plyr-range-track-height;
background: transparent;
border: 0;
border-radius: ($plyr-range-track-height / 2);
user-select: none;
}
@mixin plyr-range-thumb() {
position: relative;
height: $plyr-range-thumb-height;
width: $plyr-range-thumb-width;
background: $plyr-range-thumb-bg;
border: $plyr-range-thumb-border;
border-radius: 100%;
transition: background .2s ease, border .2s ease, transform .2s ease;
box-shadow: $plyr-range-thumb-shadow;
box-sizing: border-box;
}
@mixin plyr-range-thumb-active() {
background: $plyr-range-thumb-active-bg;
border-color: $plyr-range-thumb-active-border-color;
transform: scale($plyr-range-thumb-active-scale);
}

View File

@ -1,764 +0,0 @@
// ==========================================================================
// Plyr styles
// https://github.com/sampotts/plyr
// ==========================================================================
@import "variables";
@import "mixins";
// Animation
// ---------------------------------------
@keyframes plyr-progress {
to { background-position: $plyr-progress-loading-size 0; }
}
// Styles
// -------------------------------
// Base
.plyr {
position: relative;
max-width: 100%;
min-width: 200px;
font-family: $plyr-font-family;
direction: ltr;
@if $plyr-border-box == true {
// border-box everything
// http://paulirish.com/2012/box-sizing-border-box-ftw/
&,
*,
*::after,
*::before {
box-sizing: border-box;
}
}
@if $plyr-touch-action == true {
// Fix 300ms delay
a, button, input, label {
touch-action: manipulation;
}
}
// Focus
&:focus {
outline: 0;
}
// Media elements
video,
audio {
width: 100%;
height: auto;
vertical-align: middle;
border-radius: inherit;
}
// Range inputs
// Specificity is for bootstrap compatibility
input[type='range'] {
display: block;
height: ($plyr-range-thumb-height * $plyr-range-thumb-active-scale);
width: 100%;
margin: 0;
padding: 0;
vertical-align: middle;
appearance: none;
cursor: pointer;
border: none;
background: transparent;
// WebKit
&::-webkit-slider-runnable-track {
@include plyr-range-track();
}
&::-webkit-slider-thumb {
-webkit-appearance: none;
margin-top: -(($plyr-range-thumb-height - $plyr-range-track-height) / 2);
@include plyr-range-thumb();
}
// Mozilla
&::-moz-range-track {
@include plyr-range-track();
}
&::-moz-range-thumb {
@include plyr-range-thumb();
}
// Microsoft
&::-ms-track {
height: $plyr-range-track-height;
background: transparent;
border: 0;
color: transparent;
}
&::-ms-fill-upper {
@include plyr-range-track();
}
&::-ms-fill-lower {
@include plyr-range-track();
background: $plyr-range-selected-bg;
}
&::-ms-thumb {
@include plyr-range-thumb();
// For some reason, Edge uses the -webkit margin above
margin-top: 0;
}
&::-ms-tooltip {
display: none;
}
// Focus styles
&:focus {
outline: 0;
}
&::-moz-focus-outer {
border: 0;
}
&.tab-focus:focus {
outline-offset: 3px;
}
// Pressed styles
&:active {
&::-webkit-slider-thumb {
@include plyr-range-thumb-active();
}
&::-moz-range-thumb {
@include plyr-range-thumb-active();
}
&::-ms-thumb {
@include plyr-range-thumb-active();
}
}
}
}
// Video range inputs
.plyr--video input[type='range'].tab-focus:focus {
outline: 1px dotted transparentize($plyr-video-control-color, .5);
}
// Audio range inputs
.plyr--audio input[type='range'].tab-focus:focus {
outline: 1px dotted transparentize($plyr-audio-control-color, .5);
}
// Screen reader only elements
.plyr__sr-only {
clip: rect(1px, 1px, 1px, 1px);
overflow: hidden;
// !important is not always needed
@if $plyr-sr-only-important == true {
position: absolute !important;
padding: 0 !important;
border: 0 !important;
height: 1px !important;
width: 1px !important;
} @else {
position: absolute;
padding: 0;
border: 0;
height: 1px;
width: 1px;
}
}
// Video
.plyr__video-wrapper {
position: relative;
background: #000;
border-radius: inherit;
// Require z-index to force border-radius
z-index: 0;
overflow: hidden;
}
// Container for embeds
.plyr__video-embed {
padding-bottom: 56.25%; /* 16:9 */
height: 0;
border-radius: inherit;
// Require overflow and z-index to force border-radius
overflow: hidden;
z-index: 0;
iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
user-select: none;
}
// Vimeo hack
> div {
position: relative;
padding-bottom: 200%;
transform: translateY(-35.95%);
}
}
// To allow mouse events to be captured if full support
.plyr .plyr__video-embed iframe {
pointer-events: none;
}
// Captions
// --------------------------------------------------------------
// Hide default captions
.plyr video::-webkit-media-text-track-container {
display: none;
}
.plyr__captions {
display: none;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: ($plyr-control-spacing * 2);
transform: translateY(-($plyr-control-spacing * 6));
transition: transform .3s ease;
color: $plyr-captions-color;
font-size: $plyr-font-size-captions-base;
text-align: center;
font-weight: 400;
span {
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;
}
@media (min-width: $plyr-bp-screen-md) {
font-size: $plyr-font-size-captions-medium;
}
}
.plyr--captions-active .plyr__captions {
display: block;
}
.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
// --------------------------------------------------------------
// Hide native controls
.plyr ::-webkit-media-controls {
display: none;
}
// Playback controls
.plyr__controls {
display: flex;
align-items: center;
line-height: 1;
text-align: center;
// Spacing
> .plyr__control,
.plyr__progress,
.plyr__time,
.plyr__menu {
margin-left: ($plyr-control-spacing / 2);
&:first-child,
&:first-child + [data-plyr="pause"] {
margin-left: 0;
}
}
.plyr__volume {
margin-left: ($plyr-control-spacing / 2);
}
// Buttons
button {
position: relative;
display: inline-block;
flex-shrink: 0;
overflow: visible; // IE11
vertical-align: middle;
padding: ($plyr-control-spacing * .7);
border: 0;
background: transparent;
border-radius: 3px;
cursor: pointer;
transition: background .3s ease, color .3s ease, opacity .3s ease;
color: inherit;
svg {
width: $plyr-control-icon-size;
height: $plyr-control-icon-size;
display: block;
fill: currentColor;
pointer-events: none;
}
// Default focus
&:focus {
outline: 0;
}
}
// Hide toggle icons by default
.icon--exit-fullscreen,
.icon--muted,
.icon--captions-on {
display: none;
}
@media (min-width: $plyr-bp-screen-sm) {
> button,
.plyr__progress,
.plyr__time {
margin-left: $plyr-control-spacing;
}
}
}
// Hide controls
.plyr--hide-controls .plyr__controls {
opacity: 0;
pointer-events: none;
}
// Video controls
.plyr--video .plyr__controls {
position: absolute;
left: 0;
right: 0;
bottom: 0;
padding: ($plyr-control-spacing * 5) $plyr-control-spacing $plyr-control-spacing;
background: linear-gradient(transparentize($plyr-video-controls-bg, 1), transparentize($plyr-video-controls-bg, .5));
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
color: $plyr-video-control-color;
transition: opacity .3s ease;
button {
// Hover and tab focus
&.tab-focus:focus,
&:hover {
background: $plyr-video-control-bg-hover;
color: $plyr-video-control-color-hover;
}
}
}
// Audio controls
.plyr--audio .plyr__controls {
padding: $plyr-control-spacing;
border-radius: inherit;
background: $plyr-audio-controls-bg;
border: $plyr-audio-controls-border;
color: $plyr-audio-control-color;
button {
// Hover and tab focus
&.tab-focus:focus,
&:hover {
background: $plyr-audio-control-bg-hover;
color: $plyr-audio-control-color-hover;
}
}
}
// Large play button (video only)
.plyr__play-large {
display: none;
position: absolute;
z-index: 1;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: $plyr-control-spacing;
background: $plyr-video-control-bg-hover;
border: 4px solid currentColor;
border-radius: 100%;
box-shadow: 0 1px 1px transparentize(#000, .85);
color: $plyr-video-control-color;
transition: all .3s ease;
svg {
position: relative;
left: 2px;
width: 20px;
height: 20px;
display: block;
fill: currentColor;
pointer-events: none;
}
&:focus {
outline: 1px dotted transparentize($plyr-video-control-color, .5);
}
}
.plyr .plyr__play-large {
display: inline-block;
}
.plyr--audio .plyr__play-large {
display: none;
}
.plyr--playing .plyr__play-large {
opacity: 0;
visibility: hidden;
}
// States
.plyr__controls [data-plyr='pause'],
.plyr--playing .plyr__controls [data-plyr='play'] {
display: none;
}
.plyr--playing .plyr__controls [data-plyr='pause'] {
display: inline-block;
}
// Change icons on state change
.plyr--fullscreen-active .icon--exit-fullscreen,
.plyr--muted .plyr__controls .icon--muted,
.plyr--captions-active .plyr__controls .icon--captions-on {
display: block;
& + svg {
display: none;
}
}
// Some options are hidden by default
.plyr [data-plyr='captions'],
.plyr [data-plyr='fullscreen'] {
display: none;
}
.plyr--captions-enabled [data-plyr='captions'],
.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
display: inline-block;
}
// Tooltips
// --------------------------------------------------------------
.plyr__tooltip {
position: absolute;
z-index: 2;
bottom: 100%;
margin-bottom: ($plyr-tooltip-padding * 2);
padding: $plyr-tooltip-padding ($plyr-tooltip-padding * 1.5);
pointer-events: none;
opacity: 0;
background: $plyr-tooltip-bg;
border-radius: $plyr-tooltip-radius;
color: $plyr-tooltip-color;
font-size: $plyr-font-size-small;
line-height: 1.3;
transform: translate(-50%, 10px) scale(.8);
transform-origin: 50% 100%;
transition: transform .2s .1s ease, opacity .2s .1s ease;
&::before {
// Arrows
content: '';
position: absolute;
width: 0;
height: 0;
left: 50%;
transform: translateX(-50%);
// The background triangle
bottom: -$plyr-tooltip-arrow-size;
border-right: $plyr-tooltip-arrow-size solid transparent;
border-top: $plyr-tooltip-arrow-size solid $plyr-tooltip-bg;
border-left: $plyr-tooltip-arrow-size solid transparent;
z-index: 2;
}
}
.plyr button:hover .plyr__tooltip,
.plyr button.tab-focus:focus .plyr__tooltip,
.plyr__tooltip--visible {
opacity: 1;
transform: translate(-50%, 0) scale(1);
}
.plyr button:hover .plyr__tooltip {
z-index: 3;
}
// First tooltip
.plyr__controls > button:first-child .plyr__tooltip,
.plyr__controls > button:first-child + button .plyr__tooltip {
left: 0;
transform: translate(0, 10px) scale(.8);
transform-origin: 0 100%;
&::before {
left: ($plyr-control-icon-size / 2) + $plyr-control-padding;
}
}
// Last tooltip
.plyr__controls > button:last-child .plyr__tooltip {
right: 0;
transform: translate(0, 10px) scale(.8);
transform-origin: 100% 100%;
&::before {
left: auto;
right: ($plyr-control-icon-size / 2) + $plyr-control-padding;
transform: translateX(50%);
}
}
.plyr__controls > button:first-child,
.plyr__controls > button:first-child + button,
.plyr__controls > button:last-child {
&:hover .plyr__tooltip,
&.tab-focus:focus .plyr__tooltip,
.plyr__tooltip--visible {
transform: translate(0, 0) scale(1);
}
}
// Playback progress
// --------------------------------------------------------------
// <progress> element
.plyr__progress {
display: none;
position: relative;
flex: 1;
input[type="range"] {
position: relative;
z-index: 2;
&::-webkit-slider-runnable-track {
background: transparent;
}
&::-moz-range-track {
background: transparent;
}
&::-ms-fill-upper {
background: transparent;
}
}
// Seek tooltip to show time
.plyr__tooltip {
left: 0;
}
}
.plyr .plyr__progress {
display: inline-block;
}
.plyr__progress--buffer,
.plyr__progress--played,
.plyr__volume--display {
position: absolute;
left: 0;
top: 50%;
width: 100%;
height: $plyr-range-track-height;
margin: -($plyr-range-track-height / 2) 0 0;
padding: 0;
vertical-align: top;
appearance: none;
border: none;
border-radius: 100px;
&::-webkit-progress-bar {
background: transparent;
}
&::-webkit-progress-value {
background: currentColor;
border-radius: 100px;
min-width: $plyr-range-track-height;
}
&::-moz-progress-bar {
background: currentColor;
border-radius: 100px;
min-width: $plyr-range-track-height;
}
&::-ms-fill {
border-radius: 100px;
}
}
.plyr__progress--played,
.plyr__volume--display {
z-index: 1;
color: $plyr-range-selected-bg;
background: transparent;
transition: none;
&::-webkit-progress-value {
min-width: $plyr-range-track-height;
max-width: 99%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
transition: none;
}
&::-moz-progress-bar {
min-width: $plyr-range-track-height;
max-width: 99%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
transition: none;
}
&::-ms-fill {
display: none;
}
}
.plyr__progress--buffer {
&::-webkit-progress-value {
transition: width .2s ease;
}
&::-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 {
color: $plyr-video-progress-buffered-bg;
}
.plyr--audio .plyr__progress--buffer,
.plyr--audio .plyr__volume--display {
background: $plyr-audio-range-track-bg;
}
.plyr--audio .plyr__progress--buffer {
color: $plyr-audio-progress-buffered-bg;
}
// Loading state
.plyr--loading .plyr__progress--buffer {
animation: plyr-progress 1s linear infinite;
background-size: $plyr-progress-loading-size $plyr-progress-loading-size;
background-repeat: repeat-x;
background-image: linear-gradient(
-45deg,
$plyr-progress-loading-bg 25%,
transparent 25%,
transparent 50%,
$plyr-progress-loading-bg 50%,
$plyr-progress-loading-bg 75%,
transparent 75%,
transparent);
color: transparent;
}
.plyr--video.plyr--loading .plyr__progress--buffer {
background-color: $plyr-video-progress-buffered-bg;
}
.plyr--audio.plyr--loading .plyr__progress--buffer {
background-color: $plyr-audio-progress-buffered-bg;
}
// Time
// --------------------------------------------------------------
.plyr__time {
display: inline-block;
vertical-align: middle;
font-size: $plyr-font-size-small;
}
// Media duration hidden on small screens
.plyr__time + .plyr__time {
display: none;
@media (min-width: $plyr-bp-screen-md) {
display: inline-block;
}
// Add a slash in before
&::before {
content: '\2044';
margin-right: $plyr-control-spacing;
}
}
// Volume
// --------------------------------------------------------------
.plyr__volume {
display: none;
}
.plyr .plyr__volume {
flex: 1;
position: relative;
input[type="range"] {
position: relative;
z-index: 2;
}
@media (min-width: $plyr-bp-screen-sm) {
display: block;
max-width: 60px;
}
@media (min-width: $plyr-bp-screen-md) {
max-width: 100px;
}
}
// Hide sound controls on iOS
// It's not supported to change volume using JavaScript:
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
.plyr--is-ios .plyr__volume,
.plyr--is-ios [data-plyr='mute'] {
display: none !important;
}
// Fullscreen
// --------------------------------------------------------------
.plyr--fullscreen-active {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
height: 100%;
width: 100%;
z-index: 10000000;
background: #000;
border-radius: 0 !important;
video {
height: 100%;
}
.plyr__video-wrapper {
height: 100%;
width: 100%;
}
.plyr__video-embed {
// Revert overflow change
overflow: visible;
}
.plyr__controls {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
// Vimeo requires some different styling
&.plyr--vimeo .plyr__video-wrapper {
height: 0;
top: 50%;
transform: translateY(-50%);
}
}

View File

@ -1,73 +0,0 @@
// ==========================================================================
// Plyr variables
// https://github.com/sampotts/plyr
// https://robots.thoughtbot.com/sass-default
// ==========================================================================
// Settings
$plyr-border-box: true !default;
$plyr-touch-action: true !default;
$plyr-sr-only-important: true !default;
// Colors
$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;
// Captions
$plyr-captions-bg: transparentize(#000, .4) !default;
$plyr-captions-color: #fff !default;
$plyr-font-size-captions-base: $plyr-font-size-base !default;
$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
$plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default;
// Controls
$plyr-control-icon-size: 18px !default;
$plyr-control-spacing: 10px !default;
$plyr-control-padding: ($plyr-control-spacing * .7) !default;
$plyr-video-controls-bg: #000 !default;
$plyr-video-control-color: #fff !default;
$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-control-color: #565D64 !default;
$plyr-audio-control-color-hover: #fff !default;
$plyr-audio-control-bg-hover: $plyr-color-main;
// Tooltips
$plyr-tooltip-bg: transparentize(#000, .3) !default;
$plyr-tooltip-color: #fff !default;
$plyr-tooltip-padding: ($plyr-control-spacing / 2) !default;
$plyr-tooltip-arrow-size: 4px !default;
$plyr-tooltip-radius: 3px !default;
// Progress
$plyr-progress-loading-size: 25px !default;
$plyr-progress-loading-bg: transparentize(#000, .85) !default;
$plyr-video-progress-bg: transparentize(#fff, .75) !default;
$plyr-video-progress-buffered-bg: $plyr-video-progress-bg !default;
$plyr-audio-progress-bg: transparentize(#C6D6DB, .33) !default;
$plyr-audio-progress-buffered-bg: $plyr-audio-progress-bg !default;
// Range sliders
$plyr-range-track-height: 8px !default;
$plyr-range-thumb-height: floor($plyr-range-track-height * 2) !default;
$plyr-range-thumb-width: floor($plyr-range-track-height * 2) !default;
$plyr-range-thumb-bg: #fff !default;
$plyr-range-thumb-border: 2px solid transparent !default;
$plyr-range-thumb-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85), 0 0 0 1px transparentize(#000, .85) !default;
$plyr-range-thumb-active-border-color: #fff !default;
$plyr-range-thumb-active-bg: $plyr-video-control-bg-hover !default;
$plyr-range-thumb-active-scale: 1.25 !default;
$plyr-video-range-track-bg: $plyr-video-progress-buffered-bg !default;
$plyr-audio-range-track-bg: $plyr-audio-progress-buffered-bg !default;
$plyr-range-selected-bg: $plyr-color-main !default;
// Breakpoints
$plyr-bp-screen-sm: 480px !default;
$plyr-bp-screen-md: 768px !default;
$plyr-bp-screen-lg: 1024px !default;

5731
yarn.lock Normal file

File diff suppressed because it is too large Load Diff