Merge branch 'master' into develop
This commit is contained in:
commit
c64c8ac6c0
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"plugins": ["stylelint-selector-bem-pattern", "stylelint-scss"],
|
"plugins": ["stylelint-selector-bem-pattern"],
|
||||||
"extends": ["stylelint-config-recommended", "stylelint-config-sass-guidelines", "stylelint-config-prettier"],
|
"extends": ["stylelint-config-sass-guidelines", "stylelint-config-prettier"],
|
||||||
|
"customSyntax": "postcss-scss",
|
||||||
"rules": {
|
"rules": {
|
||||||
"selector-class-pattern": null,
|
"selector-class-pattern": null,
|
||||||
"selector-no-qualifying-type": [
|
"selector-no-qualifying-type": [
|
||||||
@ -9,10 +10,7 @@
|
|||||||
"ignore": ["attribute", "class"]
|
"ignore": ["attribute", "class"]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"string-no-newline": null,
|
"max-nesting-depth": 4,
|
||||||
"indentation": 2,
|
|
||||||
"string-quotes": "single",
|
|
||||||
"max-nesting-depth": 2,
|
|
||||||
"plugin/selector-bem-pattern": {
|
"plugin/selector-bem-pattern": {
|
||||||
"preset": "bem",
|
"preset": "bem",
|
||||||
"componentName": "(([a-z0-9]+(?!-$)-?)+)",
|
"componentName": "(([a-z0-9]+(?!-$)-?)+)",
|
||||||
|
42
CHANGELOG.md
42
CHANGELOG.md
@ -1,6 +1,22 @@
|
|||||||
|
### v3.6.12
|
||||||
|
|
||||||
|
- Fix: remove division logic from ads.scss (fixes #2370)
|
||||||
|
|
||||||
|
### v3.6.11
|
||||||
|
|
||||||
|
- Fix: Replace `list.slash` added in 3.6.10 with `calc`
|
||||||
|
- Chore: Package upgrades
|
||||||
|
- Chore: Sass clean up
|
||||||
|
- Chore: Improvements to style linting
|
||||||
|
|
||||||
|
### v3.6.10
|
||||||
|
|
||||||
|
- Fix: Use `list.slash` instead of deprecated syntax
|
||||||
|
- Chore: Clean up demo
|
||||||
|
|
||||||
### v3.6.9
|
### v3.6.9
|
||||||
|
|
||||||
- Fix: SASS issue with division (thanks @ROL4ND909 and @le0pard)
|
- Fix: Sass issue with division (thanks @ROL4ND909 and @le0pard)
|
||||||
- Fix: Captions when switching sources (thanks @zexingguo)
|
- Fix: Captions when switching sources (thanks @zexingguo)
|
||||||
- Fix: Icons loading within iframes (thanks @ajgagnon)
|
- Fix: Icons loading within iframes (thanks @ajgagnon)
|
||||||
- Chore: Update TypeScript types (thanks @Jackie1210 and @AntLevin)
|
- Chore: Update TypeScript types (thanks @Jackie1210 and @AntLevin)
|
||||||
@ -61,7 +77,7 @@
|
|||||||
- Fix "A `ReferenceError: _classCallCheck is not defined` error has occurred." error (thanks @hex-ci)
|
- Fix "A `ReferenceError: _classCallCheck is not defined` error has occurred." error (thanks @hex-ci)
|
||||||
- Fix issue with CSS custom property check (thanks @syedhusain-appspace)
|
- Fix issue with CSS custom property check (thanks @syedhusain-appspace)
|
||||||
- Fix for slow loading videos not autoplaying (thanks @DanielHuntleySBG)
|
- Fix for slow loading videos not autoplaying (thanks @DanielHuntleySBG)
|
||||||
- Fix for betwork requests are not cancelled after the player is destroyed (thanks @DanielHuntleySBG)
|
- Fix for network requests are not cancelled after the player is destroyed (thanks @DanielHuntleySBG)
|
||||||
- Added option to disable custom controls for YouTube and Vimeo
|
- Added option to disable custom controls for YouTube and Vimeo
|
||||||
|
|
||||||
### v3.6.2
|
### v3.6.2
|
||||||
@ -106,7 +122,7 @@
|
|||||||
### v3.5.8
|
### v3.5.8
|
||||||
|
|
||||||
- Added `flex-direction` property to fix some issues introduced in v3.5.7 when using custom CSS
|
- Added `flex-direction` property to fix some issues introduced in v3.5.7 when using custom CSS
|
||||||
- Cleaned up the organisation of some of the SCSS files (should not effect CSS output)
|
- Cleaned up the organization of some of the SCSS files (should not effect CSS output)
|
||||||
- Added `referrerPolicy` option for Vimeo to prevent an issue present in the demo site
|
- Added `referrerPolicy` option for Vimeo to prevent an issue present in the demo site
|
||||||
- Remove all Vimeo controls for Pro & Premium accounts
|
- Remove all Vimeo controls for Pro & Premium accounts
|
||||||
- Improve thumbnail size calculations when size is set per css (thanks @ydylla)
|
- Improve thumbnail size calculations when size is set per css (thanks @ydylla)
|
||||||
@ -121,7 +137,7 @@
|
|||||||
- Accessibility tweak for the play button (thanks @lunika)
|
- Accessibility tweak for the play button (thanks @lunika)
|
||||||
- Fix for ads configuration (thanks @SoftCreatR)
|
- Fix for ads configuration (thanks @SoftCreatR)
|
||||||
- Fix handling listener return value (thanks @taion)
|
- Fix handling listener return value (thanks @taion)
|
||||||
- Added localisation key for PIP (picture-in-picture) (thanks @lmislm)
|
- Added localization key for PIP (picture-in-picture) (thanks @lmislm)
|
||||||
- Preserve viewBox attribute in SVG sprite symbols (thanks @bseib)
|
- Preserve viewBox attribute in SVG sprite symbols (thanks @bseib)
|
||||||
- Fix being unable to unmute autoplayed video on iOS (thanks @sumanbh)
|
- Fix being unable to unmute autoplayed video on iOS (thanks @sumanbh)
|
||||||
- Fixed Plyr container not resizing responsively (thanks @shravan2x)
|
- Fixed Plyr container not resizing responsively (thanks @shravan2x)
|
||||||
@ -155,7 +171,7 @@ _Note:_ This update contains CSS changes.
|
|||||||
### v3.5.4
|
### v3.5.4
|
||||||
|
|
||||||
- Added: Set download URL via new setter
|
- Added: Set download URL via new setter
|
||||||
- Improvement: The order of the `controls` option now effects the order in the DOM - i.e. you can re-order the controls - Note: this may break any custom CSS you have setup. Please see the changes in the PR to the default SASS
|
- Improvement: The order of the `controls` option now effects the order in the DOM - i.e. you can re-order the controls - Note: this may break any custom CSS you have setup. Please see the changes in the PR to the default Sass
|
||||||
- Fixed issue with empty controls and preview thumbs
|
- Fixed issue with empty controls and preview thumbs
|
||||||
- Fixed issue with setGutter call (from Sentry)
|
- Fixed issue with setGutter call (from Sentry)
|
||||||
- Fixed issue with initial selected speed not working
|
- Fixed issue with initial selected speed not working
|
||||||
@ -518,7 +534,7 @@ This is a massive release. A _mostly_ complete rewrite in ES6. What started out
|
|||||||
|
|
||||||
### Other stuff
|
### Other stuff
|
||||||
|
|
||||||
- Now using SASS exclusively. Sorry, LESS folk it just made sense to maintain one method as SASS is what the cool kids use. It may come back if we work out an automated way to convert the SASS
|
- Now using Sass exclusively. Sorry, LESS folk it just made sense to maintain one method as Sass is what the cool kids use. It may come back if we work out an automated way to convert the Sass
|
||||||
- Moved to ES6. All the rage these days. You'll need to look at polyfills. The demo uses [polyfill.io](https://polyfill.io)
|
- Moved to ES6. All the rage these days. You'll need to look at polyfills. The demo uses [polyfill.io](https://polyfill.io)
|
||||||
- Added basic looping support
|
- Added basic looping support
|
||||||
- Added an aspect ratio option for those that can't leave the 90s and want 4:3
|
- Added an aspect ratio option for those that can't leave the 90s and want 4:3
|
||||||
@ -751,7 +767,7 @@ And some other changes and bug fixes:
|
|||||||
|
|
||||||
## v1.7.0
|
## v1.7.0
|
||||||
|
|
||||||
- SASS cleanup (fixes #265)
|
- Sass cleanup (fixes #265)
|
||||||
- Docs tidy up to help quick start (fixes #253)
|
- Docs tidy up to help quick start (fixes #253)
|
||||||
- Fix for issues with data attribute options passing (fixes #257)
|
- 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)
|
- **_(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)
|
||||||
@ -873,7 +889,7 @@ And some other changes and bug fixes:
|
|||||||
### v1.5.18
|
### v1.5.18
|
||||||
|
|
||||||
- Added 'ready' event for initial setup complete or source change occurs
|
- Added 'ready' event for initial setup complete or source change occurs
|
||||||
- Fixed SASS stylesheet references to transparentize
|
- Fixed Sass stylesheet references to transparentize
|
||||||
- Added default font stack to controls
|
- Added default font stack to controls
|
||||||
- Docs fixes inc controls HTML (fixes #180)
|
- Docs fixes inc controls HTML (fixes #180)
|
||||||
|
|
||||||
@ -910,7 +926,7 @@ And some other changes and bug fixes:
|
|||||||
|
|
||||||
- iOS embed bug fixes (fixes #166)
|
- iOS embed bug fixes (fixes #166)
|
||||||
- Hide IE/Edge <input type='range'> tooltip (since we have a styled one) (fixes #160)
|
- Hide IE/Edge <input type='range'> tooltip (since we have a styled one) (fixes #160)
|
||||||
- SASS bug fix for default values (fixes #158)
|
- Sass bug fix for default values (fixes #158)
|
||||||
|
|
||||||
### v1.5.9
|
### v1.5.9
|
||||||
|
|
||||||
@ -932,7 +948,7 @@ And some other changes and bug fixes:
|
|||||||
### v1.5.6
|
### v1.5.6
|
||||||
|
|
||||||
- Seek tooltip (option for tooltips changed, please check docs)
|
- Seek tooltip (option for tooltips changed, please check docs)
|
||||||
- SASS compile error fixes (fixes #148)
|
- Sass compile error fixes (fixes #148)
|
||||||
- Fullscreen fixes for controls not always hiding/showing (fixes #149)
|
- 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)
|
- Screen reader icon fixes (title was being read twice due to the tooltip/hidden label)
|
||||||
|
|
||||||
@ -1009,7 +1025,7 @@ And some other changes and bug fixes:
|
|||||||
|
|
||||||
### v1.2.6
|
### v1.2.6
|
||||||
|
|
||||||
- SASS updates and fixes (cheers @ChristianPV)
|
- Sass updates and fixes (cheers @ChristianPV)
|
||||||
|
|
||||||
### v1.2.5
|
### v1.2.5
|
||||||
|
|
||||||
@ -1124,7 +1140,7 @@ And some other changes and bug fixes:
|
|||||||
|
|
||||||
### v1.0.26
|
### v1.0.26
|
||||||
|
|
||||||
- Fixes for SASS (cheers @brunowego)
|
- Fixes for Sass (cheers @brunowego)
|
||||||
- Indentation reset to 4 spaces
|
- Indentation reset to 4 spaces
|
||||||
|
|
||||||
### v1.0.25
|
### v1.0.25
|
||||||
@ -1169,7 +1185,7 @@ And some other changes and bug fixes:
|
|||||||
|
|
||||||
### v1.0.17
|
### v1.0.17
|
||||||
|
|
||||||
- SASS support added (thanks to @brunowego)
|
- Sass support added (thanks to @brunowego)
|
||||||
- Docs completely separated to avoid any confusion
|
- Docs completely separated to avoid any confusion
|
||||||
- New gulp tasks (will add more documentation for this)
|
- New gulp tasks (will add more documentation for this)
|
||||||
|
|
||||||
|
54
CONTROLS.md
54
CONTROLS.md
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
This is the markup that is rendered for the Plyr controls. You can use the default controls or provide a customized version of markup based on your needs. You can pass the following to the `controls` option:
|
This is the markup that is rendered for the Plyr controls. You can use the default controls or provide a customized version of markup based on your needs. You can pass the following to the `controls` option:
|
||||||
|
|
||||||
- `Array` of options (this builds the default controls based on your choices)
|
- `Array` of options (this builds the default controls based on your choices)
|
||||||
- `Element` with the controls
|
- `Element` with the controls
|
||||||
- `String` containing the desired HTML
|
- `String` containing the desired HTML
|
||||||
- `false` (or empty string or array) to disable all controls
|
- `false` (or empty string or array) to disable all controls
|
||||||
- `Function` that will be executed and should return one of the above
|
- `Function` that will be executed and should return one of the above
|
||||||
|
|
||||||
## Using default controls
|
## Using default controls
|
||||||
|
|
||||||
@ -14,28 +14,28 @@ If you want to use the standard controls as they are, you don't need to pass any
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
controls: [
|
controls: [
|
||||||
'play-large', // The large play button in the center
|
'play-large', // The large play button in the center
|
||||||
'restart', // Restart playback
|
'restart', // Restart playback
|
||||||
'rewind', // Rewind by the seek time (default 10 seconds)
|
'rewind', // Rewind by the seek time (default 10 seconds)
|
||||||
'play', // Play/pause playback
|
'play', // Play/pause playback
|
||||||
'fast-forward', // Fast forward by the seek time (default 10 seconds)
|
'fast-forward', // Fast forward by the seek time (default 10 seconds)
|
||||||
'progress', // The progress bar and scrubber for playback and buffering
|
'progress', // The progress bar and scrubber for playback and buffering
|
||||||
'current-time', // The current time of playback
|
'current-time', // The current time of playback
|
||||||
'duration', // The full duration of the media
|
'duration', // The full duration of the media
|
||||||
'mute', // Toggle mute
|
'mute', // Toggle mute
|
||||||
'volume', // Volume control
|
'volume', // Volume control
|
||||||
'captions', // Toggle captions
|
'captions', // Toggle captions
|
||||||
'settings', // Settings menu
|
'settings', // Settings menu
|
||||||
'pip', // Picture-in-picture (currently Safari only)
|
'pip', // Picture-in-picture (currently Safari only)
|
||||||
'airplay', // Airplay (currently Safari only)
|
'airplay', // Airplay (currently Safari only)
|
||||||
'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
|
'download', // Show a download button with a link to either the current source or a custom URL you specify in your options
|
||||||
'fullscreen', // Toggle fullscreen
|
'fullscreen', // Toggle fullscreen
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
|
||||||
### Internationalization using default controls
|
### Internationalization using default controls
|
||||||
|
|
||||||
You can provide an `i18n` object as one of your options when initialising the plugin which we be used when rendering the controls.
|
You can provide an `i18n` object as one of your options when initializing the plugin which we be used when rendering the controls.
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
@ -84,14 +84,14 @@ The classes and data attributes used in your template should match the `selector
|
|||||||
|
|
||||||
You need to add several placeholders to your HTML template that are replaced when rendering:
|
You need to add several placeholders to your HTML template that are replaced when rendering:
|
||||||
|
|
||||||
- `{id}` - the dynamically generated ID for the player (for form controls)
|
- `{id}` - the dynamically generated ID for the player (for form controls)
|
||||||
- `{seektime}` - the seek time specified in options for fast forward and rewind
|
- `{seektime}` - the seek time specified in options for fast forward and rewind
|
||||||
- `{title}` - the title of your media, if specified
|
- `{title}` - the title of your media, if specified
|
||||||
|
|
||||||
### Limitations
|
### Limitations
|
||||||
|
|
||||||
- Currently the settings menus are not supported with custom controls HTML
|
- Currently the settings menus are not supported with custom controls HTML
|
||||||
- AirPlay and PiP buttons can be added but you will have to manage feature detection
|
- AirPlay and PiP buttons can be added but you will have to manage feature detection
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
134
README.md
134
README.md
@ -1,3 +1,6 @@
|
|||||||
|
🎉 | [Plyr is merging into Vidstack](https://github.com/sampotts/plyr/issues/2408) | 🎉
|
||||||
|
:---: | :---: | :---
|
||||||
|
|
||||||
Plyr is a simple, lightweight, accessible and customizable HTML5, YouTube and Vimeo media player that supports [_modern_](#browser-support) browsers.
|
Plyr is a simple, lightweight, accessible and customizable HTML5, YouTube and Vimeo media player that supports [_modern_](#browser-support) browsers.
|
||||||
|
|
||||||
[Checkout the demo](https://plyr.io) - [Donate](#donate) - [Slack](https://bit.ly/plyr--chat)
|
[Checkout the demo](https://plyr.io) - [Donate](#donate) - [Slack](https://bit.ly/plyr--chat)
|
||||||
@ -27,7 +30,7 @@ Plyr is a simple, lightweight, accessible and customizable HTML5, YouTube and Vi
|
|||||||
- 🌎 **i18n support** - support for internationalization of controls
|
- 🌎 **i18n support** - support for internationalization of controls
|
||||||
- 👌 **[Preview thumbnails](#preview-thumbnails)** - support for displaying preview thumbnails
|
- 👌 **[Preview thumbnails](#preview-thumbnails)** - support for displaying preview thumbnails
|
||||||
- 🤟 **No frameworks** - written in "vanilla" ES6 JavaScript, no jQuery required
|
- 🤟 **No frameworks** - written in "vanilla" ES6 JavaScript, no jQuery required
|
||||||
- 💁♀️ **SASS** - to include in your build processes
|
- 💁♀️ **Sass** - to include in your build processes
|
||||||
|
|
||||||
### Demos
|
### Demos
|
||||||
|
|
||||||
@ -131,21 +134,21 @@ Alternatively you can include the `plyr.js` script before the closing `</body>`
|
|||||||
|
|
||||||
See [initialising](#initialising) for more information on advanced setups.
|
See [initialising](#initialising) for more information on advanced setups.
|
||||||
|
|
||||||
You can use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript. There's 2 versions; one with and one without [polyfills](#polyfills). My recommendation would be to manage polyfills seperately as part of your application but to make life easier you can use the polyfilled build.
|
You can use our CDN (provided by [Fastly](https://www.fastly.com/)) for the JavaScript. There's 2 versions; one with and one without [polyfills](#polyfills). My recommendation would be to manage polyfills separately as part of your application but to make life easier you can use the polyfilled build.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/3.6.9/plyr.js"></script>
|
<script src="https://cdn.plyr.io/3.6.12/plyr.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
...or...
|
...or...
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.plyr.io/3.6.9/plyr.polyfilled.js"></script>
|
<script src="https://cdn.plyr.io/3.6.12/plyr.polyfilled.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
## CSS
|
## CSS
|
||||||
|
|
||||||
Include the `plyr.css` stylsheet into your `<head>`.
|
Include the `plyr.css` stylesheet into your `<head>`.
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="path/to/plyr.css" />
|
<link rel="stylesheet" href="path/to/plyr.css" />
|
||||||
@ -154,13 +157,13 @@ Include the `plyr.css` stylsheet into your `<head>`.
|
|||||||
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following:
|
If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<link rel="stylesheet" href="https://cdn.plyr.io/3.6.9/plyr.css" />
|
<link rel="stylesheet" href="https://cdn.plyr.io/3.6.12/plyr.css" />
|
||||||
```
|
```
|
||||||
|
|
||||||
## SVG Sprite
|
## SVG Sprite
|
||||||
|
|
||||||
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). To change this, see the [options](#options) below. For
|
The SVG sprite is loaded automatically from our CDN (provided by [Fastly](https://www.fastly.com/)). To change this, see the [options](#options) below. For
|
||||||
reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.6.9/plyr.svg`.
|
reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.6.12/plyr.svg`.
|
||||||
|
|
||||||
# Ads
|
# Ads
|
||||||
|
|
||||||
@ -184,43 +187,43 @@ Here's a list of the properties and what they are used for:
|
|||||||
|
|
||||||
| Name | Description | Default / Fallback |
|
| Name | Description | Default / Fallback |
|
||||||
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
|
||||||
| `--plyr-color-main` | The primary UI color. |  `#00b3ff` |
|
| `--plyr-color-main` | The primary UI color. |  `#00b3ff` |
|
||||||
| `--plyr-video-background` | The background color of video and poster wrappers for using alpha channel videos and poster images. | `rgba(0, 0, 0, 1)` |
|
| `--plyr-video-background` | The background color of video and poster wrappers for using alpha channel videos and poster images. | `rgba(0, 0, 0, 1)` |
|
||||||
| `--plyr-tab-focus-color` | The color used for the dotted outline when an element is `:focus-visible` (equivalent) keyboard focus. | `--plyr-color-main` |
|
| `--plyr-tab-focus-color` | The color used for the dotted outline when an element is `:focus-visible` (equivalent) keyboard focus. | `--plyr-color-main` |
|
||||||
| `--plyr-badge-background` | The background color for badges in the menu. |  `#4a5464` |
|
| `--plyr-badge-background` | The background color for badges in the menu. |  `#4a5464` |
|
||||||
| `--plyr-badge-text-color` | The text color for badges. |  `#ffffff` |
|
| `--plyr-badge-text-color` | The text color for badges. |  `#ffffff` |
|
||||||
| `--plyr-badge-border-radius` | The border radius used for badges. | `2px` |
|
| `--plyr-badge-border-radius` | The border radius used for badges. | `2px` |
|
||||||
| `--plyr-tab-focus-color` | The color used to highlight tab (keyboard) focus. | `--plyr-color-main` |
|
| `--plyr-tab-focus-color` | The color used to highlight tab (keyboard) focus. | `--plyr-color-main` |
|
||||||
| `--plyr-captions-background` | The color for the background of captions. | `rgba(0, 0, 0, 0.8)` |
|
| `--plyr-captions-background` | The color for the background of captions. | `rgba(0, 0, 0, 0.8)` |
|
||||||
| `--plyr-captions-text-color` | The color used for the captions text. |  `#ffffff` |
|
| `--plyr-captions-text-color` | The color used for the captions text. |  `#ffffff` |
|
||||||
| `--plyr-control-icon-size` | The size of the icons used in the controls. | `18px` |
|
| `--plyr-control-icon-size` | The size of the icons used in the controls. | `18px` |
|
||||||
| `--plyr-control-spacing` | The space between controls (sometimes used in a multiple - e.g. `10px / 2 = 5px`). | `10px` |
|
| `--plyr-control-spacing` | The space between controls (sometimes used in a multiple - e.g. `10px / 2 = 5px`). | `10px` |
|
||||||
| `--plyr-control-padding` | The padding inside controls. | `--plyr-control-spacing * 0.7` (`7px`) |
|
| `--plyr-control-padding` | The padding inside controls. | `--plyr-control-spacing * 0.7` (`7px`) |
|
||||||
| `--plyr-control-radius` | The border radius used on controls. | `3px` |
|
| `--plyr-control-radius` | The border radius used on controls. | `3px` |
|
||||||
| `--plyr-control-toggle-checked-background` | The background color used for checked menu items. | `--plyr-color-main` |
|
| `--plyr-control-toggle-checked-background` | The background color used for checked menu items. | `--plyr-color-main` |
|
||||||
| `--plyr-video-controls-background` | The background for the video controls. | `linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75))` |
|
| `--plyr-video-controls-background` | The background for the video controls. | `linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75))` |
|
||||||
| `--plyr-video-control-color` | The text/icon color for video controls. |  `#ffffff` |
|
| `--plyr-video-control-color` | The text/icon color for video controls. |  `#ffffff` |
|
||||||
| `--plyr-video-control-color-hover` | The text/icon color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
|
| `--plyr-video-control-color-hover` | The text/icon color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
|
||||||
| `--plyr-video-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
|
| `--plyr-video-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
|
||||||
| `--plyr-audio-controls-background` | The background for the audio controls. |  `#ffffff` |
|
| `--plyr-audio-controls-background` | The background for the audio controls. |  `#ffffff` |
|
||||||
| `--plyr-audio-control-color` | The text/icon color for audio controls. |  `#4a5464` |
|
| `--plyr-audio-control-color` | The text/icon color for audio controls. |  `#4a5464` |
|
||||||
| `--plyr-audio-control-color-hover` | The text/icon color used when audio controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
|
| `--plyr-audio-control-color-hover` | The text/icon color used when audio controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
|
||||||
| `--plyr-audio-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
|
| `--plyr-audio-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
|
||||||
| `--plyr-menu-background` | The background color for menus. | `rgba(255, 255, 255, 0.9)` |
|
| `--plyr-menu-background` | The background color for menus. | `rgba(255, 255, 255, 0.9)` |
|
||||||
| `--plyr-menu-color` | The text/icon color for menu items. |  `#4a5464` |
|
| `--plyr-menu-color` | The text/icon color for menu items. |  `#4a5464` |
|
||||||
| `--plyr-menu-shadow` | The shadow used on menus. | `0 1px 2px rgba(0, 0, 0, 0.15)` |
|
| `--plyr-menu-shadow` | The shadow used on menus. | `0 1px 2px rgba(0, 0, 0, 0.15)` |
|
||||||
| `--plyr-menu-radius` | The border radius on the menu. | `4px` |
|
| `--plyr-menu-radius` | The border radius on the menu. | `4px` |
|
||||||
| `--plyr-menu-arrow-size` | The size of the arrow on the bottom of the menu. | `6px` |
|
| `--plyr-menu-arrow-size` | The size of the arrow on the bottom of the menu. | `6px` |
|
||||||
| `--plyr-menu-item-arrow-color` | The color of the arrows in the menu. |  `#728197` |
|
| `--plyr-menu-item-arrow-color` | The color of the arrows in the menu. |  `#728197` |
|
||||||
| `--plyr-menu-item-arrow-size` | The size of the arrows in the menu. | `4px` |
|
| `--plyr-menu-item-arrow-size` | The size of the arrows in the menu. | `4px` |
|
||||||
| `--plyr-menu-border-color` | The border color for the bottom of the back button in the top of the sub menu pages. |  `#dcdfe5` |
|
| `--plyr-menu-border-color` | The border color for the bottom of the back button in the top of the sub menu pages. |  `#dcdfe5` |
|
||||||
| `--plyr-menu-border-shadow-color` | The shadow below the border of the back button in the top of the sub menu pages. |  `#ffffff` |
|
| `--plyr-menu-border-shadow-color` | The shadow below the border of the back button in the top of the sub menu pages. |  `#ffffff` |
|
||||||
| `--plyr-progress-loading-size` | The size of the stripes in the loading state in the scrubber. | `25px` |
|
| `--plyr-progress-loading-size` | The size of the stripes in the loading state in the scrubber. | `25px` |
|
||||||
| `--plyr-progress-loading-background` | The background color on the loading state in the scrubber. | `rgba(35, 40, 47, 0.6)` |
|
| `--plyr-progress-loading-background` | The background color on the loading state in the scrubber. | `rgba(35, 40, 47, 0.6)` |
|
||||||
| `--plyr-video-progress-buffered-background` | The fill color for the buffer indication in the scrubber for video. | `rgba(255, 255, 255, 0.25)` |
|
| `--plyr-video-progress-buffered-background` | The fill color for the buffer indication in the scrubber for video. | `rgba(255, 255, 255, 0.25)` |
|
||||||
| `--plyr-audio-progress-buffered-background` | The fill color for the buffer indication in the scrubber for audio. | `rgba(193, 200, 209, 0.6)` |
|
| `--plyr-audio-progress-buffered-background` | The fill color for the buffer indication in the scrubber for audio. | `rgba(193, 200, 209, 0.6)` |
|
||||||
| `--plyr-range-thumb-height` | The height of the scrubber handle/thumb. | `13px` |
|
| `--plyr-range-thumb-height` | The height of the scrubber handle/thumb. | `13px` |
|
||||||
| `--plyr-range-thumb-background` | The background of the scrubber handle/thumb. |  `#ffffff` |
|
| `--plyr-range-thumb-background` | The background of the scrubber handle/thumb. |  `#ffffff` |
|
||||||
| `--plyr-range-thumb-shadow` | The shadow of the scrubber handle/thumb. | `0 1px 1px rgba(215, 26, 18, 0.15), 0 0 0 1px rgba(215, 26, 18, 0.2)` |
|
| `--plyr-range-thumb-shadow` | The shadow of the scrubber handle/thumb. | `0 1px 1px rgba(215, 26, 18, 0.15), 0 0 0 1px rgba(215, 26, 18, 0.2)` |
|
||||||
| `--plyr-range-thumb-active-shadow-width` | The width of the shadow when the scrubber handle/thumb is `:active` (pressed). | `3px` |
|
| `--plyr-range-thumb-active-shadow-width` | The width of the shadow when the scrubber handle/thumb is `:active` (pressed). | `3px` |
|
||||||
| `--plyr-range-track-height` | The height of the scrubber/progress track. | `5px` |
|
| `--plyr-range-track-height` | The height of the scrubber/progress track. | `5px` |
|
||||||
@ -230,7 +233,7 @@ Here's a list of the properties and what they are used for:
|
|||||||
| `--plyr-audio-range-track-background` | The background of the scrubber/progress. | `--plyr-video-progress-buffered-background` |
|
| `--plyr-audio-range-track-background` | The background of the scrubber/progress. | `--plyr-video-progress-buffered-background` |
|
||||||
| `--plyr-audio-range-thumb-active-shadow-color` | The color of the shadow when the audio scrubber handle/thumb is `:active` (pressed). | `rgba(215, 26, 18, 0.1)` |
|
| `--plyr-audio-range-thumb-active-shadow-color` | The color of the shadow when the audio scrubber handle/thumb is `:active` (pressed). | `rgba(215, 26, 18, 0.1)` |
|
||||||
| `--plyr-tooltip-background` | The background color for tooltips. | `rgba(255, 255, 255, 0.9)` |
|
| `--plyr-tooltip-background` | The background color for tooltips. | `rgba(255, 255, 255, 0.9)` |
|
||||||
| `--plyr-tooltip-color` | The text color for tooltips. |  `#4a5464` |
|
| `--plyr-tooltip-color` | The text color for tooltips. |  `#4a5464` |
|
||||||
| `--plyr-tooltip-padding` | The padding for tooltips. | `calc(var(--plyr-control-spacing) / 2))` |
|
| `--plyr-tooltip-padding` | The padding for tooltips. | `calc(var(--plyr-control-spacing) / 2))` |
|
||||||
| `--plyr-tooltip-arrow-size` | The size of the arrow under tooltips. | `4px` |
|
| `--plyr-tooltip-arrow-size` | The size of the arrow under tooltips. | `4px` |
|
||||||
| `--plyr-tooltip-radius` | The border radius on tooltips. | `3px` |
|
| `--plyr-tooltip-radius` | The border radius on tooltips. | `3px` |
|
||||||
@ -267,14 +270,12 @@ You can set them in your CSS for all players:
|
|||||||
...or in your HTML:
|
...or in your HTML:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<video class="player" style="--plyr-color-main: #1ac266;">
|
<video class="player" style="--plyr-color-main: #1ac266;">...</video>
|
||||||
...
|
|
||||||
</video>
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### SASS
|
### Sass
|
||||||
|
|
||||||
You can use `plyr.scss` file included in `/src/sass` as part of your build and change variables to suit your design. The SASS requires you to
|
You can use `plyr.scss` file included in `/src/sass` as part of your build and change variables to suit your design. The Sass requires you to
|
||||||
use [autoprefixer](https://www.npmjs.com/package/gulp-autoprefixer) (you should be already!) as all declarations use the W3C definitions.
|
use [autoprefixer](https://www.npmjs.com/package/gulp-autoprefixer) (you should be already!) as all declarations use the W3C definitions.
|
||||||
|
|
||||||
The HTML markup uses the BEM methodology with `plyr` as the block, e.g. `.plyr__controls`. You can change the class hooks in the options to match any custom CSS
|
The HTML markup uses the BEM methodology with `plyr` as the block, e.g. `.plyr__controls`. You can change the class hooks in the options to match any custom CSS
|
||||||
@ -344,7 +345,7 @@ The HTMLElement or string selector can be the target `<video>`, `<audio>`, or `<
|
|||||||
You have two choices here. You can either use a simple array loop to map the constructor:
|
You have two choices here. You can either use a simple array loop to map the constructor:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const players = Array.from(document.querySelectorAll('.js-player')).map(p => new Plyr(p));
|
const players = Array.from(document.querySelectorAll('.js-player')).map((p) => new Plyr(p));
|
||||||
```
|
```
|
||||||
|
|
||||||
...or use a static method where you can pass a [CSS string selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), a [NodeList](https://developer.mozilla.org/en-US/docs/Web/API/NodeList), an [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElement), or a [JQuery](https://jquery.com) object:
|
...or use a static method where you can pass a [CSS string selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors), a [NodeList](https://developer.mozilla.org/en-US/docs/Web/API/NodeList), an [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElement), or a [JQuery](https://jquery.com) object:
|
||||||
@ -400,7 +401,7 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke
|
|||||||
| `invertTime` | Boolean | `true` | Display the current time as a countdown rather than an incremental counter. |
|
| `invertTime` | Boolean | `true` | Display the current time as a countdown rather than an incremental counter. |
|
||||||
| `toggleInvert` | Boolean | `true` | Allow users to click to toggle the above. |
|
| `toggleInvert` | Boolean | `true` | Allow users to click to toggle the above. |
|
||||||
| `listeners` | Object | `null` | Allows binding of event listeners to the controls before the default handlers. See the `defaults.js` for available listeners. If your handler prevents default on the event (`event.preventDefault()`), the default handler will not fire. |
|
| `listeners` | Object | `null` | Allows binding of event listeners to the controls before the default handlers. See the `defaults.js` for available listeners. If your handler prevents default on the event (`event.preventDefault()`), the default handler will not fire. |
|
||||||
| `captions` | Object | `{ active: false, language: 'auto', update: false }` | `active`: Toggles if captions should be active by default. `language`: Sets the default language to load (if available). 'auto' uses the browser language. `update`: Listen to changes to tracks and update menu. This is needed for some streaming libraries, but can result in unselectable language options). |
|
| `captions` | Object | `{ active: false, language: 'auto', update: false }` | `active`: Toggles if captions should be active by default. `language`: Sets the default language to load (if available). 'auto' uses the browser language. `update`: Listen to changes to tracks and update menu. This is needed for some streaming libraries, but can result in non-selectable language options). |
|
||||||
| `fullscreen` | Object | `{ enabled: true, fallback: true, iosNative: false, container: null }` | `enabled`: Toggles whether fullscreen should be enabled. `fallback`: Allow fallback to a full-window solution (`true`/`false`/`'force'`). `iosNative`: whether to use native iOS fullscreen when entering fullscreen (no custom controls). `container`: A selector for an ancestor of the player element, allows contextual content to remain visual in fullscreen mode. Non-ancestors are ignored. |
|
| `fullscreen` | Object | `{ enabled: true, fallback: true, iosNative: false, container: null }` | `enabled`: Toggles whether fullscreen should be enabled. `fallback`: Allow fallback to a full-window solution (`true`/`false`/`'force'`). `iosNative`: whether to use native iOS fullscreen when entering fullscreen (no custom controls). `container`: A selector for an ancestor of the player element, allows contextual content to remain visual in fullscreen mode. Non-ancestors are ignored. |
|
||||||
| `ratio` | String | `null` | Force an aspect ratio for all videos. The format is `'w:h'` - e.g. `'16:9'` or `'4:3'`. If this is not specified then the default for HTML5 and Vimeo is to use the native resolution of the video. As dimensions are not available from YouTube via SDK, 16:9 is forced as a sensible default. |
|
| `ratio` | String | `null` | Force an aspect ratio for all videos. The format is `'w:h'` - e.g. `'16:9'` or `'4:3'`. If this is not specified then the default for HTML5 and Vimeo is to use the native resolution of the video. As dimensions are not available from YouTube via SDK, 16:9 is forced as a sensible default. |
|
||||||
| `storage` | Object | `{ enabled: true, key: 'plyr' }` | `enabled`: Allow use of local storage to store user settings. `key`: The key name to use. |
|
| `storage` | Object | `{ enabled: true, key: 'plyr' }` | `enabled`: Allow use of local storage to store user settings. `key`: The key name to use. |
|
||||||
@ -412,6 +413,7 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke
|
|||||||
| `vimeo` | Object | `{ byline: false, portrait: false, title: false, speed: true, transparent: false }` | See [Vimeo embed options](https://github.com/vimeo/player.js/#embed-options). Some are set automatically based on other config options, namely: `loop`, `autoplay`, `muted`, `gesture`, `playsinline` |
|
| `vimeo` | Object | `{ byline: false, portrait: false, title: false, speed: true, transparent: false }` | See [Vimeo embed options](https://github.com/vimeo/player.js/#embed-options). Some are set automatically based on other config options, namely: `loop`, `autoplay`, `muted`, `gesture`, `playsinline` |
|
||||||
| `youtube` | Object | `{ noCookie: false, rel: 0, showinfo: 0, iv_load_policy: 3, modestbranding: 1 }` | See [YouTube embed options](https://developers.google.com/youtube/player_parameters#Parameters). The only custom option is `noCookie` to use an alternative to YouTube that doesn't use cookies (useful for GDPR, etc). Some are set automatically based on other config options, namely: `autoplay`, `hl`, `controls`, `disablekb`, `playsinline`, `cc_load_policy`, `cc_lang_pref`, `widget_referrer` |
|
| `youtube` | Object | `{ noCookie: false, rel: 0, showinfo: 0, iv_load_policy: 3, modestbranding: 1 }` | See [YouTube embed options](https://developers.google.com/youtube/player_parameters#Parameters). The only custom option is `noCookie` to use an alternative to YouTube that doesn't use cookies (useful for GDPR, etc). Some are set automatically based on other config options, namely: `autoplay`, `hl`, `controls`, `disablekb`, `playsinline`, `cc_load_policy`, `cc_lang_pref`, `widget_referrer` |
|
||||||
| `previewThumbnails` | Object | `{ enabled: false, src: '' }` | `enabled`: Whether to enable the preview thumbnails (they must be generated by you). `src` must be either a string or an array of strings representing URLs for the VTT files containing the image URL(s). Learn more about [preview thumbnails](#preview-thumbnails) below. |
|
| `previewThumbnails` | Object | `{ enabled: false, src: '' }` | `enabled`: Whether to enable the preview thumbnails (they must be generated by you). `src` must be either a string or an array of strings representing URLs for the VTT files containing the image URL(s). Learn more about [preview thumbnails](#preview-thumbnails) below. |
|
||||||
|
| `mediaMetadata` | Object | `{ title: '', artist: '', album: '', artwork: [] }` | The [MediaMetadata](https://developer.mozilla.org/en-US/docs/Web/API/MediaMetadata) interface of the Media Session API allows a web page to provide rich media metadata for display in a platform UI. |
|
||||||
|
|
||||||
1. Vimeo only
|
1. Vimeo only
|
||||||
2. Autoplay is generally not recommended as it is seen as a negative user experience. It is also disabled in many browsers. Before raising issues, do your homework. More info can be found here:
|
2. Autoplay is generally not recommended as it is seen as a negative user experience. It is also disabled in many browsers. Before raising issues, do your homework. More info can be found here:
|
||||||
@ -437,7 +439,7 @@ const player = new Plyr('#player', {
|
|||||||
You can also access the object through any events:
|
You can also access the object through any events:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
element.addEventListener('ready', event => {
|
element.addEventListener('ready', (event) => {
|
||||||
const player = event.detail.plyr;
|
const player = event.detail.plyr;
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@ -451,29 +453,29 @@ player.play(); // Start playback
|
|||||||
player.fullscreen.enter(); // Enter fullscreen
|
player.fullscreen.enter(); // Enter fullscreen
|
||||||
```
|
```
|
||||||
|
|
||||||
| Method | Parameters | Description |
|
| Method | Parameters | Description |
|
||||||
| -------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- |
|
| -------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- |
|
||||||
| `play()`¹ | - | Start playback. |
|
| `play()`¹ | - | Start playback. |
|
||||||
| `pause()` | - | Pause playback. |
|
| `pause()` | - | Pause playback. |
|
||||||
| `togglePlay(toggle)`¹ | Boolean | Toggle playback, if no parameters are passed, it will toggle based on current status. |
|
| `togglePlay(toggle)`¹ | Boolean | Toggle playback, if no parameters are passed, it will toggle based on current status. |
|
||||||
| `stop()` | - | Stop playback and reset to start. |
|
| `stop()` | - | Stop playback and reset to start. |
|
||||||
| `restart()` | - | Restart playback. |
|
| `restart()` | - | Restart playback. |
|
||||||
| `rewind(seekTime)` | Number | Rewind playback by the specified seek time. If no parameter is passed, the default seek time will be used. |
|
| `rewind(seekTime)` | Number | Rewind playback by the specified seek time. If no parameter is passed, the default seek time will be used. |
|
||||||
| `forward(seekTime)` | Number | Fast forward by the specified seek time. If no parameter is passed, the default seek time will be used. |
|
| `forward(seekTime)` | Number | Fast forward by the specified seek time. If no parameter is passed, the default seek time will be used. |
|
||||||
| `increaseVolume(step)` | Number | Increase volume by the specified step. If no parameter is passed, the default step will be used. |
|
| `increaseVolume(step)` | Number | Increase volume by the specified step. If no parameter is passed, the default step will be used. |
|
||||||
| `decreaseVolume(step)` | Number | Increase volume by the specified step. If no parameter is passed, the default step will be used. |
|
| `decreaseVolume(step)` | Number | Increase volume by the specified step. If no parameter is passed, the default step will be used. |
|
||||||
| `toggleCaptions(toggle)` | Boolean | Toggle captions display. If no parameter is passed, it will toggle based on current status. |
|
| `toggleCaptions(toggle)` | Boolean | Toggle captions display. If no parameter is passed, it will toggle based on current status. |
|
||||||
| `fullscreen.enter()` | - | Enter fullscreen. If fullscreen is not supported, a fallback "full window/viewport" is used instead. |
|
| `fullscreen.enter()` | - | Enter fullscreen. If fullscreen is not supported, a fallback "full window/viewport" is used instead. |
|
||||||
| `fullscreen.exit()` | - | Exit fullscreen. |
|
| `fullscreen.exit()` | - | Exit fullscreen. |
|
||||||
| `fullscreen.toggle()` | - | Toggle fullscreen. |
|
| `fullscreen.toggle()` | - | Toggle fullscreen. |
|
||||||
| `airplay()` | - | Trigger the airplay dialog on supported devices. |
|
| `airplay()` | - | Trigger the airplay dialog on supported devices. |
|
||||||
| `setPreviewThumbnails(source: PreviewThumbnailsOptions)` | - | Sets the preview thubmnails for the current source. |
|
| `setPreviewThumbnails(source: PreviewThumbnailsOptions)` | - | Sets the preview thumbnails for the current source. |
|
||||||
| `toggleControls(toggle)` | Boolean | Toggle the controls (video only). Takes optional truthy value to force it on/off. |
|
| `toggleControls(toggle)` | Boolean | Toggle the controls (video only). Takes optional truthy value to force it on/off. |
|
||||||
| `on(event, function)` | String, Function | Add an event listener for the specified event. |
|
| `on(event, function)` | String, Function | Add an event listener for the specified event. |
|
||||||
| `once(event, function)` | String, Function | Add an event listener for the specified event once. |
|
| `once(event, function)` | String, Function | Add an event listener for the specified event once. |
|
||||||
| `off(event, function)` | String, Function | Remove an event listener for the specified event. |
|
| `off(event, function)` | String, Function | Remove an event listener for the specified event. |
|
||||||
| `supports(type)` | String | Check support for a mime type. |
|
| `supports(type)` | String | Check support for a mime type. |
|
||||||
| `destroy()` | - | Destroy the instance and garbage collect any elements. |
|
| `destroy()` | - | Destroy the instance and garbage collect any elements. |
|
||||||
|
|
||||||
1. For HTML5 players, `play()` will return a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) for most browsers - e.g. Chrome, Firefox, Opera, Safari and Edge [according to MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play) at time of writing.
|
1. For HTML5 players, `play()` will return a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) for most browsers - e.g. Chrome, Firefox, Opera, Safari and Edge [according to MDN](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play) at time of writing.
|
||||||
|
|
||||||
@ -514,7 +516,7 @@ player.fullscreen.active; // false;
|
|||||||
| `loop` | ✓ | ✓ | Gets or sets the current loop state of the player. The setter accepts a boolean. |
|
| `loop` | ✓ | ✓ | Gets or sets the current loop state of the player. The setter accepts a boolean. |
|
||||||
| `source` | ✓ | ✓ | Gets or sets the current source for the player. The setter accepts an object. See [source setter](#the-source-setter) below for examples. |
|
| `source` | ✓ | ✓ | Gets or sets the current source for the player. The setter accepts an object. See [source setter](#the-source-setter) below for examples. |
|
||||||
| `poster` | ✓ | ✓ | Gets or sets the current poster image for the player. The setter accepts a string; the URL for the updated poster image. |
|
| `poster` | ✓ | ✓ | Gets or sets the current poster image for the player. The setter accepts a string; the URL for the updated poster image. |
|
||||||
| `previewThumbnails` | ✓ | ✓ | Gets or sets the current preview Thubmnail source for the player. The setter accepts a string |
|
| `previewThumbnails` | ✓ | ✓ | Gets or sets the current preview thumbnail source for the player. The setter accepts a string |
|
||||||
| `autoplay` | ✓ | ✓ | Gets or sets the autoplay state of the player. The setter accepts a boolean. |
|
| `autoplay` | ✓ | ✓ | Gets or sets the autoplay state of the player. The setter accepts a boolean. |
|
||||||
| `currentTrack` | ✓ | ✓ | Gets or sets the caption track by index. `-1` means the track is missing or captions is not active |
|
| `currentTrack` | ✓ | ✓ | Gets or sets the caption track by index. `-1` means the track is missing or captions is not active |
|
||||||
| `language` | ✓ | ✓ | Gets or sets the preferred captions language for the player. The setter accepts an ISO two-letter language code. Support for the languages is dependent on the captions you include. If your captions don't have any language data, or if you have multiple tracks with the same language, you may want to use `currentTrack` instead. |
|
| `language` | ✓ | ✓ | Gets or sets the preferred captions language for the player. The setter accepts an ISO two-letter language code. Support for the languages is dependent on the captions you include. If your captions don't have any language data, or if you have multiple tracks with the same language, you may want to use `currentTrack` instead. |
|
||||||
@ -637,7 +639,7 @@ reference to the instance, you can use the `on()` API method or `addEventListene
|
|||||||
property. Here's an example:
|
property. Here's an example:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
player.on('ready', event => {
|
player.on('ready', (event) => {
|
||||||
const instance = event.detail.plyr;
|
const instance = event.detail.plyr;
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@ -784,16 +786,16 @@ If a User Agent is disabled but supports `<video>` and `<audio>` natively, it wi
|
|||||||
|
|
||||||
Some awesome folks have made plugins for CMSs and Components for JavaScript frameworks:
|
Some awesome folks have made plugins for CMSs and Components for JavaScript frameworks:
|
||||||
|
|
||||||
| Type | Maintainer | Link |
|
| Type | Maintainer | Link |
|
||||||
| --------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
| ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||||
| WordPress | Brandon Lavigne ([@drrobotnik](https://github.com/drrobotnik)) | [https://wordpress.org/plugins/plyr/](https://wordpress.org/plugins/plyr/) |
|
| WordPress | Brandon Lavigne ([@drrobotnik](https://github.com/drrobotnik)) | [https://wordpress.org/plugins/plyr/](https://wordpress.org/plugins/plyr/) |
|
||||||
| Angular | Simon Bobrov ([@smnbbrv](https://github.com/smnbbrv)) | [https://github.com/smnbbrv/ngx-plyr](https://github.com/smnbbrv/ngx-plyr) |
|
| Angular | Simon Bobrov ([@smnbbrv](https://github.com/smnbbrv)) | [https://github.com/smnbbrv/ngx-plyr](https://github.com/smnbbrv/ngx-plyr) |
|
||||||
| React | Chintan Prajapati ([@chintan9](https://github.com/chintan9)) | [https://github.com/chintan9/plyr-react](https://github.com/chintan9/plyr-react) |
|
| React | Chintan Prajapati ([@chintan9](https://github.com/chintan9)) | [https://github.com/chintan9/plyr-react](https://github.com/chintan9/plyr-react) |
|
||||||
| Vue | Gabe Dunn ([@redxtech](https://github.com/redxtech)) | [https://github.com/redxtech/vue-plyr](https://github.com/redxtech/vue-plyr) |
|
| Vue | Gabe Dunn ([@redxtech](https://github.com/redxtech)) | [https://github.com/redxtech/vue-plyr](https://github.com/redxtech/vue-plyr) |
|
||||||
| Neos | Jon Uhlmann ([@jonnitto](https://github.com/jonnitto)) | [https://packagist.org/packages/jonnitto/plyr](https://packagist.org/packages/jonnitto/plyr) |
|
| Neos | Jon Uhlmann ([@jonnitto](https://github.com/jonnitto)) | [https://packagist.org/packages/jonnitto/plyr](https://packagist.org/packages/jonnitto/plyr) |
|
||||||
| Kirby | Dominik Pschenitschni ([@dpschen](https://github.com/dpschen)) | [https://github.com/dpschen/kirby-plyrtag](https://github.com/dpschen/kirby-plyrtag) |
|
| Kirby | Dominik Pschenitschni ([@dpschen](https://github.com/dpschen)) | [https://github.com/dpschen/kirby-plyrtag](https://github.com/dpschen/kirby-plyrtag) |
|
||||||
| REDAXO | FriendsOfRedaxo / skerbis ([@skerbis](https://friendsofredaxo.github.io)) | [https://github.com/FriendsOfREDAXO/plyr](https://github.com/FriendsOfREDAXO/plyr) |
|
| REDAXO | FriendsOfRedaxo / skerbis ([@skerbis](https://friendsofredaxo.github.io)) | [https://github.com/FriendsOfREDAXO/plyr](https://github.com/FriendsOfREDAXO/plyr) |
|
||||||
| svelte-plyr | Ben Woodward / benwoodward ([@benwoodward](https://github.com/benwoodward)) | [https://github.com/benwoodward/svelte-plyr](https://github.com/benwoodward/svelte-plyr) |
|
| svelte-plyr | Ben Woodward / benwoodward ([@benwoodward](https://github.com/benwoodward)) | [https://github.com/benwoodward/svelte-plyr](https://github.com/benwoodward/svelte-plyr) |
|
||||||
|
|
||||||
# Issues
|
# Issues
|
||||||
|
|
||||||
|
24
cspell.json
Normal file
24
cspell.json
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2",
|
||||||
|
"ignorePaths": [
|
||||||
|
"package.json"
|
||||||
|
],
|
||||||
|
"dictionaryDefinitions": [],
|
||||||
|
"dictionaries": [],
|
||||||
|
"words": [
|
||||||
|
"autopause",
|
||||||
|
"autoplay",
|
||||||
|
"classname",
|
||||||
|
"fullscreen",
|
||||||
|
"gordita",
|
||||||
|
"menuitemradio",
|
||||||
|
"playsinline",
|
||||||
|
"plyr",
|
||||||
|
"seektime",
|
||||||
|
"srclang",
|
||||||
|
"stylelint",
|
||||||
|
"unmute"
|
||||||
|
],
|
||||||
|
"ignoreWords": [],
|
||||||
|
"import": []
|
||||||
|
}
|
@ -105,14 +105,6 @@
|
|||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
|
||||||
Premium video monetization from
|
|
||||||
<a href="https://vi.ai/publisher-video-monetization/?aid=plyrio" target="_blank" class="no-border">
|
|
||||||
<img src="https://cdn.plyr.io/static/vi-logo-24x24.svg" alt="ai.vi" />
|
|
||||||
<span class="sr-only">ai.vi</span>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="call-to-action">
|
<div class="call-to-action">
|
||||||
<a href="https://github.com/sampotts/plyr" target="_blank" class="button js-shr">
|
<a href="https://github.com/sampotts/plyr" target="_blank" class="button js-shr">
|
||||||
<svg class="icon" role="presentation">
|
<svg class="icon" role="presentation">
|
||||||
|
@ -65,6 +65,34 @@ import toggleClass from './toggle-class';
|
|||||||
// Prevent Vimeo blocking plyr.io demo site
|
// Prevent Vimeo blocking plyr.io demo site
|
||||||
referrerPolicy: 'no-referrer',
|
referrerPolicy: 'no-referrer',
|
||||||
},
|
},
|
||||||
|
mediaMetadata: {
|
||||||
|
title: 'View From A Blue Moon',
|
||||||
|
album: 'Sports',
|
||||||
|
artist: 'Brainfarm',
|
||||||
|
artwork: [
|
||||||
|
{
|
||||||
|
src: 'https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg',
|
||||||
|
type: 'image/jpeg',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
markers: {
|
||||||
|
enabled: true,
|
||||||
|
points: [
|
||||||
|
{
|
||||||
|
time: 10,
|
||||||
|
tip: 'first marker',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
time: 40,
|
||||||
|
tip: 'second marker',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
time: 120,
|
||||||
|
tipHTML: '<strong>third</strong> marker',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Expose for tinkering in the console
|
// Expose for tinkering in the console
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
// Plyr.io Demo Page
|
// Plyr.io Demo Page
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@charset 'UTF-8';
|
@charset 'UTF-8';
|
||||||
|
|
||||||
@import '../../../../src/sass/lib/css-vars';
|
@import '../../../../src/sass/lib/css-vars';
|
||||||
|
|
||||||
$css-vars-use-native: true;
|
$css-vars-use-native: true;
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.tab-focus {
|
&.tab-focus {
|
||||||
@include tab-focus();
|
@include tab-focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
@ -64,7 +64,7 @@
|
|||||||
|
|
||||||
// Count bubble
|
// Count bubble
|
||||||
.button__count {
|
.button__count {
|
||||||
animation: fadein 0.2s ease;
|
animation: fade-in 0.2s ease;
|
||||||
background: $color-button-count-background;
|
background: $color-button-count-background;
|
||||||
color: $color-button-count-text;
|
color: $color-button-count-text;
|
||||||
margin-left: ($spacing-base * 0.75);
|
margin-left: ($spacing-base * 0.75);
|
||||||
|
@ -7,7 +7,7 @@ header {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
h1 span {
|
h1 span {
|
||||||
animation: shrinkHide 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 2s forwards;
|
animation: shrink-hide 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 2s forwards;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-weight: $font-weight-light;
|
font-weight: $font-weight-light;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// Make a <button> look like an <a>
|
// Make a <button> look like an <a>
|
||||||
button.faux-link {
|
button.faux-link {
|
||||||
@extend a; // stylelint-disable-line
|
@extend a; // stylelint-disable-line
|
||||||
@include cancel-button-styles();
|
@include cancel-button-styles;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Links
|
// Links
|
||||||
@ -39,7 +39,7 @@ a {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&.tab-focus {
|
&.tab-focus {
|
||||||
@include tab-focus();
|
@include tab-focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.no-border::after {
|
&.no-border::after {
|
||||||
|
@ -3,23 +3,26 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Fade
|
// Fade
|
||||||
@keyframes fadein {
|
@keyframes fade-in {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes shrinkHide {
|
@keyframes shrink-hide {
|
||||||
0% {
|
0% {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
width: 38px;
|
width: 38px;
|
||||||
}
|
}
|
||||||
|
|
||||||
20% {
|
20% {
|
||||||
width: 45px;
|
width: 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
width: 0;
|
width: 0;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-family: 'Gordita';
|
font-family: Gordita;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: $font-weight-light;
|
font-weight: $font-weight-light;
|
||||||
src: url('https://cdn.plyr.io/static/fonts/gordita-light.woff2') format('woff2'),
|
src: url('https://cdn.plyr.io/static/fonts/gordita-light.woff2') format('woff2'),
|
||||||
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-family: 'Gordita';
|
font-family: Gordita;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: $font-weight-regular;
|
font-weight: $font-weight-regular;
|
||||||
src: url('https://cdn.plyr.io/static/fonts/gordita-regular.woff2') format('woff2'),
|
src: url('https://cdn.plyr.io/static/fonts/gordita-regular.woff2') format('woff2'),
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-family: 'Gordita';
|
font-family: Gordita;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: $font-weight-medium;
|
font-weight: $font-weight-medium;
|
||||||
src: url('https://cdn.plyr.io/static/fonts/gordita-medium.woff2') format('woff2'),
|
src: url('https://cdn.plyr.io/static/fonts/gordita-medium.woff2') format('woff2'),
|
||||||
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-family: 'Gordita';
|
font-family: Gordita;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: $font-weight-bold;
|
font-weight: $font-weight-bold;
|
||||||
src: url('https://cdn.plyr.io/static/fonts/gordita-bold.woff2') format('woff2'),
|
src: url('https://cdn.plyr.io/static/fonts/gordita-bold.woff2') format('woff2'),
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
font-family: 'Gordita';
|
font-family: Gordita;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: $font-weight-black;
|
font-weight: $font-weight-black;
|
||||||
src: url('https://cdn.plyr.io/static/fonts/gordita-black.woff2') format('woff2'),
|
src: url('https://cdn.plyr.io/static/fonts/gordita-black.woff2') format('woff2'),
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
text-align: inherit;
|
text-align: inherit;
|
||||||
text-shadow: inherit;
|
text-shadow: inherit;
|
||||||
-moz-user-select: text; // stylelint-disable-line
|
user-select: text;
|
||||||
vertical-align: baseline;
|
vertical-align: baseline;
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
17
demo/src/sass/lib/normalize.scss
vendored
17
demo/src/sass/lib/normalize.scss
vendored
@ -11,8 +11,7 @@
|
|||||||
|
|
||||||
html {
|
html {
|
||||||
line-height: 1.15; /* 1 */
|
line-height: 1.15; /* 1 */
|
||||||
-ms-text-size-adjust: 100%; /* 2 */
|
text-size-adjust: 100%; /* 2 */
|
||||||
-webkit-text-size-adjust: 100%; /* 2 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sections
|
/* Sections
|
||||||
@ -89,7 +88,7 @@ hr {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
font-family: monospace, monospace; /* 1 */
|
font-family: monospace; /* 1 */
|
||||||
font-size: 1em; /* 2 */
|
font-size: 1em; /* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +102,7 @@ pre {
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
background-color: transparent; /* 1 */
|
background-color: transparent; /* 1 */
|
||||||
-webkit-text-decoration-skip: objects; /* 2 */
|
text-decoration-skip: objects; /* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -112,7 +111,7 @@ a {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
abbr[title] {
|
abbr[title] {
|
||||||
border-bottom: none; /* 1 */
|
border-bottom: 0; /* 1 */
|
||||||
text-decoration: underline; /* 2 */
|
text-decoration: underline; /* 2 */
|
||||||
text-decoration: underline dotted; /* 2 */
|
text-decoration: underline dotted; /* 2 */
|
||||||
}
|
}
|
||||||
@ -281,7 +280,7 @@ button,
|
|||||||
html [type='button'],
|
html [type='button'],
|
||||||
[type='reset'],
|
[type='reset'],
|
||||||
[type='submit'] {
|
[type='submit'] {
|
||||||
-webkit-appearance: button; /* 2 */
|
appearance: button; /* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -375,7 +374,7 @@ textarea {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
[type='search'] {
|
[type='search'] {
|
||||||
-webkit-appearance: textfield; /* 1 */
|
appearance: textfield; /* 1 */
|
||||||
outline-offset: -2px; /* 2 */
|
outline-offset: -2px; /* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -385,7 +384,7 @@ textarea {
|
|||||||
|
|
||||||
[type='search']::-webkit-search-cancel-button,
|
[type='search']::-webkit-search-cancel-button,
|
||||||
[type='search']::-webkit-search-decoration {
|
[type='search']::-webkit-search-decoration {
|
||||||
-webkit-appearance: none;
|
appearance: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -394,7 +393,7 @@ textarea {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
::-webkit-file-upload-button {
|
::-webkit-file-upload-button {
|
||||||
-webkit-appearance: button; /* 1 */
|
appearance: button; /* 1 */
|
||||||
font: inherit; /* 2 */
|
font: inherit; /* 2 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Grayscale
|
// Grayscale
|
||||||
$color-gray-900: hsl(210, 15%, 16%);
|
$color-gray-900: hsl(210deg 15% 16%);
|
||||||
$color-gray-800: lighten($color-gray-900, 9%);
|
$color-gray-800: lighten($color-gray-900, 9%);
|
||||||
$color-gray-700: lighten($color-gray-800, 9%);
|
$color-gray-700: lighten($color-gray-800, 9%);
|
||||||
$color-gray-600: lighten($color-gray-700, 9%);
|
$color-gray-600: lighten($color-gray-700, 9%);
|
||||||
@ -15,7 +15,7 @@ $color-gray-100: lighten($color-gray-200, 9%);
|
|||||||
$color-gray-50: lighten($color-gray-100, 9%);
|
$color-gray-50: lighten($color-gray-100, 9%);
|
||||||
|
|
||||||
// Branding
|
// Branding
|
||||||
$color-brand-primary: hsl(198, 100%, 50%);
|
$color-brand-primary: hsl(198deg 100% 50%);
|
||||||
|
|
||||||
// Text
|
// Text
|
||||||
$color-text: $color-gray-700;
|
$color-text: $color-gray-700;
|
||||||
@ -28,13 +28,13 @@ $color-twitter: #4baaf4;
|
|||||||
$color-link: $color-brand-primary;
|
$color-link: $color-brand-primary;
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
$color-background-from: hsl(198, 100%, 94%);
|
$color-background-from: hsl(198deg 100% 94%);
|
||||||
$color-background-to: hsl(198, 100%, 98%);
|
$color-background-to: hsl(198deg 100% 98%);
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
$color-button-background: $color-brand-primary;
|
$color-button-background: $color-brand-primary;
|
||||||
$color-button-text: #fff;
|
$color-button-text: #fff;
|
||||||
$color-button-background-hover: hsl(198, 100%, 55%);
|
$color-button-background-hover: hsl(198deg 100% 55%);
|
||||||
$color-button-count-background: #fff;
|
$color-button-count-background: #fff;
|
||||||
$color-button-count-text: $color-gray-600;
|
$color-button-count-text: $color-gray-600;
|
||||||
|
|
||||||
|
@ -4,18 +4,14 @@
|
|||||||
|
|
||||||
$font-sans-serif: 'Gordita', 'Avenir', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
$font-sans-serif: 'Gordita', 'Avenir', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
||||||
'Segoe UI Symbol';
|
'Segoe UI Symbol';
|
||||||
|
|
||||||
$font-size-base: 15;
|
$font-size-base: 15;
|
||||||
$font-size-small: 13;
|
$font-size-small: 13;
|
||||||
$font-size-large: 18;
|
$font-size-large: 18;
|
||||||
$font-size-h1: 64;
|
$font-size-h1: 64;
|
||||||
|
|
||||||
$font-weight-light: 300;
|
$font-weight-light: 300;
|
||||||
$font-weight-regular: 400;
|
$font-weight-regular: 400;
|
||||||
$font-weight-medium: 500;
|
$font-weight-medium: 500;
|
||||||
$font-weight-bold: 600;
|
$font-weight-bold: 600;
|
||||||
$font-weight-black: 900;
|
$font-weight-black: 900;
|
||||||
|
|
||||||
$line-height-base: 1.75;
|
$line-height-base: 1.75;
|
||||||
|
|
||||||
$letter-spacing-headings: -0.025em;
|
$letter-spacing-headings: -0.025em;
|
||||||
|
@ -8,8 +8,9 @@ html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@include font-smoothing();
|
@include font-smoothing;
|
||||||
@include font-size($font-size-base);
|
@include font-size($font-size-base);
|
||||||
|
|
||||||
color: $color-text;
|
color: $color-text;
|
||||||
font-family: $font-sans-serif;
|
font-family: $font-sans-serif;
|
||||||
font-weight: $font-weight-medium;
|
font-weight: $font-weight-medium;
|
||||||
@ -30,5 +31,6 @@ small {
|
|||||||
|
|
||||||
small {
|
small {
|
||||||
@include font-size($font-size-small);
|
@include font-size($font-size-small);
|
||||||
|
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
@include font-size($font-size-h1);
|
@include font-size($font-size-h1);
|
||||||
|
|
||||||
color: $color-headings;
|
color: $color-headings;
|
||||||
font-weight: $font-weight-bold;
|
font-weight: $font-weight-bold;
|
||||||
letter-spacing: $letter-spacing-headings;
|
letter-spacing: $letter-spacing-headings;
|
||||||
|
60
package.json
60
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "plyr",
|
"name": "plyr",
|
||||||
"version": "3.6.9",
|
"version": "3.6.12",
|
||||||
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
|
||||||
"homepage": "https://plyr.io",
|
"homepage": "https://plyr.io",
|
||||||
"author": "Sam Potts <sam@potts.es>",
|
"author": "Sam Potts <sam@potts.es>",
|
||||||
@ -31,24 +31,24 @@
|
|||||||
"browserslist": "> 1%",
|
"browserslist": "> 1%",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "gulp build",
|
"build": "gulp build",
|
||||||
"lint": "eslint src/js && npm run-script remark",
|
"lint": "eslint src/js && npm run remark && stylelint **/*.scss",
|
||||||
"lint:fix": "eslint --fix src/js",
|
"lint:fix": "eslint --fix src/js && stylelint **/*.scss --fix",
|
||||||
"remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'",
|
"remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'",
|
||||||
"deploy": "yarn lint && gulp version && gulp build && gulp deploy",
|
"deploy": "yarn lint && gulp version && gulp build && gulp deploy",
|
||||||
"format": "prettier --write \"./{src,demo/src}/**/*.{js,scss}\"",
|
"format": "prettier --write \"./{src,demo/src}/**/*.{js,scss}\"",
|
||||||
"start": "gulp"
|
"start": "gulp"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.13.15",
|
"@babel/core": "^7.16.5",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.13.0",
|
"@babel/plugin-proposal-class-properties": "^7.16.5",
|
||||||
"@babel/preset-env": "^7.13.15",
|
"@babel/preset-env": "^7.16.5",
|
||||||
"@sampotts/eslint-config": "1.1.7",
|
"@sampotts/eslint-config": "1.1.7",
|
||||||
"autoprefixer": "^10.2.5",
|
"autoprefixer": "^10.4.0",
|
||||||
"aws-sdk": "^2.888.0",
|
"aws-sdk": "^2.1046.0",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"browser-sync": "^2.26.14",
|
"browser-sync": "^2.27.7",
|
||||||
"colorette": "2.0.12",
|
"colorette": "2.0.16",
|
||||||
"cssnano": "^5.0.1",
|
"cssnano": "^5.0.13",
|
||||||
"del": "^6.0.0",
|
"del": "^6.0.0",
|
||||||
"eslint": "^7.23.0",
|
"eslint": "^7.23.0",
|
||||||
"fancy-log": "^1.3.3",
|
"fancy-log": "^1.3.3",
|
||||||
@ -56,42 +56,40 @@
|
|||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
"gulp-awspublish": "^4.1.2",
|
"gulp-awspublish": "^4.1.2",
|
||||||
"gulp-better-rollup": "^4.0.1",
|
"gulp-better-rollup": "^4.0.1",
|
||||||
"gulp-filter": "^6.0.0",
|
"gulp-filter": "^7.0.0",
|
||||||
"gulp-header": "^2.0.9",
|
"gulp-header": "^2.0.9",
|
||||||
"gulp-hub": "^4.2.0",
|
"gulp-hub": "^4.2.0",
|
||||||
"gulp-if": "^3.0.0",
|
"gulp-if": "^3.0.0",
|
||||||
"gulp-imagemin": "^7.1.0",
|
"gulp-imagemin": "^7.1.0",
|
||||||
"gulp-open": "^3.0.1",
|
"gulp-open": "^3.0.1",
|
||||||
"gulp-plumber": "^1.2.1",
|
"gulp-plumber": "^1.2.1",
|
||||||
"gulp-postcss": "^9.0.0",
|
"gulp-postcss": "^9.0.1",
|
||||||
"gulp-rename": "^2.0.0",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-replace": "^1.0.0",
|
"gulp-replace": "^1.1.3",
|
||||||
"gulp-sass": "^5.0.0",
|
"gulp-sass": "^5.0.0",
|
||||||
"gulp-size": "^3.0.0",
|
"gulp-size": "^4.0.1",
|
||||||
"gulp-sourcemaps": "^3.0.0",
|
"gulp-sourcemaps": "^3.0.0",
|
||||||
"gulp-svgstore": "^7.0.1",
|
"gulp-svgstore": "^9.0.0",
|
||||||
"gulp-terser": "^2.0.1",
|
"gulp-terser": "^2.1.0",
|
||||||
"postcss": "^8.2.10",
|
"postcss": "^8.4.5",
|
||||||
"postcss-custom-properties": "^11.0.0",
|
"postcss-custom-properties": "^12.0.1",
|
||||||
|
"postcss-scss": "^4.0.2",
|
||||||
"prettier-eslint": "^12.0.0",
|
"prettier-eslint": "^12.0.0",
|
||||||
"prettier-stylelint": "^0.4.2",
|
"prettier-stylelint": "^0.4.2",
|
||||||
"remark-cli": "^9.0.0",
|
"remark-cli": "^10.0.1",
|
||||||
"remark-validate-links": "^10.0.4",
|
"remark-validate-links": "^11.0.2",
|
||||||
"rollup": "^2.45.2",
|
"rollup": "^2.61.1",
|
||||||
"rollup-plugin-babel": "^4.4.0",
|
"rollup-plugin-babel": "^4.4.0",
|
||||||
"rollup-plugin-commonjs": "^10.1.0",
|
"rollup-plugin-commonjs": "^10.1.0",
|
||||||
"rollup-plugin-node-resolve": "^5.2.0",
|
"rollup-plugin-node-resolve": "^5.2.0",
|
||||||
"sass": "^1.42.1",
|
"sass": "^1.45.0",
|
||||||
"stylelint": "^13.12.0",
|
"stylelint": "^14.1.0",
|
||||||
"stylelint-config-prettier": "^8.0.2",
|
"stylelint-config-prettier": "^9.0.3",
|
||||||
"stylelint-config-recommended": "^4.0.0",
|
"stylelint-config-sass-guidelines": "^9.0.1",
|
||||||
"stylelint-config-sass-guidelines": "^8.0.0",
|
"stylelint-selector-bem-pattern": "^2.1.1"
|
||||||
"stylelint-order": "^4.1.0",
|
|
||||||
"stylelint-scss": "^3.19.0",
|
|
||||||
"stylelint-selector-bem-pattern": "^2.1.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.10.1",
|
"core-js": "^3.20.0",
|
||||||
"custom-event-polyfill": "^1.0.7",
|
"custom-event-polyfill": "^1.0.7",
|
||||||
"loadjs": "^4.2.0",
|
"loadjs": "^4.2.0",
|
||||||
"rangetouch": "^2.0.1",
|
"rangetouch": "^2.0.1",
|
||||||
|
@ -12,7 +12,9 @@
|
|||||||
|
|
||||||
// Linting
|
// Linting
|
||||||
"stylelint.enable": true,
|
"stylelint.enable": true,
|
||||||
|
"stylelint.validate": ["css", "scss"],
|
||||||
"css.validate": false,
|
"css.validate": false,
|
||||||
|
"less.validate": false,
|
||||||
"scss.validate": false,
|
"scss.validate": false,
|
||||||
"javascript.validate.enable": false,
|
"javascript.validate.enable": false,
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ const defaults = {
|
|||||||
// Sprite (for icons)
|
// Sprite (for icons)
|
||||||
loadSprite: true,
|
loadSprite: true,
|
||||||
iconPrefix: 'plyr',
|
iconPrefix: 'plyr',
|
||||||
iconUrl: 'https://cdn.plyr.io/3.6.9/plyr.svg',
|
iconUrl: 'https://cdn.plyr.io/3.6.12/plyr.svg',
|
||||||
|
|
||||||
// Blank video (used to prevent errors on source change)
|
// Blank video (used to prevent errors on source change)
|
||||||
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
|
||||||
@ -391,6 +391,10 @@ const defaults = {
|
|||||||
scrubbingContainer: 'plyr__preview-scrubbing',
|
scrubbingContainer: 'plyr__preview-scrubbing',
|
||||||
scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown',
|
scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown',
|
||||||
},
|
},
|
||||||
|
markers: {
|
||||||
|
points: 'plyr__marker__points',
|
||||||
|
tip: 'plyr__marker__tip',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// Embed attributes
|
// Embed attributes
|
||||||
@ -441,6 +445,20 @@ const defaults = {
|
|||||||
customControls: true,
|
customControls: true,
|
||||||
noCookie: false, // Whether to use an alternative version of YouTube without cookies
|
noCookie: false, // Whether to use an alternative version of YouTube without cookies
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Media Metadata
|
||||||
|
mediaMetadata: {
|
||||||
|
title: '',
|
||||||
|
artist: '',
|
||||||
|
album: '',
|
||||||
|
artwork: [],
|
||||||
|
},
|
||||||
|
|
||||||
|
// Markers
|
||||||
|
markers: {
|
||||||
|
enabled: false,
|
||||||
|
points: [],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaults;
|
export default defaults;
|
||||||
|
81
src/js/controls.js
vendored
81
src/js/controls.js
vendored
@ -796,6 +796,10 @@ const controls = {
|
|||||||
controls.updateTimeDisplay.call(this, this.elements.display.duration, this.duration);
|
controls.updateTimeDisplay.call(this, this.elements.display.duration, this.duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.config.markers.enabled) {
|
||||||
|
controls.setMarkers.call(this);
|
||||||
|
}
|
||||||
|
|
||||||
// Update the tooltip (if visible)
|
// Update the tooltip (if visible)
|
||||||
controls.updateSeekTooltip.call(this);
|
controls.updateSeekTooltip.call(this);
|
||||||
},
|
},
|
||||||
@ -1745,6 +1749,83 @@ const controls = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Set media metadata
|
||||||
|
setMediaMetadata() {
|
||||||
|
try {
|
||||||
|
if ('mediaSession' in navigator) {
|
||||||
|
navigator.mediaSession.metadata = new window.MediaMetadata({
|
||||||
|
title: this.config.mediaMetadata.title,
|
||||||
|
artist: this.config.mediaMetadata.artist,
|
||||||
|
album: this.config.mediaMetadata.album,
|
||||||
|
artwork: this.config.mediaMetadata.artwork,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line no-empty
|
||||||
|
} catch (e) {}
|
||||||
|
},
|
||||||
|
|
||||||
|
// Add markers
|
||||||
|
setMarkers() {
|
||||||
|
if (this.duration > 0 && !this.elements.markers) {
|
||||||
|
const { points } = this.config.markers;
|
||||||
|
const markersContainerFragment = document.createDocumentFragment();
|
||||||
|
const markersPointsFragment = document.createDocumentFragment();
|
||||||
|
const markerTipElement = createElement(
|
||||||
|
'span',
|
||||||
|
{
|
||||||
|
class: this.config.classNames.markers.tip,
|
||||||
|
},
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
|
||||||
|
points.forEach((point) => {
|
||||||
|
if (point < 0 || point > this.duration) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const markerPointElement = createElement(
|
||||||
|
'span',
|
||||||
|
{
|
||||||
|
class: this.config.classNames.markers.points,
|
||||||
|
},
|
||||||
|
'',
|
||||||
|
);
|
||||||
|
|
||||||
|
const left = `${(point.time / this.duration) * 100}%`;
|
||||||
|
const tipVisible = `${this.config.classNames.markers.tip}--visible`;
|
||||||
|
const toggle = (show) => toggleClass(markerTipElement, tipVisible, show);
|
||||||
|
|
||||||
|
markerPointElement.addEventListener('mouseenter', () => {
|
||||||
|
markerTipElement.style.left = left;
|
||||||
|
if (point.tipHTML) {
|
||||||
|
markerTipElement.innerHTML = point.tipHTML;
|
||||||
|
} else {
|
||||||
|
markerTipElement.innerText = point.tip;
|
||||||
|
}
|
||||||
|
toggle(true);
|
||||||
|
});
|
||||||
|
markerPointElement.addEventListener('mouseleave', () => {
|
||||||
|
toggle(false);
|
||||||
|
});
|
||||||
|
markerPointElement.addEventListener('click', () => {
|
||||||
|
this.currentTime = point.time;
|
||||||
|
});
|
||||||
|
|
||||||
|
markerPointElement.style.left = left;
|
||||||
|
markersPointsFragment.appendChild(markerPointElement);
|
||||||
|
});
|
||||||
|
|
||||||
|
markersContainerFragment.appendChild(markersPointsFragment);
|
||||||
|
markersContainerFragment.appendChild(markerTipElement);
|
||||||
|
|
||||||
|
this.elements.markers = {
|
||||||
|
points: markersPointsFragment,
|
||||||
|
tip: markerTipElement,
|
||||||
|
};
|
||||||
|
this.elements.progress.appendChild(markersContainerFragment);
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default controls;
|
export default controls;
|
||||||
|
@ -73,7 +73,7 @@ const html5 = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're using an an external handler...
|
// If we're using an external handler...
|
||||||
if (player.config.quality.forced && is.function(player.config.quality.onChange)) {
|
if (player.config.quality.forced && is.function(player.config.quality.onChange)) {
|
||||||
player.config.quality.onChange(input);
|
player.config.quality.onChange(input);
|
||||||
} else {
|
} else {
|
||||||
|
18
src/js/plyr.d.ts
vendored
18
src/js/plyr.d.ts
vendored
@ -518,6 +518,11 @@ declare namespace Plyr {
|
|||||||
* Preview Thumbnails Options.
|
* Preview Thumbnails Options.
|
||||||
*/
|
*/
|
||||||
previewThumbnails?: PreviewThumbnailsOptions;
|
previewThumbnails?: PreviewThumbnailsOptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Media Metadata Options.
|
||||||
|
*/
|
||||||
|
mediaMetadata?: MediaMetadataOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface QualityOptions {
|
interface QualityOptions {
|
||||||
@ -576,6 +581,19 @@ declare namespace Plyr {
|
|||||||
src?: string | string[];
|
src?: string | string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface MediaMetadataArtwork {
|
||||||
|
src: string;
|
||||||
|
sizes?: string;
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface MediaMetadataOptions {
|
||||||
|
title?: string;
|
||||||
|
artist?: string;
|
||||||
|
album?: string;
|
||||||
|
artwork?: MediaMetadataArtwork[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface Elements {
|
export interface Elements {
|
||||||
buttons: {
|
buttons: {
|
||||||
airplay?: HTMLButtonElement;
|
airplay?: HTMLButtonElement;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Plyr
|
// Plyr
|
||||||
// plyr.js v3.6.9
|
// plyr.js v3.6.12
|
||||||
// https://github.com/sampotts/plyr
|
// https://github.com/sampotts/plyr
|
||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Plyr Polyfilled Build
|
// Plyr Polyfilled Build
|
||||||
// plyr.js v3.6.9
|
// plyr.js v3.6.12
|
||||||
// https://github.com/sampotts/plyr
|
// https://github.com/sampotts/plyr
|
||||||
// License: The MIT License (MIT)
|
// License: The MIT License (MIT)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
@ -125,6 +125,11 @@ const ui = {
|
|||||||
if (this.config.duration) {
|
if (this.config.duration) {
|
||||||
controls.durationUpdate.call(this);
|
controls.durationUpdate.call(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Media metadata
|
||||||
|
if (this.config.mediaMetadata) {
|
||||||
|
controls.setMediaMetadata.call(this);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Setup aria attribute for play and iframe title
|
// Setup aria attribute for play and iframe title
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
// Base
|
// Base
|
||||||
.plyr {
|
.plyr {
|
||||||
@include plyr-font-smoothing($plyr-font-smoothing);
|
@include plyr-font-smoothing($plyr-font-smoothing);
|
||||||
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
// Tab focus
|
// Tab focus
|
||||||
&.plyr__tab-focus {
|
&.plyr__tab-focus {
|
||||||
@include plyr-tab-focus();
|
@include plyr-tab-focus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
.plyr [data-plyr='fullscreen'] {
|
.plyr [data-plyr='fullscreen'] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.plyr--captions-enabled [data-plyr='captions'],
|
.plyr--captions-enabled [data-plyr='captions'],
|
||||||
.plyr--pip-supported [data-plyr='pip'],
|
.plyr--pip-supported [data-plyr='pip'],
|
||||||
.plyr--airplay-supported [data-plyr='airplay'],
|
.plyr--airplay-supported [data-plyr='airplay'],
|
||||||
|
57
src/sass/components/markers.scss
Normal file
57
src/sass/components/markers.scss
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
// --------------------------------------------------------------
|
||||||
|
// Markers
|
||||||
|
// --------------------------------------------------------------
|
||||||
|
.plyr__marker__points {
|
||||||
|
width: $plyr-range-track-height;
|
||||||
|
height: $plyr-range-track-height;
|
||||||
|
border-radius: $plyr-range-track-height;
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
margin-top: calc((#{$plyr-range-track-height} / 2) * -1);
|
||||||
|
margin-left: calc((#{$plyr-range-track-height} / 2) * -1);
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plyr__marker__tip {
|
||||||
|
background: $plyr-markers-background;
|
||||||
|
border-radius: $plyr-markers-radius;
|
||||||
|
bottom: 100%;
|
||||||
|
box-shadow: $plyr-markers-shadow;
|
||||||
|
color: $plyr-markers-color;
|
||||||
|
font-size: $plyr-font-size-small;
|
||||||
|
font-weight: $plyr-font-weight-regular;
|
||||||
|
left: 50%;
|
||||||
|
line-height: 1.3;
|
||||||
|
margin-bottom: calc(#{$plyr-markers-padding} * 2);
|
||||||
|
opacity: 0;
|
||||||
|
padding: $plyr-markers-padding calc(#{$plyr-markers-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;
|
||||||
|
white-space: nowrap;
|
||||||
|
z-index: 2;
|
||||||
|
|
||||||
|
// The background triangle
|
||||||
|
&::before {
|
||||||
|
border-left: $plyr-markers-arrow-size solid transparent;
|
||||||
|
border-right: $plyr-markers-arrow-size solid transparent;
|
||||||
|
border-top: $plyr-markers-arrow-size solid $plyr-markers-background;
|
||||||
|
bottom: calc(#{$plyr-markers-arrow-size} * -1);
|
||||||
|
content: '';
|
||||||
|
height: 0;
|
||||||
|
left: 50%;
|
||||||
|
position: absolute;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
width: 0;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.plyr__marker__tip--visible {
|
||||||
|
opacity: 1;
|
||||||
|
transform: translate(-50%, 0) scale(1);
|
||||||
|
z-index: 3;
|
||||||
|
}
|
@ -10,6 +10,7 @@
|
|||||||
.plyr__control svg {
|
.plyr__control svg {
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.plyr__control[aria-expanded='true'] {
|
.plyr__control[aria-expanded='true'] {
|
||||||
svg {
|
svg {
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
@ -73,10 +74,7 @@
|
|||||||
color: $plyr-menu-color;
|
color: $plyr-menu-color;
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: $plyr-font-size-menu;
|
font-size: $plyr-font-size-menu;
|
||||||
padding-bottom: calc(#{$plyr-control-padding} / 1.5);
|
padding: calc(#{$plyr-control-padding} / 1.5) calc(#{$plyr-control-padding} * 1.5);
|
||||||
padding-left: calc(#{$plyr-control-padding} * 1.5);
|
|
||||||
padding-right: calc(#{$plyr-control-padding} * 1.5);
|
|
||||||
padding-top: calc(#{$plyr-control-padding} / 1.5);
|
|
||||||
user-select: none;
|
user-select: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
@ -176,6 +174,7 @@
|
|||||||
&::before {
|
&::before {
|
||||||
background: $plyr-control-toggle-checked-background;
|
background: $plyr-control-toggle-checked-background;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateY(-50%) scale(1);
|
transform: translateY(-50%) scale(1);
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
|
||||||
.plyr--full-ui input[type='range'] {
|
.plyr--full-ui input[type='range'] {
|
||||||
-webkit-appearance: none; /* stylelint-disable-line */
|
appearance: none;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: calc(#{$plyr-range-thumb-height} * 2);
|
border-radius: calc(#{$plyr-range-thumb-height} * 2);
|
||||||
|
|
||||||
// `color` property is used in JS to populate lower fill for WebKit
|
// `color` property is used in JS to populate lower fill for WebKit
|
||||||
color: $plyr-range-fill-background;
|
color: $plyr-range-fill-background;
|
||||||
display: block;
|
display: block;
|
||||||
@ -18,23 +19,25 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
&::-webkit-slider-runnable-track {
|
&::-webkit-slider-runnable-track {
|
||||||
@include plyr-range-track();
|
@include plyr-range-track;
|
||||||
|
|
||||||
background-image: linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%));
|
background-image: linear-gradient(to right, currentColor var(--value, 0%), transparent var(--value, 0%));
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-webkit-slider-thumb {
|
&::-webkit-slider-thumb {
|
||||||
@include plyr-range-thumb();
|
@include plyr-range-thumb;
|
||||||
-webkit-appearance: none; /* stylelint-disable-line */
|
|
||||||
|
appearance: none;
|
||||||
margin-top: calc(((#{$plyr-range-thumb-height} - #{$plyr-range-track-height}) / 2) * -1);
|
margin-top: calc(((#{$plyr-range-thumb-height} - #{$plyr-range-track-height}) / 2) * -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mozilla
|
// Mozilla
|
||||||
&::-moz-range-track {
|
&::-moz-range-track {
|
||||||
@include plyr-range-track();
|
@include plyr-range-track;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-moz-range-thumb {
|
&::-moz-range-thumb {
|
||||||
@include plyr-range-thumb();
|
@include plyr-range-thumb;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-moz-range-progress {
|
&::-moz-range-progress {
|
||||||
@ -45,22 +48,24 @@
|
|||||||
|
|
||||||
// Microsoft
|
// Microsoft
|
||||||
&::-ms-track {
|
&::-ms-track {
|
||||||
@include plyr-range-track();
|
@include plyr-range-track;
|
||||||
|
|
||||||
color: transparent;
|
color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-ms-fill-upper {
|
&::-ms-fill-upper {
|
||||||
@include plyr-range-track();
|
@include plyr-range-track;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-ms-fill-lower {
|
&::-ms-fill-lower {
|
||||||
@include plyr-range-track();
|
@include plyr-range-track;
|
||||||
|
|
||||||
background: currentColor;
|
background: currentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-ms-thumb {
|
&::-ms-thumb {
|
||||||
@include plyr-range-thumb();
|
@include plyr-range-thumb;
|
||||||
|
|
||||||
// For some reason, Edge uses the -webkit margin above
|
// For some reason, Edge uses the -webkit margin above
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
@ -70,25 +75,25 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Focus styles
|
// Focus styles
|
||||||
&:focus {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::-moz-focus-outer {
|
&::-moz-focus-outer {
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
|
||||||
&.plyr__tab-focus {
|
&.plyr__tab-focus {
|
||||||
&::-webkit-slider-runnable-track {
|
&::-webkit-slider-runnable-track {
|
||||||
@include plyr-tab-focus();
|
@include plyr-tab-focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-moz-range-track {
|
&::-moz-range-track {
|
||||||
@include plyr-tab-focus();
|
@include plyr-tab-focus;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::-ms-track {
|
&::-ms-track {
|
||||||
@include plyr-tab-focus();
|
@include plyr-tab-focus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* stylelint-disable selector-max-compound-selectors */
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
// Tooltips
|
// Tooltips
|
||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
// Downloaded from https://github.com/malyw/css-vars (and modified)
|
// Downloaded from https://github.com/malyw/css-vars (and modified)
|
||||||
|
|
||||||
|
@use 'sass:list';
|
||||||
|
@use 'sass:map';
|
||||||
|
|
||||||
// global map to be filled via variables
|
// global map to be filled via variables
|
||||||
$css-vars: ();
|
$css-vars: ();
|
||||||
|
|
||||||
@ -21,36 +24,35 @@ $css-vars-use-native: false !default;
|
|||||||
|
|
||||||
///
|
///
|
||||||
// Emulates var() CSS native function behavior
|
// Emulates var() CSS native function behavior
|
||||||
//
|
|
||||||
// $args[0] {String} "--" + variable name
|
// $args[0] {String} "--" + variable name
|
||||||
// [$args[1]] Optional default value if variable is not assigned yet
|
// [$args[1]] Optional default value if variable is not assigned yet
|
||||||
//
|
|
||||||
// E.G.:
|
// E.G.:
|
||||||
// color: var(--main-color);
|
// color: var(--main-color);
|
||||||
// background: var(--main-background, green);
|
// background: var(--main-background, green);
|
||||||
///
|
///
|
||||||
@function var($args...) {
|
@function var($args...) {
|
||||||
// CHECK PARAMS
|
// CHECK PARAMS
|
||||||
@if (length($args) ==0) {
|
@if length($args) == 0 {
|
||||||
@error 'Variable name is expected to be passed to the var() function';
|
@error 'Variable name is expected to be passed to the var() function';
|
||||||
}
|
}
|
||||||
@if (str-length(nth($args, 1)) < 2 or str-slice(nth($args, 1), 0, 2) != '--') {
|
|
||||||
|
@if str-length(nth($args, 1)) < 2 or str-slice(nth($args, 1), 0, 2) != '--' {
|
||||||
@error "Variable name is expected to start from '--'";
|
@error "Variable name is expected to start from '--'";
|
||||||
}
|
}
|
||||||
|
|
||||||
// PROCESS
|
// PROCESS
|
||||||
$var-name: nth($args, 1);
|
$var-name: list.nth($args, 1);
|
||||||
$var-value: map-get($css-vars, $var-name);
|
$var-value: map.get($css-vars, $var-name);
|
||||||
|
|
||||||
@if ($css-vars-use-native) {
|
@if $css-vars-use-native {
|
||||||
// CSS variables
|
// CSS variables
|
||||||
// Native CSS: don't process function in case of native
|
// Native CSS: don't process function in case of native
|
||||||
@return unquote('var(' + $args + ')');
|
@return unquote('var(' + $args + ')');
|
||||||
} @else {
|
} @else {
|
||||||
@if ($var-value == null) {
|
@if not $var-value {
|
||||||
// variable is not provided so far
|
// variable is not provided so far
|
||||||
@if (length($args) == 2) {
|
@if length($args) == 2 {
|
||||||
$var-value: nth($args, 2);
|
$var-value: list.nth($args, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +62,7 @@ $css-vars-use-native: false !default;
|
|||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
// SASS mixin to provide variables
|
// Sass mixin to provide variables
|
||||||
// E.G.:
|
// E.G.:
|
||||||
// @include css-vars((
|
// @include css-vars((
|
||||||
// --color: rebeccapurple,
|
// --color: rebeccapurple,
|
||||||
@ -70,20 +72,21 @@ $css-vars-use-native: false !default;
|
|||||||
///
|
///
|
||||||
@mixin css-vars($var-map: null) {
|
@mixin css-vars($var-map: null) {
|
||||||
// CHECK PARAMS
|
// CHECK PARAMS
|
||||||
@if ($var-map == null) {
|
@if not $var-map {
|
||||||
@error 'Map of variables is expected, instead got: null';
|
@error 'Map of variables is expected, instead got: null';
|
||||||
}
|
}
|
||||||
@if (type_of($var-map) != map) {
|
|
||||||
|
@if type_of($var-map) != map {
|
||||||
@error 'Map of variables is expected, instead got another type passed: #{type_of($var, ap)}';
|
@error 'Map of variables is expected, instead got another type passed: #{type_of($var, ap)}';
|
||||||
}
|
}
|
||||||
|
|
||||||
// PROCESS
|
// PROCESS
|
||||||
@if ($css-vars-use-native) {
|
@if $css-vars-use-native {
|
||||||
// CSS variables
|
// CSS variables
|
||||||
// Native CSS: assign CSS custom properties to the global scope
|
// Native CSS: assign CSS custom properties to the global scope
|
||||||
@at-root :root {
|
@at-root :root {
|
||||||
@each $var-name, $var-value in $var-map {
|
@each $var-name, $var-value in $var-map {
|
||||||
@if (type_of($var-value) == string) {
|
@if type_of($var-value) == string {
|
||||||
#{$var-name}: $var-value; // to prevent quotes interpolation
|
#{$var-name}: $var-value; // to prevent quotes interpolation
|
||||||
} @else {
|
} @else {
|
||||||
#{$var-name}: #{$var-value};
|
#{$var-name}: #{$var-value};
|
||||||
|
@ -5,10 +5,8 @@
|
|||||||
// Nicer focus styles
|
// Nicer focus styles
|
||||||
// ---------------------------------------
|
// ---------------------------------------
|
||||||
@mixin plyr-tab-focus($color: $plyr-tab-focus-color) {
|
@mixin plyr-tab-focus($color: $plyr-tab-focus-color) {
|
||||||
outline-color: $color;
|
outline: $color dotted 3px;
|
||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
outline-style: dotted;
|
|
||||||
outline-width: 3px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Font smoothing
|
// Font smoothing
|
||||||
|
@ -47,10 +47,10 @@
|
|||||||
display: block;
|
display: block;
|
||||||
height: $plyr-range-track-height;
|
height: $plyr-range-track-height;
|
||||||
left: 0;
|
left: 0;
|
||||||
margin: -($plyr-range-track-height / 2) 0 0;
|
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
width: 3px;
|
width: 3px;
|
||||||
z-index: 3; // Between progress and thumb
|
z-index: 3; // Between progress and thumb
|
||||||
}
|
}
|
||||||
|
@ -4,15 +4,14 @@
|
|||||||
// TODO: Review use of BEM classnames
|
// TODO: Review use of BEM classnames
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@charset 'UTF-8';
|
@charset 'UTF-8';
|
||||||
|
|
||||||
@import 'lib/css-vars';
|
@import 'lib/css-vars';
|
||||||
|
|
||||||
$css-vars-use-native: true;
|
$css-vars-use-native: true;
|
||||||
|
|
||||||
@import 'settings/breakpoints';
|
@import 'settings/breakpoints';
|
||||||
@import 'settings/colors';
|
@import 'settings/colors';
|
||||||
@import 'settings/cosmetics';
|
@import 'settings/cosmetics';
|
||||||
@import 'settings/type';
|
@import 'settings/type';
|
||||||
|
|
||||||
@import 'settings/badges';
|
@import 'settings/badges';
|
||||||
@import 'settings/captions';
|
@import 'settings/captions';
|
||||||
@import 'settings/controls';
|
@import 'settings/controls';
|
||||||
@ -21,13 +20,11 @@ $css-vars-use-native: true;
|
|||||||
@import 'settings/progress';
|
@import 'settings/progress';
|
||||||
@import 'settings/sliders';
|
@import 'settings/sliders';
|
||||||
@import 'settings/tooltips';
|
@import 'settings/tooltips';
|
||||||
|
@import 'settings/markers';
|
||||||
@import 'lib/animation';
|
@import 'lib/animation';
|
||||||
@import 'lib/functions';
|
@import 'lib/functions';
|
||||||
@import 'lib/mixins';
|
@import 'lib/mixins';
|
||||||
|
|
||||||
@import 'base';
|
@import 'base';
|
||||||
|
|
||||||
@import 'components/badges';
|
@import 'components/badges';
|
||||||
@import 'components/captions';
|
@import 'components/captions';
|
||||||
@import 'components/control';
|
@import 'components/control';
|
||||||
@ -39,14 +36,11 @@ $css-vars-use-native: true;
|
|||||||
@import 'components/tooltips';
|
@import 'components/tooltips';
|
||||||
@import 'components/progress';
|
@import 'components/progress';
|
||||||
@import 'components/volume';
|
@import 'components/volume';
|
||||||
|
@import 'components/markers';
|
||||||
@import 'types/audio';
|
@import 'types/audio';
|
||||||
@import 'types/video';
|
@import 'types/video';
|
||||||
|
|
||||||
@import 'states/fullscreen';
|
@import 'states/fullscreen';
|
||||||
|
|
||||||
@import 'plugins/ads';
|
@import 'plugins/ads';
|
||||||
@import 'plugins/preview-thumbnails/index';
|
@import 'plugins/preview-thumbnails/index';
|
||||||
|
|
||||||
@import 'utils/animation';
|
@import 'utils/animation';
|
||||||
@import 'utils/hidden';
|
@import 'utils/hidden';
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
$plyr-captions-background: var(--plyr-captions-background, rgba(#000, 0.8)) !default;
|
$plyr-captions-background: var(--plyr-captions-background, rgba(#000, 0.8)) !default;
|
||||||
$plyr-captions-text-color: var(--plyr-captions-text-color, #fff) !default;
|
$plyr-captions-text-color: var(--plyr-captions-text-color, #fff) !default;
|
||||||
|
|
||||||
$plyr-font-size-captions-base: $plyr-font-size-base !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-small: $plyr-font-size-small !default;
|
||||||
$plyr-font-size-captions-medium: $plyr-font-size-large !default;
|
$plyr-font-size-captions-medium: $plyr-font-size-large !default;
|
||||||
|
@ -2,17 +2,17 @@
|
|||||||
// Colors
|
// Colors
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
$plyr-color-main: var(--plyr-color-main, hsl(198, 100%, 50%)) !default;
|
$plyr-color-main: var(--plyr-color-main, hsl(198deg 100% 50%)) !default;
|
||||||
$plyr-video-background: var(--plyr-video-background, rgba(0,0,0,1)) !default;
|
$plyr-video-background: var(--plyr-video-background, rgb(0 0 0 / 100%)) !default;
|
||||||
|
|
||||||
// Grayscale
|
// Grayscale
|
||||||
$plyr-color-gray-900: hsl(216, 15%, 16%) !default;
|
$plyr-color-gray-900: hsl(216deg 15% 16%) !default;
|
||||||
$plyr-color-gray-800: hsl(216, 15%, 25%) !default;
|
$plyr-color-gray-800: hsl(216deg 15% 25%) !default;
|
||||||
$plyr-color-gray-700: hsl(216, 15%, 34%) !default;
|
$plyr-color-gray-700: hsl(216deg 15% 34%) !default;
|
||||||
$plyr-color-gray-600: hsl(216, 15%, 43%) !default;
|
$plyr-color-gray-600: hsl(216deg 15% 43%) !default;
|
||||||
$plyr-color-gray-500: hsl(216, 15%, 52%) !default;
|
$plyr-color-gray-500: hsl(216deg 15% 52%) !default;
|
||||||
$plyr-color-gray-400: hsl(216, 15%, 61%) !default;
|
$plyr-color-gray-400: hsl(216deg 15% 61%) !default;
|
||||||
$plyr-color-gray-300: hsl(216, 15%, 70%) !default;
|
$plyr-color-gray-300: hsl(216deg 15% 70%) !default;
|
||||||
$plyr-color-gray-200: hsl(216, 15%, 79%) !default;
|
$plyr-color-gray-200: hsl(216deg 15% 79%) !default;
|
||||||
$plyr-color-gray-100: hsl(216, 15%, 88%) !default;
|
$plyr-color-gray-100: hsl(216deg 15% 88%) !default;
|
||||||
$plyr-color-gray-50: hsl(216, 15%, 97%) !default;
|
$plyr-color-gray-50: hsl(216deg 15% 97%) !default;
|
||||||
|
@ -7,12 +7,10 @@ $plyr-control-spacing: var(--plyr-control-spacing, 10px) !default;
|
|||||||
$plyr-control-padding: calc(#{$plyr-control-spacing} * 0.7);
|
$plyr-control-padding: calc(#{$plyr-control-spacing} * 0.7);
|
||||||
$plyr-control-padding: var(--plyr-control-padding, $plyr-control-padding) !default;
|
$plyr-control-padding: var(--plyr-control-padding, $plyr-control-padding) !default;
|
||||||
$plyr-control-radius: var(--plyr-control-radius, 3px) !default;
|
$plyr-control-radius: var(--plyr-control-radius, 3px) !default;
|
||||||
|
|
||||||
$plyr-control-toggle-checked-background: var(
|
$plyr-control-toggle-checked-background: var(
|
||||||
--plyr-control-toggle-checked-background,
|
--plyr-control-toggle-checked-background,
|
||||||
var(--plyr-color-main, $plyr-color-main)
|
var(--plyr-color-main, $plyr-color-main)
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
$plyr-video-controls-background: var(
|
$plyr-video-controls-background: var(
|
||||||
--plyr-video-controls-background,
|
--plyr-video-controls-background,
|
||||||
linear-gradient(rgba(#000, 0), rgba(#000, 0.75))
|
linear-gradient(rgba(#000, 0), rgba(#000, 0.75))
|
||||||
@ -23,7 +21,6 @@ $plyr-video-control-background-hover: var(
|
|||||||
--plyr-video-control-background-hover,
|
--plyr-video-control-background-hover,
|
||||||
var(--plyr-color-main, $plyr-color-main)
|
var(--plyr-color-main, $plyr-color-main)
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
$plyr-audio-controls-background: var(--plyr-audio-controls-background, #fff) !default;
|
$plyr-audio-controls-background: var(--plyr-audio-controls-background, #fff) !default;
|
||||||
$plyr-audio-control-color: var(--plyr-audio-control-color, $plyr-color-gray-700) !default;
|
$plyr-audio-control-color: var(--plyr-audio-control-color, $plyr-color-gray-700) !default;
|
||||||
$plyr-audio-control-color-hover: var(--plyr-audio-control-color-hover, #fff) !default;
|
$plyr-audio-control-color-hover: var(--plyr-audio-control-color-hover, #fff) !default;
|
||||||
|
11
src/sass/settings/markers.scss
Normal file
11
src/sass/settings/markers.scss
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// ==========================================================================
|
||||||
|
// Markers
|
||||||
|
// ==========================================================================
|
||||||
|
|
||||||
|
$plyr-markers-background: var(--plyr-markers-background, rgba(#fff, 0.9)) !default;
|
||||||
|
$plyr-markers-color: var(--plyr-markers-color, $plyr-color-gray-700) !default;
|
||||||
|
$plyr-markers-padding: calc(#{$plyr-control-spacing} / 2);
|
||||||
|
$plyr-markers-padding: var(--plyr-markers-padding, $plyr-markers-padding) !default;
|
||||||
|
$plyr-markers-arrow-size: var(--plyr-markers-arrow-size, 4px) !default;
|
||||||
|
$plyr-markers-radius: var(--plyr-markers-radius, 3px) !default;
|
||||||
|
$plyr-markers-shadow: var(--plyr-markers-shadow, 0 1px 2px rgba(0, 0, 0, 0.15)) !default;
|
@ -7,9 +7,7 @@ $plyr-menu-radius: var(--plyr-menu-radius, 4px) !default;
|
|||||||
$plyr-menu-color: var(--plyr-menu-color, $plyr-color-gray-700) !default;
|
$plyr-menu-color: var(--plyr-menu-color, $plyr-color-gray-700) !default;
|
||||||
$plyr-menu-shadow: var(--plyr-menu-shadow, 0 1px 2px rgba(#000, 0.15)) !default;
|
$plyr-menu-shadow: var(--plyr-menu-shadow, 0 1px 2px rgba(#000, 0.15)) !default;
|
||||||
$plyr-menu-arrow-size: var(--plyr-menu-arrow-size, 4px) !default;
|
$plyr-menu-arrow-size: var(--plyr-menu-arrow-size, 4px) !default;
|
||||||
|
|
||||||
$plyr-menu-item-arrow-size: var(--plyr-menu-item-arrow-size, 4px) !default;
|
$plyr-menu-item-arrow-size: var(--plyr-menu-item-arrow-size, 4px) !default;
|
||||||
$plyr-menu-item-arrow-color: var(--plyr-menu-arrow-color, $plyr-color-gray-500) !default;
|
$plyr-menu-item-arrow-color: var(--plyr-menu-arrow-color, $plyr-color-gray-500) !default;
|
||||||
|
|
||||||
$plyr-menu-back-border-color: var(--plyr-menu-back-border-color, $plyr-color-gray-100) !default;
|
$plyr-menu-back-border-color: var(--plyr-menu-back-border-color, $plyr-color-gray-100) !default;
|
||||||
$plyr-menu-back-border-shadow-color: var(--plyr-menu-back-border-shadow-color, #fff) !default;
|
$plyr-menu-back-border-shadow-color: var(--plyr-menu-back-border-shadow-color, #fff) !default;
|
||||||
|
@ -29,7 +29,6 @@ $plyr-video-range-thumb-active-shadow-color: var(
|
|||||||
--plyr-audio-range-thumb-active-shadow-color,
|
--plyr-audio-range-thumb-active-shadow-color,
|
||||||
rgba(#fff, 0.5)
|
rgba(#fff, 0.5)
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
$plyr-audio-range-track-background: var(
|
$plyr-audio-range-track-background: var(
|
||||||
--plyr-audio-range-track-background,
|
--plyr-audio-range-track-background,
|
||||||
$plyr-audio-progress-buffered-background
|
$plyr-audio-progress-buffered-background
|
||||||
|
@ -7,14 +7,10 @@ $plyr-font-size-base: var(--plyr-font-size-base, 15px) !default;
|
|||||||
$plyr-font-size-small: var(--plyr-font-size-small, 13px) !default;
|
$plyr-font-size-small: var(--plyr-font-size-small, 13px) !default;
|
||||||
$plyr-font-size-large: var(--plyr-font-size-large, 18px) !default;
|
$plyr-font-size-large: var(--plyr-font-size-large, 18px) !default;
|
||||||
$plyr-font-size-xlarge: var(--plyr-font-size-xlarge, 21px) !default;
|
$plyr-font-size-xlarge: var(--plyr-font-size-xlarge, 21px) !default;
|
||||||
|
|
||||||
$plyr-font-size-time: var(--plyr-font-size-time, $plyr-font-size-small) !default;
|
$plyr-font-size-time: var(--plyr-font-size-time, $plyr-font-size-small) !default;
|
||||||
$plyr-font-size-menu: var(--plyr-font-size-menu, $plyr-font-size-small) !default;
|
$plyr-font-size-menu: var(--plyr-font-size-menu, $plyr-font-size-small) !default;
|
||||||
$plyr-font-size-badge: var(--plyr-font-size-badge, 9px) !default;
|
$plyr-font-size-badge: var(--plyr-font-size-badge, 9px) !default;
|
||||||
|
|
||||||
$plyr-font-weight-regular: var(--plyr-font-weight-regular, 400) !default;
|
$plyr-font-weight-regular: var(--plyr-font-weight-regular, 400) !default;
|
||||||
$plyr-font-weight-bold: var(--plyr-font-weight-bold, 600) !default;
|
$plyr-font-weight-bold: var(--plyr-font-weight-bold, 600) !default;
|
||||||
|
|
||||||
$plyr-line-height: var(--plyr-line-height, 1.7) !default;
|
$plyr-line-height: var(--plyr-line-height, 1.7) !default;
|
||||||
|
|
||||||
$plyr-font-smoothing: var(--plyr-font-smoothing, false) !default;
|
$plyr-font-smoothing: var(--plyr-font-smoothing, false) !default;
|
||||||
|
@ -3,27 +3,13 @@
|
|||||||
// --------------------------------------------------------------
|
// --------------------------------------------------------------
|
||||||
|
|
||||||
.plyr:fullscreen {
|
.plyr:fullscreen {
|
||||||
@include plyr-fullscreen-active();
|
@include plyr-fullscreen-active;
|
||||||
}
|
|
||||||
|
|
||||||
/* stylelint-disable-next-line */
|
|
||||||
.plyr:-webkit-full-screen {
|
|
||||||
@include plyr-fullscreen-active();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* stylelint-disable-next-line */
|
|
||||||
.plyr:-moz-full-screen {
|
|
||||||
@include plyr-fullscreen-active();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* stylelint-disable-next-line */
|
|
||||||
.plyr:-ms-fullscreen {
|
|
||||||
@include plyr-fullscreen-active();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback for unsupported browsers
|
// Fallback for unsupported browsers
|
||||||
.plyr--fullscreen-fallback {
|
.plyr--fullscreen-fallback {
|
||||||
@include plyr-fullscreen-active();
|
@include plyr-fullscreen-active;
|
||||||
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
display: block;
|
display: block;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -51,6 +51,7 @@ $embed-padding: (math.div(100, 16) * 9);
|
|||||||
.plyr--full-ui .plyr__video-embed > .plyr__video-embed__container {
|
.plyr--full-ui .plyr__video-embed > .plyr__video-embed__container {
|
||||||
$height: 240;
|
$height: 240;
|
||||||
$offset: to-percentage(math.div($height - $embed-padding, math.div($height, 50)));
|
$offset: to-percentage(math.div($height - $embed-padding, math.div($height, 50)));
|
||||||
|
|
||||||
padding-bottom: to-percentage($height);
|
padding-bottom: to-percentage($height);
|
||||||
position: relative;
|
position: relative;
|
||||||
transform: translateY(-$offset);
|
transform: translateY(-$offset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user