Merge branch 'master' into develop

This commit is contained in:
Sam Potts 2022-04-18 11:37:12 +10:00
commit c64c8ac6c0
49 changed files with 2506 additions and 1945 deletions

View File

@ -1,6 +1,7 @@
{
"plugins": ["stylelint-selector-bem-pattern", "stylelint-scss"],
"extends": ["stylelint-config-recommended", "stylelint-config-sass-guidelines", "stylelint-config-prettier"],
"plugins": ["stylelint-selector-bem-pattern"],
"extends": ["stylelint-config-sass-guidelines", "stylelint-config-prettier"],
"customSyntax": "postcss-scss",
"rules": {
"selector-class-pattern": null,
"selector-no-qualifying-type": [
@ -9,10 +10,7 @@
"ignore": ["attribute", "class"]
}
],
"string-no-newline": null,
"indentation": 2,
"string-quotes": "single",
"max-nesting-depth": 2,
"max-nesting-depth": 4,
"plugin/selector-bem-pattern": {
"preset": "bem",
"componentName": "(([a-z0-9]+(?!-$)-?)+)",

View File

@ -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
- 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: Icons loading within iframes (thanks @ajgagnon)
- 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 issue with CSS custom property check (thanks @syedhusain-appspace)
- 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
### v3.6.2
@ -106,7 +122,7 @@
### v3.5.8
- 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
- Remove all Vimeo controls for Pro & Premium accounts
- Improve thumbnail size calculations when size is set per css (thanks @ydylla)
@ -121,7 +137,7 @@
- Accessibility tweak for the play button (thanks @lunika)
- Fix for ads configuration (thanks @SoftCreatR)
- 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)
- Fix being unable to unmute autoplayed video on iOS (thanks @sumanbh)
- Fixed Plyr container not resizing responsively (thanks @shravan2x)
@ -155,7 +171,7 @@ _Note:_ This update contains CSS changes.
### v3.5.4
- 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 setGutter call (from Sentry)
- 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
- 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)
- Added basic looping support
- 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
- SASS cleanup (fixes #265)
- Sass cleanup (fixes #265)
- Docs tidy up to help quick start (fixes #253)
- Fix for issues with data attribute options passing (fixes #257)
- **_(Important)_** Removed the requirement for a wrapper div to setup Plyr and removed the dependency on the `plyr` classname as a JS hook. By default it will now look for `<video>`, `<audio>` and `[data-type]` elements. If you are just calling `setup()` with a `<div class="plyr">` you may want to give it a good test after upgrading. You can probably remove the wrapper div. The reason behind this is to make setup easier for newcomers and prevent the styling being used on unsupported players (because the plyr classname was used as a CSS and JS hook - which isn't ideal)
@ -873,7 +889,7 @@ And some other changes and bug fixes:
### v1.5.18
- 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
- Docs fixes inc controls HTML (fixes #180)
@ -910,7 +926,7 @@ And some other changes and bug fixes:
- iOS embed bug fixes (fixes #166)
- Hide IE/Edge <input type='range'> tooltip (since we have a styled one) (fixes #160)
- SASS bug fix for default values (fixes #158)
- Sass bug fix for default values (fixes #158)
### v1.5.9
@ -932,7 +948,7 @@ And some other changes and bug fixes:
### v1.5.6
- 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)
- 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
- SASS updates and fixes (cheers @ChristianPV)
- Sass updates and fixes (cheers @ChristianPV)
### v1.2.5
@ -1124,7 +1140,7 @@ And some other changes and bug fixes:
### v1.0.26
- Fixes for SASS (cheers @brunowego)
- Fixes for Sass (cheers @brunowego)
- Indentation reset to 4 spaces
### v1.0.25
@ -1169,7 +1185,7 @@ And some other changes and bug fixes:
### v1.0.17
- SASS support added (thanks to @brunowego)
- Sass support added (thanks to @brunowego)
- Docs completely separated to avoid any confusion
- New gulp tasks (will add more documentation for this)

View File

@ -35,7 +35,7 @@ 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

View File

@ -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.
[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
- 👌 **[Preview thumbnails](#preview-thumbnails)** - support for displaying preview thumbnails
- 🤟 **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
@ -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.
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
<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...
```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
Include the `plyr.css` stylsheet into your `<head>`.
Include the `plyr.css` stylesheet into your `<head>`.
```html
<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:
```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
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
@ -267,14 +270,12 @@ You can set them in your CSS for all players:
...or in your HTML:
```html
<video class="player" style="--plyr-color-main: #1ac266;">
...
</video>
<video class="player" style="--plyr-color-main: #1ac266;">...</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.
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:
```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:
@ -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. |
| `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. |
| `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. |
| `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. |
@ -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` |
| `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. |
| `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
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:
```javascript
element.addEventListener('ready', event => {
element.addEventListener('ready', (event) => {
const player = event.detail.plyr;
});
```
@ -452,7 +454,7 @@ player.fullscreen.enter(); // Enter fullscreen
```
| Method | Parameters | Description |
| -------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- |
| -------------------------------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------- |
| `play()`&sup1; | - | Start playback. |
| `pause()` | - | Pause playback. |
| `togglePlay(toggle)`&sup1; | Boolean | Toggle playback, if no parameters are passed, it will toggle based on current status. |
@ -467,7 +469,7 @@ player.fullscreen.enter(); // Enter fullscreen
| `fullscreen.exit()` | - | Exit fullscreen. |
| `fullscreen.toggle()` | - | Toggle fullscreen. |
| `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. |
| `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. |
@ -514,7 +516,7 @@ player.fullscreen.active; // false;
| `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. |
| `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. |
| `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. |
@ -637,7 +639,7 @@ reference to the instance, you can use the `on()` API method or `addEventListene
property. Here's an example:
```javascript
player.on('ready', event => {
player.on('ready', (event) => {
const instance = event.detail.plyr;
});
```
@ -785,7 +787,7 @@ 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:
| Type | Maintainer | Link |
| --------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| ----------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| 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) |
| React | Chintan Prajapati ([@chintan9](https://github.com/chintan9)) | [https://github.com/chintan9/plyr-react](https://github.com/chintan9/plyr-react) |

24
cspell.json Normal file
View 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": []
}

View File

@ -105,14 +105,6 @@
</button>
</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">
<a href="https://github.com/sampotts/plyr" target="_blank" class="button js-shr">
<svg class="icon" role="presentation">

View File

@ -65,6 +65,34 @@ import toggleClass from './toggle-class';
// Prevent Vimeo blocking plyr.io demo site
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

View File

@ -2,8 +2,8 @@
// Plyr.io Demo Page
// ==========================================================================
@charset 'UTF-8';
@import '../../../../src/sass/lib/css-vars';
$css-vars-use-native: true;
// Settings

View File

@ -45,7 +45,7 @@
}
&.tab-focus {
@include tab-focus();
@include tab-focus;
}
&:active {
@ -64,7 +64,7 @@
// Count bubble
.button__count {
animation: fadein 0.2s ease;
animation: fade-in 0.2s ease;
background: $color-button-count-background;
color: $color-button-count-text;
margin-left: ($spacing-base * 0.75);

View File

@ -7,7 +7,7 @@ header {
text-align: center;
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;
font-weight: $font-weight-light;
opacity: 0.5;

View File

@ -5,7 +5,7 @@
// Make a <button> look like an <a>
button.faux-link {
@extend a; // stylelint-disable-line
@include cancel-button-styles();
@include cancel-button-styles;
}
// Links
@ -39,7 +39,7 @@ a {
}
&.tab-focus {
@include tab-focus();
@include tab-focus;
}
&.no-border::after {

View File

@ -3,23 +3,26 @@
// ==========================================================================
// Fade
@keyframes fadein {
@keyframes fade-in {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes shrinkHide {
@keyframes shrink-hide {
0% {
opacity: 0.5;
width: 38px;
}
20% {
width: 45px;
}
100% {
opacity: 0;
width: 0;

View File

@ -4,7 +4,7 @@
@font-face {
font-display: swap;
font-family: 'Gordita';
font-family: Gordita;
font-style: normal;
font-weight: $font-weight-light;
src: url('https://cdn.plyr.io/static/fonts/gordita-light.woff2') format('woff2'),
@ -13,7 +13,7 @@
@font-face {
font-display: swap;
font-family: 'Gordita';
font-family: Gordita;
font-style: normal;
font-weight: $font-weight-regular;
src: url('https://cdn.plyr.io/static/fonts/gordita-regular.woff2') format('woff2'),
@ -22,7 +22,7 @@
@font-face {
font-display: swap;
font-family: 'Gordita';
font-family: Gordita;
font-style: normal;
font-weight: $font-weight-medium;
src: url('https://cdn.plyr.io/static/fonts/gordita-medium.woff2') format('woff2'),
@ -31,7 +31,7 @@
@font-face {
font-display: swap;
font-family: 'Gordita';
font-family: Gordita;
font-style: normal;
font-weight: $font-weight-bold;
src: url('https://cdn.plyr.io/static/fonts/gordita-bold.woff2') format('woff2'),
@ -40,7 +40,7 @@
@font-face {
font-display: swap;
font-family: 'Gordita';
font-family: Gordita;
font-style: normal;
font-weight: $font-weight-black;
src: url('https://cdn.plyr.io/static/fonts/gordita-black.woff2') format('woff2'),

View File

@ -18,7 +18,7 @@
position: relative;
text-align: inherit;
text-shadow: inherit;
-moz-user-select: text; // stylelint-disable-line
user-select: text;
vertical-align: baseline;
width: auto;
}

View File

@ -11,8 +11,7 @@
html {
line-height: 1.15; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
text-size-adjust: 100%; /* 2 */
}
/* Sections
@ -89,7 +88,7 @@ hr {
*/
pre {
font-family: monospace, monospace; /* 1 */
font-family: monospace; /* 1 */
font-size: 1em; /* 2 */
}
@ -103,7 +102,7 @@ pre {
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
text-decoration-skip: objects; /* 2 */
}
/**
@ -112,7 +111,7 @@ a {
*/
abbr[title] {
border-bottom: none; /* 1 */
border-bottom: 0; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
@ -281,7 +280,7 @@ button,
html [type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button; /* 2 */
appearance: button; /* 2 */
}
/**
@ -375,7 +374,7 @@ textarea {
*/
[type='search'] {
-webkit-appearance: textfield; /* 1 */
appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
@ -385,7 +384,7 @@ textarea {
[type='search']::-webkit-search-cancel-button,
[type='search']::-webkit-search-decoration {
-webkit-appearance: none;
appearance: none;
}
/**
@ -394,7 +393,7 @@ textarea {
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
appearance: button; /* 1 */
font: inherit; /* 2 */
}

View File

@ -3,7 +3,7 @@
// ==========================================================================
// 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-700: lighten($color-gray-800, 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%);
// Branding
$color-brand-primary: hsl(198, 100%, 50%);
$color-brand-primary: hsl(198deg 100% 50%);
// Text
$color-text: $color-gray-700;
@ -28,13 +28,13 @@ $color-twitter: #4baaf4;
$color-link: $color-brand-primary;
// Background
$color-background-from: hsl(198, 100%, 94%);
$color-background-to: hsl(198, 100%, 98%);
$color-background-from: hsl(198deg 100% 94%);
$color-background-to: hsl(198deg 100% 98%);
// Buttons
$color-button-background: $color-brand-primary;
$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-text: $color-gray-600;

View File

@ -4,18 +4,14 @@
$font-sans-serif: 'Gordita', 'Avenir', 'Helvetica Neue', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol';
$font-size-base: 15;
$font-size-small: 13;
$font-size-large: 18;
$font-size-h1: 64;
$font-weight-light: 300;
$font-weight-regular: 400;
$font-weight-medium: 500;
$font-weight-bold: 600;
$font-weight-black: 900;
$line-height-base: 1.75;
$letter-spacing-headings: -0.025em;

View File

@ -8,8 +8,9 @@ html {
}
body {
@include font-smoothing();
@include font-smoothing;
@include font-size($font-size-base);
color: $color-text;
font-family: $font-sans-serif;
font-weight: $font-weight-medium;
@ -30,5 +31,6 @@ small {
small {
@include font-size($font-size-small);
display: block;
}

View File

@ -4,6 +4,7 @@
h1 {
@include font-size($font-size-h1);
color: $color-headings;
font-weight: $font-weight-bold;
letter-spacing: $letter-spacing-headings;

View File

@ -1,6 +1,6 @@
{
"name": "plyr",
"version": "3.6.9",
"version": "3.6.12",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "https://plyr.io",
"author": "Sam Potts <sam@potts.es>",
@ -31,24 +31,24 @@
"browserslist": "> 1%",
"scripts": {
"build": "gulp build",
"lint": "eslint src/js && npm run-script remark",
"lint:fix": "eslint --fix src/js",
"lint": "eslint src/js && npm run remark && stylelint **/*.scss",
"lint:fix": "eslint --fix src/js && stylelint **/*.scss --fix",
"remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'",
"deploy": "yarn lint && gulp version && gulp build && gulp deploy",
"format": "prettier --write \"./{src,demo/src}/**/*.{js,scss}\"",
"start": "gulp"
},
"devDependencies": {
"@babel/core": "^7.13.15",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/preset-env": "^7.13.15",
"@babel/core": "^7.16.5",
"@babel/plugin-proposal-class-properties": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@sampotts/eslint-config": "1.1.7",
"autoprefixer": "^10.2.5",
"aws-sdk": "^2.888.0",
"autoprefixer": "^10.4.0",
"aws-sdk": "^2.1046.0",
"babel-eslint": "^10.1.0",
"browser-sync": "^2.26.14",
"colorette": "2.0.12",
"cssnano": "^5.0.1",
"browser-sync": "^2.27.7",
"colorette": "2.0.16",
"cssnano": "^5.0.13",
"del": "^6.0.0",
"eslint": "^7.23.0",
"fancy-log": "^1.3.3",
@ -56,42 +56,40 @@
"gulp": "^4.0.2",
"gulp-awspublish": "^4.1.2",
"gulp-better-rollup": "^4.0.1",
"gulp-filter": "^6.0.0",
"gulp-filter": "^7.0.0",
"gulp-header": "^2.0.9",
"gulp-hub": "^4.2.0",
"gulp-if": "^3.0.0",
"gulp-imagemin": "^7.1.0",
"gulp-open": "^3.0.1",
"gulp-plumber": "^1.2.1",
"gulp-postcss": "^9.0.0",
"gulp-postcss": "^9.0.1",
"gulp-rename": "^2.0.0",
"gulp-replace": "^1.0.0",
"gulp-replace": "^1.1.3",
"gulp-sass": "^5.0.0",
"gulp-size": "^3.0.0",
"gulp-size": "^4.0.1",
"gulp-sourcemaps": "^3.0.0",
"gulp-svgstore": "^7.0.1",
"gulp-terser": "^2.0.1",
"postcss": "^8.2.10",
"postcss-custom-properties": "^11.0.0",
"gulp-svgstore": "^9.0.0",
"gulp-terser": "^2.1.0",
"postcss": "^8.4.5",
"postcss-custom-properties": "^12.0.1",
"postcss-scss": "^4.0.2",
"prettier-eslint": "^12.0.0",
"prettier-stylelint": "^0.4.2",
"remark-cli": "^9.0.0",
"remark-validate-links": "^10.0.4",
"rollup": "^2.45.2",
"remark-cli": "^10.0.1",
"remark-validate-links": "^11.0.2",
"rollup": "^2.61.1",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"sass": "^1.42.1",
"stylelint": "^13.12.0",
"stylelint-config-prettier": "^8.0.2",
"stylelint-config-recommended": "^4.0.0",
"stylelint-config-sass-guidelines": "^8.0.0",
"stylelint-order": "^4.1.0",
"stylelint-scss": "^3.19.0",
"stylelint-selector-bem-pattern": "^2.1.0"
"sass": "^1.45.0",
"stylelint": "^14.1.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-sass-guidelines": "^9.0.1",
"stylelint-selector-bem-pattern": "^2.1.1"
},
"dependencies": {
"core-js": "^3.10.1",
"core-js": "^3.20.0",
"custom-event-polyfill": "^1.0.7",
"loadjs": "^4.2.0",
"rangetouch": "^2.0.1",

View File

@ -12,7 +12,9 @@
// Linting
"stylelint.enable": true,
"stylelint.validate": ["css", "scss"],
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"javascript.validate.enable": false,

View File

@ -61,7 +61,7 @@ const defaults = {
// Sprite (for icons)
loadSprite: true,
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)
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
@ -391,6 +391,10 @@ const defaults = {
scrubbingContainer: 'plyr__preview-scrubbing',
scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown',
},
markers: {
points: 'plyr__marker__points',
tip: 'plyr__marker__tip',
},
},
// Embed attributes
@ -441,6 +445,20 @@ const defaults = {
customControls: true,
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;

81
src/js/controls.js vendored
View File

@ -796,6 +796,10 @@ const controls = {
controls.updateTimeDisplay.call(this, this.elements.display.duration, this.duration);
}
if (this.config.markers.enabled) {
controls.setMarkers.call(this);
}
// Update the tooltip (if visible)
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;

View File

@ -73,7 +73,7 @@ const html5 = {
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)) {
player.config.quality.onChange(input);
} else {

18
src/js/plyr.d.ts vendored
View File

@ -518,6 +518,11 @@ declare namespace Plyr {
* Preview Thumbnails Options.
*/
previewThumbnails?: PreviewThumbnailsOptions;
/**
* Media Metadata Options.
*/
mediaMetadata?: MediaMetadataOptions;
}
interface QualityOptions {
@ -576,6 +581,19 @@ declare namespace Plyr {
src?: string | string[];
}
interface MediaMetadataArtwork {
src: string;
sizes?: string;
type: string;
}
interface MediaMetadataOptions {
title?: string;
artist?: string;
album?: string;
artwork?: MediaMetadataArtwork[];
}
export interface Elements {
buttons: {
airplay?: HTMLButtonElement;

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v3.6.9
// plyr.js v3.6.12
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr Polyfilled Build
// plyr.js v3.6.9
// plyr.js v3.6.12
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================

View File

@ -125,6 +125,11 @@ const ui = {
if (this.config.duration) {
controls.durationUpdate.call(this);
}
// Media metadata
if (this.config.mediaMetadata) {
controls.setMediaMetadata.call(this);
}
},
// Setup aria attribute for play and iframe title

View File

@ -5,6 +5,7 @@
// Base
.plyr {
@include plyr-font-smoothing($plyr-font-smoothing);
align-items: center;
direction: ltr;
display: flex;

View File

@ -29,7 +29,7 @@
// Tab focus
&.plyr__tab-focus {
@include plyr-tab-focus();
@include plyr-tab-focus;
}
}

View File

@ -56,6 +56,7 @@
.plyr [data-plyr='fullscreen'] {
display: none;
}
.plyr--captions-enabled [data-plyr='captions'],
.plyr--pip-supported [data-plyr='pip'],
.plyr--airplay-supported [data-plyr='airplay'],

View 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;
}

View File

@ -10,6 +10,7 @@
.plyr__control svg {
transition: transform 0.3s ease;
}
.plyr__control[aria-expanded='true'] {
svg {
transform: rotate(90deg);
@ -73,10 +74,7 @@
color: $plyr-menu-color;
display: flex;
font-size: $plyr-font-size-menu;
padding-bottom: 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);
padding: calc(#{$plyr-control-padding} / 1.5) calc(#{$plyr-control-padding} * 1.5);
user-select: none;
width: 100%;
@ -176,6 +174,7 @@
&::before {
background: $plyr-control-toggle-checked-background;
}
&::after {
opacity: 1;
transform: translateY(-50%) scale(1);

View File

@ -3,10 +3,11 @@
// --------------------------------------------------------------
.plyr--full-ui input[type='range'] {
-webkit-appearance: none; /* stylelint-disable-line */
appearance: none;
background: transparent;
border: 0;
border-radius: calc(#{$plyr-range-thumb-height} * 2);
// `color` property is used in JS to populate lower fill for WebKit
color: $plyr-range-fill-background;
display: block;
@ -18,23 +19,25 @@
width: 100%;
&::-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%));
}
&::-webkit-slider-thumb {
@include plyr-range-thumb();
-webkit-appearance: none; /* stylelint-disable-line */
@include plyr-range-thumb;
appearance: none;
margin-top: calc(((#{$plyr-range-thumb-height} - #{$plyr-range-track-height}) / 2) * -1);
}
// Mozilla
&::-moz-range-track {
@include plyr-range-track();
@include plyr-range-track;
}
&::-moz-range-thumb {
@include plyr-range-thumb();
@include plyr-range-thumb;
}
&::-moz-range-progress {
@ -45,22 +48,24 @@
// Microsoft
&::-ms-track {
@include plyr-range-track();
@include plyr-range-track;
color: transparent;
}
&::-ms-fill-upper {
@include plyr-range-track();
@include plyr-range-track;
}
&::-ms-fill-lower {
@include plyr-range-track();
@include plyr-range-track;
background: currentColor;
}
&::-ms-thumb {
@include plyr-range-thumb();
@include plyr-range-thumb;
// For some reason, Edge uses the -webkit margin above
margin-top: 0;
}
@ -70,25 +75,25 @@
}
// Focus styles
&:focus {
outline: 0;
}
&::-moz-focus-outer {
border: 0;
}
&:focus {
outline: 0;
}
&.plyr__tab-focus {
&::-webkit-slider-runnable-track {
@include plyr-tab-focus();
@include plyr-tab-focus;
}
&::-moz-range-track {
@include plyr-tab-focus();
@include plyr-tab-focus;
}
&::-ms-track {
@include plyr-tab-focus();
@include plyr-tab-focus;
}
}
}

View File

@ -1,3 +1,4 @@
/* stylelint-disable selector-max-compound-selectors */
// --------------------------------------------------------------
// Tooltips
// --------------------------------------------------------------

View File

@ -1,5 +1,8 @@
// Downloaded from https://github.com/malyw/css-vars (and modified)
@use 'sass:list';
@use 'sass:map';
// global map to be filled via variables
$css-vars: ();
@ -21,36 +24,35 @@ $css-vars-use-native: false !default;
///
// Emulates var() CSS native function behavior
//
// $args[0] {String} "--" + variable name
// [$args[1]] Optional default value if variable is not assigned yet
//
// E.G.:
// color: var(--main-color);
// background: var(--main-background, green);
///
@function var($args...) {
// CHECK PARAMS
@if (length($args) ==0) {
@if length($args) == 0 {
@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 '--'";
}
// PROCESS
$var-name: nth($args, 1);
$var-value: map-get($css-vars, $var-name);
$var-name: list.nth($args, 1);
$var-value: map.get($css-vars, $var-name);
@if ($css-vars-use-native) {
@if $css-vars-use-native {
// CSS variables
// Native CSS: don't process function in case of native
@return unquote('var(' + $args + ')');
} @else {
@if ($var-value == null) {
@if not $var-value {
// variable is not provided so far
@if (length($args) == 2) {
$var-value: nth($args, 2);
@if length($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.:
// @include css-vars((
// --color: rebeccapurple,
@ -70,20 +72,21 @@ $css-vars-use-native: false !default;
///
@mixin css-vars($var-map: null) {
// CHECK PARAMS
@if ($var-map == null) {
@if not $var-map {
@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)}';
}
// PROCESS
@if ($css-vars-use-native) {
@if $css-vars-use-native {
// CSS variables
// Native CSS: assign CSS custom properties to the global scope
@at-root :root {
@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
} @else {
#{$var-name}: #{$var-value};

View File

@ -5,10 +5,8 @@
// Nicer focus styles
// ---------------------------------------
@mixin plyr-tab-focus($color: $plyr-tab-focus-color) {
outline-color: $color;
outline: $color dotted 3px;
outline-offset: 2px;
outline-style: dotted;
outline-width: 3px;
}
// Font smoothing

View File

@ -47,10 +47,10 @@
display: block;
height: $plyr-range-track-height;
left: 0;
margin: -($plyr-range-track-height / 2) 0 0;
opacity: 0.8;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 3px;
z-index: 3; // Between progress and thumb
}

View File

@ -4,15 +4,14 @@
// TODO: Review use of BEM classnames
// ==========================================================================
@charset 'UTF-8';
@import 'lib/css-vars';
$css-vars-use-native: true;
@import 'settings/breakpoints';
@import 'settings/colors';
@import 'settings/cosmetics';
@import 'settings/type';
@import 'settings/badges';
@import 'settings/captions';
@import 'settings/controls';
@ -21,13 +20,11 @@ $css-vars-use-native: true;
@import 'settings/progress';
@import 'settings/sliders';
@import 'settings/tooltips';
@import 'settings/markers';
@import 'lib/animation';
@import 'lib/functions';
@import 'lib/mixins';
@import 'base';
@import 'components/badges';
@import 'components/captions';
@import 'components/control';
@ -39,14 +36,11 @@ $css-vars-use-native: true;
@import 'components/tooltips';
@import 'components/progress';
@import 'components/volume';
@import 'components/markers';
@import 'types/audio';
@import 'types/video';
@import 'states/fullscreen';
@import 'plugins/ads';
@import 'plugins/preview-thumbnails/index';
@import 'utils/animation';
@import 'utils/hidden';

View File

@ -4,7 +4,6 @@
$plyr-captions-background: var(--plyr-captions-background, rgba(#000, 0.8)) !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-small: $plyr-font-size-small !default;
$plyr-font-size-captions-medium: $plyr-font-size-large !default;

View File

@ -2,17 +2,17 @@
// Colors
// ==========================================================================
$plyr-color-main: var(--plyr-color-main, hsl(198, 100%, 50%)) !default;
$plyr-video-background: var(--plyr-video-background, rgba(0,0,0,1)) !default;
$plyr-color-main: var(--plyr-color-main, hsl(198deg 100% 50%)) !default;
$plyr-video-background: var(--plyr-video-background, rgb(0 0 0 / 100%)) !default;
// Grayscale
$plyr-color-gray-900: hsl(216, 15%, 16%) !default;
$plyr-color-gray-800: hsl(216, 15%, 25%) !default;
$plyr-color-gray-700: hsl(216, 15%, 34%) !default;
$plyr-color-gray-600: hsl(216, 15%, 43%) !default;
$plyr-color-gray-500: hsl(216, 15%, 52%) !default;
$plyr-color-gray-400: hsl(216, 15%, 61%) !default;
$plyr-color-gray-300: hsl(216, 15%, 70%) !default;
$plyr-color-gray-200: hsl(216, 15%, 79%) !default;
$plyr-color-gray-100: hsl(216, 15%, 88%) !default;
$plyr-color-gray-50: hsl(216, 15%, 97%) !default;
$plyr-color-gray-900: hsl(216deg 15% 16%) !default;
$plyr-color-gray-800: hsl(216deg 15% 25%) !default;
$plyr-color-gray-700: hsl(216deg 15% 34%) !default;
$plyr-color-gray-600: hsl(216deg 15% 43%) !default;
$plyr-color-gray-500: hsl(216deg 15% 52%) !default;
$plyr-color-gray-400: hsl(216deg 15% 61%) !default;
$plyr-color-gray-300: hsl(216deg 15% 70%) !default;
$plyr-color-gray-200: hsl(216deg 15% 79%) !default;
$plyr-color-gray-100: hsl(216deg 15% 88%) !default;
$plyr-color-gray-50: hsl(216deg 15% 97%) !default;

View File

@ -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: var(--plyr-control-padding, $plyr-control-padding) !default;
$plyr-control-radius: var(--plyr-control-radius, 3px) !default;
$plyr-control-toggle-checked-background: var(
--plyr-control-toggle-checked-background,
var(--plyr-color-main, $plyr-color-main)
) !default;
$plyr-video-controls-background: var(
--plyr-video-controls-background,
linear-gradient(rgba(#000, 0), rgba(#000, 0.75))
@ -23,7 +21,6 @@ $plyr-video-control-background-hover: var(
--plyr-video-control-background-hover,
var(--plyr-color-main, $plyr-color-main)
) !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-hover: var(--plyr-audio-control-color-hover, #fff) !default;

View 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;

View File

@ -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-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-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-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;

View File

@ -29,7 +29,6 @@ $plyr-video-range-thumb-active-shadow-color: var(
--plyr-audio-range-thumb-active-shadow-color,
rgba(#fff, 0.5)
) !default;
$plyr-audio-range-track-background: var(
--plyr-audio-range-track-background,
$plyr-audio-progress-buffered-background

View File

@ -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-large: var(--plyr-font-size-large, 18px) !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-menu: var(--plyr-font-size-menu, $plyr-font-size-small) !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-bold: var(--plyr-font-weight-bold, 600) !default;
$plyr-line-height: var(--plyr-line-height, 1.7) !default;
$plyr-font-smoothing: var(--plyr-font-smoothing, false) !default;

View File

@ -3,27 +3,13 @@
// --------------------------------------------------------------
.plyr:fullscreen {
@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();
@include plyr-fullscreen-active;
}
// Fallback for unsupported browsers
.plyr--fullscreen-fallback {
@include plyr-fullscreen-active();
@include plyr-fullscreen-active;
bottom: 0;
display: block;
left: 0;

View File

@ -51,6 +51,7 @@ $embed-padding: (math.div(100, 16) * 9);
.plyr--full-ui .plyr__video-embed > .plyr__video-embed__container {
$height: 240;
$offset: to-percentage(math.div($height - $embed-padding, math.div($height, 50)));
padding-bottom: to-percentage($height);
position: relative;
transform: translateY(-$offset);

3666
yarn.lock

File diff suppressed because it is too large Load Diff