Compare commits

...

11 Commits

Author SHA1 Message Date
40395a1ff5 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
2021-12-16 23:03:29 +11:00
9ea3a6923d fix: use calc instead of list.slash 2021-12-16 22:59:44 +11:00
675a853e2e chore: SASS clean up 2021-12-16 22:59:25 +11:00
950786b117 chore: npm script syntax tweak 2021-12-16 22:58:58 +11:00
626e1dba64 docs: fix typos 2021-12-16 22:56:46 +11:00
cbd1596af4 chore: stylelint config changes 2021-12-16 22:56:31 +11:00
6ea510c36e chore: package upgrades 2021-12-16 22:56:13 +11:00
0acf228dcd v3.6.10
- Fix: Use `list.slash` instead of deprecated syntax
- Chore: Clean up demo
2021-12-16 20:51:31 +11:00
91b19baf44 fix: use list.slash instead of deprecated syntax 2021-12-16 20:29:36 +11:00
990d636019 chore: clean up demo 2021-12-16 20:29:36 +11:00
b9c792b377 Fix repeated "an" (#2371) 2021-11-28 22:51:21 +11:00
42 changed files with 2233 additions and 1922 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,3 +1,15 @@
### 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)
@ -61,7 +73,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 +118,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 +133,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)

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

@ -131,21 +131,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.11/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.11/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 +154,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.11/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.11/plyr.svg`.
# Ads
@ -267,9 +267,7 @@ 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
@ -344,7 +342,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 +398,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. |
@ -437,7 +435,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 +450,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 +465,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 +512,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 +635,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 +783,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) |

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

@ -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.11",
"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.11/plyr.svg',
// Blank video (used to prevent errors on source change)
blankVideo: 'https://cdn.plyr.io/static/blank.mp4',

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 {

View File

@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
// plyr.js v3.6.9
// plyr.js v3.6.11
// 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.11
// https://github.com/sampotts/plyr
// License: The MIT License (MIT)
// ==========================================================================

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

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

@ -2,6 +2,8 @@
// Advertisements
// ==========================================================================
@use 'sass:math';
.plyr__ads {
border-radius: inherit;
bottom: 0;
@ -47,7 +49,7 @@
display: block;
height: $plyr-range-track-height;
left: 0;
margin: -($plyr-range-track-height / 2) 0 0;
margin: -calc($plyr-range-track-height / 2) 0 0;
opacity: 0.8;
position: absolute;
top: 50%;

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,10 @@ $css-vars-use-native: true;
@import 'settings/progress';
@import 'settings/sliders';
@import 'settings/tooltips';
@import 'lib/animation';
@import 'lib/functions';
@import 'lib/mixins';
@import 'base';
@import 'components/badges';
@import 'components/captions';
@import 'components/control';
@ -39,14 +35,10 @@ $css-vars-use-native: true;
@import 'components/tooltips';
@import 'components/progress';
@import 'components/volume';
@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

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

3648
yarn.lock

File diff suppressed because it is too large Load Diff