diff --git a/.nvmrc b/.nvmrc index 099e5351..b6a7d89c 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v12.8 +16 diff --git a/CHANGELOG.md b/CHANGELOG.md index fe0c61ee..5635915e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,41 @@ +### v3.6.9 + +- 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) +- Fix: iOS fullscreen centering (thanks @hemratna) +- Feat: Added getter and setter for preview thumbnails (thanks @Benny739) +- Fix: Change fullscreen element to player rootnode (thanks @Walter van den Houten) +- Fix: Fixed errors when Plyr instance is destroyed before constructor setTimeout() functions execute (thanks @emilis-ideait) +- Fix: Invalid CSS selector syntax (thanks @BjornBrandewallNaviga) +- Fix: Video height issues +- Feat: Improve support for Vimeo private videos (thanks @Frosch) +- Fix: YouTube duration issues (thanks @liesahead) + +### v3.6.8 + +- Typings: add FullscreenOptions.container to typing files (thanks @MeguminSama!) +- Fix: added iPadOS detection to isIos util (thanks @Benny739!) +- Fix: issues with Vimeo fullscreen + +### v3.6.7 + +- Fix: remove regression caused by optional chaining and nullish coalescing in check for `window.CSS` check for aspect-ratio (fixes #2174) + +### v3.6.6 + +- Improvements to how aspect ratio is handled. Use `aspect-ratio` CSS property instead of the legacy method (still used as fallback). Also automatically determined aspect ratios are rounded to the nearast standard ratio. This fixes issues with the YouTube embeds showing a 1-2px black bar. +- Hide the YouTube poster image container when paused so that the controls underneath can be used. + +### v3.6.5 + +- Migrate color formatting to colorette (thanks @jorgebucaran) +- Fix: issue with IE detection +- Fix: missing styles for embeds +- Fix: regression regarding poster image +- Add all required props to vimeo iframe allow attribute - fixes #2151 (thanks @didrip) + ### v3.6.4 - Remove unnecessary calc from media query (thanks @naomiaz) diff --git a/README.md b/README.md index dac62dd6..b31ed88d 100644 --- a/README.md +++ b/README.md @@ -134,13 +134,13 @@ 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. ```html - + ``` ...or... ```html - + ``` ## CSS @@ -154,13 +154,13 @@ Include the `plyr.css` stylsheet into your ``. If you want to use our CDN (provided by [Fastly](https://www.fastly.com/)) for the default CSS, you can use the following: ```html - + ``` ## 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.4/plyr.svg`. +reference, the CDN hosted SVG sprite can be found at `https://cdn.plyr.io/3.6.9/plyr.svg`. # Ads @@ -184,43 +184,43 @@ Here's a list of the properties and what they are used for: | Name | Description | Default / Fallback | | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `--plyr-color-main` | The primary UI color. | ![#f03c15](https://placehold.it/15/00b3ff/000000?text=+) `#00b3ff` | +| `--plyr-color-main` | The primary UI color. | ![#f03c15](https://place-hold.it/15/00b3ff/000000?text=+) `#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-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](https://placehold.it/15/4a5464/000000?text=+) `#4a5464` | -| `--plyr-badge-text-color` | The text color for badges. | ![#ffffff](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-badge-background` | The background color for badges in the menu. | ![#4a5464](https://place-hold.it/15/4a5464/000000?text=+) `#4a5464` | +| `--plyr-badge-text-color` | The text color for badges. | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#ffffff` | | `--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-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](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-captions-text-color` | The color used for the captions text. | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#ffffff` | | `--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-padding` | The padding inside controls. | `--plyr-control-spacing * 0.7` (`7px`) | | `--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-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](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | -| `--plyr-video-control-color-hover` | The text/icon color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | ![#ffffff](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-video-control-color` | The text/icon color for video controls. | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-video-control-color-hover` | The text/icon color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#ffffff` | | `--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](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | -| `--plyr-audio-control-color` | The text/icon color for audio controls. | ![#4a5464](https://placehold.it/15/4a5464/000000?text=+) `#4a5464` | -| `--plyr-audio-control-color-hover` | The text/icon color used when audio controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | ![#ffffff](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-audio-controls-background` | The background for the audio controls. | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-audio-control-color` | The text/icon color for audio controls. | ![#4a5464](https://place-hold.it/15/4a5464/000000?text=+) `#4a5464` | +| `--plyr-audio-control-color-hover` | The text/icon color used when audio controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#ffffff` | | `--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-color` | The text/icon color for menu items. | ![#4a5464](https://placehold.it/15/4a5464/000000?text=+) `#4a5464` | +| `--plyr-menu-color` | The text/icon color for menu items. | ![#4a5464](https://place-hold.it/15/4a5464/000000?text=+) `#4a5464` | | `--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-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](https://placehold.it/15/728197/000000?text=+) `#728197` | +| `--plyr-menu-item-arrow-color` | The color of the arrows in the menu. | ![#728197](https://place-hold.it/15/728197/000000?text=+) `#728197` | | `--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](https://placehold.it/15/dcdfe5/000000?text=+) `#dcdfe5` | -| `--plyr-menu-border-shadow-color` | The shadow below the border of the back button in the top of the sub menu pages. | ![#ffffff](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-menu-border-color` | The border color for the bottom of the back button in the top of the sub menu pages. | ![#dcdfe5](https://place-hold.it/15/dcdfe5/000000?text=+) `#dcdfe5` | +| `--plyr-menu-border-shadow-color` | The shadow below the border of the back button in the top of the sub menu pages. | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#ffffff` | | `--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-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-range-thumb-height` | The height of the scrubber handle/thumb. | `13px` | -| `--plyr-range-thumb-background` | The background of the scrubber handle/thumb. | ![#ffffff](https://placehold.it/15/ffffff/000000?text=+) `#ffffff` | +| `--plyr-range-thumb-background` | The background of the scrubber handle/thumb. | ![#ffffff](https://place-hold.it/15/ffffff/000000?text=+) `#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-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` | @@ -230,7 +230,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-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-color` | The text color for tooltips. | ![#4a5464](https://placehold.it/15/4a5464/000000?text=+) `#4a5464` | +| `--plyr-tooltip-color` | The text color for tooltips. | ![#4a5464](https://place-hold.it/15/4a5464/000000?text=+) `#4a5464` | | `--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-radius` | The border radius on tooltips. | `3px` | @@ -467,6 +467,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. | | `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. | @@ -513,6 +514,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 | | `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. | @@ -791,7 +793,7 @@ Some awesome folks have made plugins for CMSs and Components for JavaScript fram | 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) | | 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](https://github.com/benwoodward) | +| svelte-plyr | Ben Woodward / benwoodward ([@benwoodward](https://github.com/benwoodward)) | [https://github.com/benwoodward/svelte-plyr](https://github.com/benwoodward/svelte-plyr) | # Issues @@ -839,6 +841,7 @@ Plyr costs money to run, not only my time. I donate my time for free as I enjoy - [Rutheneum-Bote](https://gymnasium-rutheneum.de/content/newspaper/kreativwettbewerb.php) - [pressakey.com | Blog-Magazin für Videospiele](https://pressakey.com) - [STROLLÿN: Work with a View](https://strollyn.com) +- [CFDA Runway360](https://runway360.cfda.com/) If you want to be added to the list, open a pull request. It'd be awesome to see how you're using Plyr 😎 diff --git a/demo/src/sass/components/icons.scss b/demo/src/sass/components/icons.scss index 32e5f685..c40a14e5 100644 --- a/demo/src/sass/components/icons.scss +++ b/demo/src/sass/components/icons.scss @@ -2,6 +2,8 @@ // Icons // ========================================================================== +@use 'sass:math'; + // Base size icon styles .icon { fill: currentColor; @@ -19,5 +21,5 @@ label svg { a .icon, .btn .icon { - margin-right: ($spacing-base / 2); + margin-right: math.div($spacing-base, 4); } diff --git a/demo/src/sass/components/players.scss b/demo/src/sass/components/players.scss index 20422237..98cbaf17 100644 --- a/demo/src/sass/components/players.scss +++ b/demo/src/sass/components/players.scss @@ -2,6 +2,8 @@ // Examples // ========================================================================== +@use 'sass:math'; + // Example players .plyr { border-radius: $border-radius-large; @@ -31,6 +33,6 @@ color: $color-gray-500; .icon { - margin-right: ceil($spacing-base / 6); + margin-right: math.div($spacing-base, 6); } } diff --git a/demo/src/sass/layout/core.scss b/demo/src/sass/layout/core.scss index 3687b7d2..b613a9fc 100644 --- a/demo/src/sass/layout/core.scss +++ b/demo/src/sass/layout/core.scss @@ -2,6 +2,8 @@ // Core // ========================================================================== +@use 'sass:math'; + html, body { display: flex; @@ -46,7 +48,7 @@ aside { .icon { fill: $color-twitter; - margin-right: ($spacing-base / 2); + margin-right: math.div($spacing-base, 2); } p { diff --git a/demo/src/sass/lib/mixins.scss b/demo/src/sass/lib/mixins.scss index 2744bfb5..e21d77a1 100644 --- a/demo/src/sass/lib/mixins.scss +++ b/demo/src/sass/lib/mixins.scss @@ -2,6 +2,8 @@ // Mixins // ========================================================================== +@use 'sass:math'; + // Convert a