diff --git a/.editorconfig b/.editorconfig index dd9beec5e..8c580cbaf 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,7 +4,7 @@ root = true [*] charset = utf-8 end_of_line = lf -indent_size = 4 +indent_size = 2 indent_style = space insert_final_newline = true trim_trailing_whitespace = true diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..de9818d89 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,18 @@ +{ + "parser": "babel-eslint", + "extends": ["@sampotts/eslint-config/es6"], + "env": { + "browser": true, + "es6": true + }, + "globals": { + "Plyr": false, + "jQuery": false + }, + "rules": { + "import/no-cycle": "warn" + }, + "parserOptions": { + "sourceType": "module" + } +} diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index ae86f34fd..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "parser": "babel-eslint", - "extends": ["airbnb-base", "prettier"], - "env": { - "browser": true, - "es6": true - }, - "globals": { - "Plyr": false, - "jQuery": false - }, - "rules": { - "import/no-cycle": 1, - "no-const-assign": 1, - "no-shadow": 0, - "no-this-before-super": 1, - "no-undef": 1, - "no-unreachable": 1, - "no-unused-vars": 1, - "constructor-super": 1, - "valid-typeof": 1, - "indent": [2, 4, { "SwitchCase": 1 }], - "quotes": [2, "single", "avoid-escape"], - "semi": [2, "always"], - "eqeqeq": [2, "always"], - "one-var": [2, "never"], - "comma-dangle": [2, "always-multiline"], - "spaced-comment": [2, "always"], - "no-restricted-globals": 2, - "no-param-reassign": [2, { "props": false }] - }, - "parserOptions": { - "sourceType": "module" - } -} diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 000000000..773c95870 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# These are supported funding model platforms + +github: sampotts +patreon: plyr +open_collective: plyr diff --git a/.github/issue_template.md b/.github/issue_template.md index 54f4550b4..44e1fcbf3 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,3 +1,3 @@ PLEASE USE OUR SPECIFIC ISSUE TEMPLATES for bug reports, features and improvement suggestions. -Our issue tracker is not for support questions. If you need help, follow our support instructions: https://github.com/sampotts/plyr/blob/master/contributing.md#support +Our issue tracker is not for support questions. If you need help, follow our support instructions: https://github.com/sampotts/plyr/blob/master/CONTRIBUTING.md#support diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f67d769f3..7efb45b8d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,8 +1,3 @@ ### Link to related issue (if applicable) ### Summary of proposed changes - -### Checklist -- [ ] Use `develop` as the base branch -- [ ] Exclude the gulp build (`/dist` changes) from the PR -- [ ] Test on [supported browsers](https://github.com/sampotts/plyr#browser-support) diff --git a/.gitignore b/.gitignore index 878292b0d..b68fc1b4b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,8 @@ node_modules .DS_Store credentials.json *.mp4 -!dist/blank.mp4 -index-*.html npm-debug.log yarn-error.log -package-lock.json *.webm .idea/ +dist/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..c4a670508 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,6 @@ +tasks: + - before: npm install && npm i gulp -g + command: gulp +ports: + - port: 3000 + onOpen: open-preview diff --git a/.node-version b/.node-version new file mode 100644 index 000000000..e669eb0b2 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +19.7.0 diff --git a/.npmignore b/.npmignore index 32ff635b9..4970b6549 100644 --- a/.npmignore +++ b/.npmignore @@ -2,10 +2,11 @@ demo .github .vscode *.code-workspace +build.json credentials.json -bundles.json +deploy.json yarn.lock package-lock.json -*.mp4 *.webm -!dist/blank.mp4 \ No newline at end of file +*.mp4 +!dist/blank.mp4 diff --git a/.prettierrc b/.prettierrc index cee783d43..ed2020047 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,7 +1,7 @@ { - "useTabs": false, - "tabWidth": 4, - "singleQuote": true, - "trailingComma": "all", - "printWidth": 120 + "useTabs": false, + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "all", + "printWidth": 120 } diff --git a/.stylelintrc.json b/.stylelintrc.json index 83175ed06..ff4f14af4 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -1,25 +1,23 @@ { - "plugins": ["stylelint-selector-bem-pattern", "stylelint-scss"], - "extends": ["stylelint-config-recommended", "stylelint-config-sass-guidelines", "stylelint-config-prettier"], - "rules": { - "selector-class-pattern": null, - "selector-no-qualifying-type": [ - true, - { - "ignore": ["attribute", "class"] - } - ], - "string-no-newline": null, - "indentation": 4, - "string-quotes": "single", - "max-nesting-depth": 2, - "plugin/selector-bem-pattern": { - "preset": "bem", - "componentName": "(([a-z0-9]+(?!-$)-?)+)", - "componentSelectors": { - "initial": "\\.{componentName}(((__|--)(([a-z0-9\\[\\]'=]+(?!-$)-?)+))+)?$" - }, - "ignoreSelectors": [".*\\.has-.*", ".*\\.is-.*"] - } + "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": [ + true, + { + "ignore": ["attribute", "class"] + } + ], + "max-nesting-depth": 4, + "plugin/selector-bem-pattern": { + "preset": "bem", + "componentName": "(([a-z0-9]+(?!-$)-?)+)", + "componentSelectors": { + "initial": "\\.{componentName}(((__|--)(([a-z0-9\\[\\]'=]+(?!-$)-?)+))+)?$" + }, + "ignoreSelectors": [".*\\.has-.*", ".*\\.is-.*"] } + } } diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3203fb951..000000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: lts/* - -script: -- bash .travis/prevent-base-master.sh -- bash .travis/omit-dist.sh -- npm run lint -- npm run build diff --git a/.travis/omit-dist.sh b/.travis/omit-dist.sh deleted file mode 100755 index f107a6b99..000000000 --- a/.travis/omit-dist.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [ $TRAVIS_BRANCH == "develop" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE "^(demo/)?dist/"); then - echo 'Build output ("dist" and "demo/dist") not permitted in develop' >&2 - exit 1 -fi diff --git a/.travis/prevent-base-master.sh b/.travis/prevent-base-master.sh deleted file mode 100755 index 54536a66f..000000000 --- a/.travis/prevent-base-master.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ $TRAVIS_BRANCH == "master" ] && $(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -q "^src/"); then - echo 'The base branch for pull requests must be "develop"' >&2 - exit 1 -fi diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 81d8ad2bb..5685abffc 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,11 +2,11 @@ // See http://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp "dbaeumer.vscode-eslint", - "wix.vscode-import-cost", "esbenp.prettier-vscode", - "shinnn.stylelint", - "wayou.vscode-todo-highlight" + "wayou.vscode-todo-highlight", + "wix.vscode-import-cost", + "stylelint.vscode-stylelint", + "pflannery.vscode-versionlens" ] } diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..6ee5f20d8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,1330 @@ +# Changelog + +### v3.7.8 + +- Feat: Minor demo style tweaks +- Fix: Minor style fixes related to backgrounds and border radii (π¨ Requires a SCSS/CSS update π¨) + +### v3.7.7 + +- Fix (Accessibility): Donβt set tabindex on parent container +- Fix (Accessibility): Add `role="timer"` to time elements +- Fix (Accessibility): Leverage native `:focus-visible` in CSS, instead of a custom solution (π¨ Requires a SCSS/CSS update π¨) + +### v3.7.6 + +- Fix: Revert postinstall script + +### v3.7.5 + +- Fix: Replace `pnpm` with `npm` in scripts to fix build issues + +### v3.7.4 + +- Fix: Fixed event key with space (thanks @royeden!) +- Fix: Changing Vimeo function call from `setVolume` to `setMuted` to fix iOS issue (issue #2624) (thanks @HandreMelo and Andre Fernandes Cristofolini Melo!) +- Fix: Call preview-thumbnails listeners() function on load (thanks @mogzol!) +- Fix: Fullscreen improvements for iOS & iPadOS +- Feat: Remove need for iOS-specific styling (please update [volume.scss](https://github.com/sampotts/plyr/blob/master/src/sass/components/volume.scss)) + +### v3.7.3 + +- Fix: force nowrap in progress tooltips (related: #2549) (thanks @raad-altaie!) +- Feat(i18n): Make captions autodetect text direction (#2540) (thanks @ebraminio!) +- Fix: fixed menu border radius bug (#2548) (thanks @raad-altaie!) +- Chore: navigator.platform is deprecated (#2530) (thanks @stamat!) +- Feat: Added configurable property to elements for re-use (#2489) (thanks @NoirHusky!) +- Docs: Replace example video ID with one that still works (#2518) (thanks @luvejo!) +- Fix: Improve accessibility on control buttons with aria-pressed (#2523) (thanks @emilkarl!) +- Fix: Fix for calc() in newer Dart Sass versions (#2519) (thanks @ckhicks!) +- Fix: simplify logic for isFunction assertion method +- Chore: update types to include string for controls +- Chore: upgrade packages +- Chore: use `.node-version` instead of `.nvmrc` + +### v3.7.2 + +- Fix: Add `@babel/plugin-proposal-optional-chaining` to transform optional chaining in build output + +### v3.7.1 + +- Feat: Minor styling improvements to the preview thumbnails (π¨ Requires a SCSS/CSS update π¨) +- Fix: Fix invalid CSS @charset rule in Sass files (thanks @Hashen110!) +- Chore: Replace deprecated KeyboardEvent `keyCode` references to use `key` instead (thanks @Hashen110!) +- Various other code clean up and typo fixes (thanks @Hashen110!) + +## v3.7.0 + +- Feat: Add markers support (π¨ Requires a SCSS/CSS update π¨) (thanks @ForeverSc and @fengshuo!) +- Feat: Add support for MediaMetadata (thanks @Hashen110!) +- Fix: Pass this context to captions.setup (fixes #2352) (thanks @WilliamMHerring, @willherring and @zenyr!) +- Fix: Modify vimeo parseHash to use non-named capture groups (fixes #2396) (thanks @fekle!) +- Fix: Replace deprecated String.prototype.substr() (thanks @CommanderRoot!) +- Docs: Update speed option default to match the source (thanks @ozgurg!) +- Docs: SASS β Sass (thanks @toastal!) + +### 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: 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) +- Enhance types (thanks @lunika) +- Fix: Object.values for the providers must be used (thanks @syteknet-core) +- Fix: Improve support inside iframes (thanks @ajgagnon) +- Added --plyr-video-background for having control over the background of a video with alpha channel (webm) or a poster image with alpha channel (thanks @nepomuc) +- Fix issue with not entering iosfullscreen of vimeo videos with playsinline=true (thanks @lordon and @Frosch) +- fix: use new syntax for iframe allow attribute +- chore: package updates +- chore: add @babel/plugin-proposal-class-properties +- fix: use bound arrow functions in classes + +### v3.6.3 + +- Fix volume when unmuting from volume 0 using YouTube (thanks @stephanefbouchard) +- Add missing unit to calc in media query (thanks @vincentorback) +- Assigning player's lastSeekTime on rewind/fast forward to prevent immediate controls hide on mobile (thanks @trafium) +- Fix for volume control overflowing in Firefox (thanks @dirkjf) +- Force fullscreen events to trigger on plyr element (media element in iOS) and not fullscreen container (thanks @theprojectsomething) +- TypeScript types improvements (thanks @akuma06 & @iwatakeshi) +- Dash demo link fixed (thanks @jonathanarbely) +- 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 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 + +- Fixes for CSS Custom Property related errors in some build tools (thanks @Bashev) +- Fixes for custom controls as element (thanks @taylorchu) +- Added missing TypeScript interface for preview thumbnail options (thanks @taylorchu) + +### v3.6.1 + +- Safari bug fix + +## v3.6.0 + +- You can now easily change colors using CSS Custom Properties. See the [README](README.md#customizing-the-css). +- Bug fix for Vimeo fullscreen. +- Various typos (thanks @likev) +- Preload TextTracks as per default video element (thanks @theprojectsomething) +- Features/fullscreen container (thanks @theprojectsomething) +- Ignore internal play promises (thanks @ydylla) +- Ads plugin fixes to allow multiple VAST requests (thanks @Steejo) +- Fix shadowroot (thanks @jnoordsij) +- Add financial contributors for Open Collective (thanks @monkeywithacupcake) +- Update the gitpod setup description to be more precise. (thanks @nisarhassan12) +- Completely hide SVG icons to screen readers (thanks @LeBenLeBen) +- Preview thumbnails via src:callback() (thanks @doublex) +- Add missing Typescripts types and options (thanks @hug963) +- Use number instead of string in TS quality definitions (thanks @mogzol) +- Fix Vimeo playback rate (thanks @hug963) +- Fix issue when controls config is string or element (thanks @CzBiX) +- Simplify contributions by fully automating the dev setup with gitpod (thanks @nisarhassan12) + +### v3.5.10 + +- iOS volume display fix + +### v3.5.9 + +- Fix for regression with volume control width +- Ensure poster image is not downloaded again for HTML5 videos + +### v3.5.8 + +- Added `flex-direction` property to fix some issues introduced in v3.5.7 when using custom CSS +- 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) +- Add previewThumbnails source setter (thanks @ydylla) +- More speed setting logic improvements + +### v3.5.7 + +- Typescript typings (thanks @ondratra) +- `togglePlay` now also returns a `Promise` (thanks @azizhk) +- Documentation improvements and typo fixes (thanks @ffpetrovic, @skerbis, @ayunami2000, @pjbaert, @MaxGiting, @0xflotus and @thatrobotdev) +- Accessibility tweak for the play button (thanks @lunika) +- Fix for ads configuration (thanks @SoftCreatR) +- Fix handling listener return value (thanks @taion) +- 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) +- Change vimeo demo video (thanks @thatrobotdev) +- Fix for `Uncaught RangeError: Maximum call stack size exceeded` (thanks @laukstein) +- Improve fullscreen experience on some devices (thanks @savroff) +- Improvements to buffering state for embedded players (thanks @doostinharrell) +- Prevents IE11 with resetOnEnd option set to true to play video again (thanks @Felipe K. De Boni) +- Fix for multiple poster image downloads (use the native poster only for HTML5 videos) +- Various presentational fixes +- Removed logic to hide/show volume controls based on audio track detection due to it's problematic nature. If you want to hide volume control, use the `controls` option to do so. +- Fix preview thumbnail scrubbing not working on mobile touch devices (thanks @ydylla) +- Add download attribute to download button (thanks @Code1110) +- Trap keyboard focus only when fullscreen (thanks @k-jensen) +- Improvements to speed options - you can now specify all options in the UI (YouTube and Vimeo only accept 0.5-2) (thanks @ydylla) +- Improve/fix quality change state restoring (thanks @ydylla) + +_Note:_ This update contains CSS changes. + +### v3.5.6 + +- Another Edge fix (thanks Nick Hawk via Slack) + +### v3.5.5 + +- YouTube fix for when there are other embeds on the page (thanks @aFarkas) +- Separated demo dependencies into their own package.json +- Fix for Edge controls flexbox issue when resizing the player (thanks Nick Hawk via Slack) +- More aspect ratio fixes + +### 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 +- Fixed issue with empty controls and preview thumbs +- Fixed issue with setGutter call (from Sentry) +- Fixed issue with initial selected speed not working +- Added notes on `autoplay` config option and browser compatibility +- Fixed issue with ads volume not matching current content volume +- Fixed race condition where ads were loading during source change +- Improvement: Automatic aspect ratio for YouTube is now supported, meaning all aspect ratios are set based on media content - Note: we're now using a different API to get YouTube video metadata so you may need to adjust any CSPs you have setup +- Fix for menu in the Shadow DOM (thanks @emielbeinema) + +### v3.5.3 + +- Improved the usage of the `ratio` config option; it now works as expected and for all video types. The default has not changed, it is to dynamically, where possible (except YouTube where 16:9 is used) determine the ratio from the media source so this is not a breaking change. +- Added new `ratio` getter and setter +- Fix: Properly clear all timeouts on destroy +- Fix: Allow absolute paths in preview thumbnails +- Improvement: Allow optional hours and ms in VTT parser in preview thumbnails + +### v3.5.2 + +- Fixed issue where the preview thumbnail was present while scrubbing + +### v3.5.1 + +- Fixed build issues with babel and browserslist + +## v3.5.0 + +- Preview seek/scrubbing thumbnails (thanks @jamesoflol) +- Fixes for proxy listeners (thanks @gurupras) +- Fix for buffer progress transition on WebKit (thanks @samuelgozi) +- Fix for error when mime type not specified (fixes #1274) +- Support YouTube noCookie (thanks Omar Khatib) +- Add Angular plugin reference (thanks @smnbbrv) +- Use `Math.trunc` instead of `parseInt` (thanks @taion) +- Many fixes for fullscreen in embedded players with non 16:9 screens or videos +- Added 'force' fallback option for fullscreen +- [RangeTouch](https://rangetouch.com) is now bundled with Plyr as a dependency to fix the scrubber on touch devices + +### v3.4.8 + +- Calling customized controls function with proper arguments (thanks @a60814billy) + +### v3.4.7 + +- Fix for Vimeo fullscreen with non native aspect ratios (fixes #854) + +### v3.4.6 + +- Added picture-in-picture support for Chrome 70+ +- Fixed issue with versioning the SVG sprite in the gulp build script + +### v3.4.5 + +- Added download button option to download either current source or a custom URL you specify in options +- Prevent immediate hiding of controls on mobile (thanks @jamesoflol) +- Don't hide controls on focusout event (fixes #1122) (thanks @jamesoflol) +- Fix HTML5 quality settings being incorrectly set in local storage (thanks @TechGuard) + +### v3.4.4 + +- Fixed issue with double binding for `click` and `touchstart` for `clickToPlay` option +- Improved "faux" fullscreen on iPhone X/XS phones with notch +- Babel 7 upgrade (which reduced the polyfilled build by ~10kb!) + +### v3.4.3 + +- Fixed issue with nodeList for custom playback controls + +### v3.4.2 + +- Fix play/pause button state + +### v3.4.1 + +- Bug fix for custom controls (fixes #1161) + +## v3.4.0 + +- Accessibility improvements (see #905) +- Improvements to the way the controls work on iOS +- Demo code clean up +- YouTube quality selection removed due to their poor support for it. As a result, the `qualityrequested` event has been removed +- Controls spacing improvements +- Fix for pressed property missing with custom controls (Fixes #1062) +- Fix #1153: Captions language fallback (thanks @friday) +- Fix for setting pressed property of undefined (Fixes #1102) + +### v3.3.23 + +- Add support for YouTube's hl param (thanks @renaudleo) +- Fix for captions positioning when no controls (thanks @friday and @mjfwebb) +- Fix #1108: Make sure youtube.onReady doesn't run twice (thanks @friday) +- Fix for WebKit repaint loop on the `` elements + +### v3.3.22 + +- Travis & CI improvements (thanks @friday) +- Add navigator.languages fallback for iOS 9 (thanks @friday) + +### v3.3.21 + +- Hide currentTime and progress for streams (thanks @mimse) +- Fixed condition check (thanks @mimse) +- Handle undefined this.player.elements.buttons.play (thanks @klassicd) +- Fix captions.toggle() if there is no toggle button (thanks @friday) + +### v3.3.20 + +- Fix for bug where controls wouldn't show on hover over YouTube video + +### v3.3.19 + +- Remove `pointer-events: none` on embed `
` tag and then in your JS create a new instance of Plyr as below. + +```html + + +``` + +See [initialising](#initializing) for more information on advanced setups. + +You can use our CDN (provided by [Cloudflare](https://www.cloudflare.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 + +``` + +...or... + +```html + +``` + +## CSS + +Include the `plyr.css` stylesheet into your `
`.
+
+```html
+
+```
+
+If you want to use our CDN (provided by [Cloudflare](https://www.cloudflare.com/)) for the default CSS, you can use the following:
+
+```html
+
+```
+
+## SVG Sprite
+
+The SVG sprite is loaded automatically from our CDN (provided by [Cloudflare](https://www.cloudflare.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.7.8/plyr.svg`.
+
+### Self hosting
+
+If you don't want to create a build system to include Plyr as an npm module, you can use the pre-built files. You have a few options:
+
+- Download the files from the CDN links above, they're already minified.
+- Download the files from [unpkg](https://unpkg.com/browse/plyr/dist/) or similar services.
+- Build the project yourself using `npm i && npm run build`, which installs the dependencies and spits out a build to `dist`.
+
+# Ads
+
+Plyr has partnered up with [vi.ai](https://vi.ai/publisher-video-monetization/?aid=plyrio) to offer monetization options for your videos. Getting setup is easy:
+
+- [Sign up for a vi.ai account](https://vi.ai/publisher-video-monetization/?aid=plyrio)
+- Grab your publisher ID from the code snippet
+- Enable ads in the [config options](#options) and enter your publisher ID
+
+Any questions regarding the ads can be sent straight to vi.ai and any issues with rendering raised through GitHub issues.
+
+If you do not wish to use Vi, you can set your own `ads.tagUrl` [option](#options).
+
+# Advanced
+
+## Customizing the CSS
+
+If you want to change any design tokens used for the rendering of the player, you can do so using [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties).
+
+Here's a list of the properties and what they are used for:
+
+| Name | Description | Default / Fallback |
+| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- |
+| `--plyr-color-main` | The primary UI color. |  `#00b3ff` |
+| `--plyr-video-background` | The background color of video and poster wrappers for using alpha channel videos and poster images. | `rgba(0, 0, 0, 1)` |
+| `--plyr-focus-visible-color` | The color used for the focus styles when an element is `:focus-visible` (keyboard focused). | `--plyr-color-main` |
+| `--plyr-badge-background` | The background color for badges in the menu. |  `#4a5464` |
+| `--plyr-badge-text-color` | The text color for badges. |  `#ffffff` |
+| `--plyr-badge-border-radius` | The border radius used for badges. | `2px` |
+| `--plyr-captions-background` | The color for the background of captions. | `rgba(0, 0, 0, 0.8)` |
+| `--plyr-captions-text-color` | The color used for the captions text. |  `#ffffff` |
+| `--plyr-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` |
+| `--plyr-video-control-color-hover` | The text/icon color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
+| `--plyr-video-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
+| `--plyr-audio-controls-background` | The background for the audio controls. |  `#ffffff` |
+| `--plyr-audio-control-color` | The text/icon color for audio controls. |  `#4a5464` |
+| `--plyr-audio-control-color-hover` | The text/icon color used when audio controls are `:hover`, `:focus` and `:focus-visible` (equivalent). |  `#ffffff` |
+| `--plyr-audio-control-background-hover` | The background color used when video controls are `:hover`, `:focus` and `:focus-visible` (equivalent). | `--plyr-color-main` |
+| `--plyr-menu-background` | The background color for menus. | `rgba(255, 255, 255, 0.9)` |
+| `--plyr-menu-color` | The text/icon color for menu items. |  `#4a5464` |
+| `--plyr-menu-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` |
+| `--plyr-menu-item-arrow-size` | The size of the arrows in the menu. | `4px` |
+| `--plyr-menu-border-color` | The border color for the bottom of the back button in the top of the sub menu pages. |  `#dcdfe5` |
+| `--plyr-menu-border-shadow-color` | The shadow below the border of the back button in the top of the sub menu pages. |  `#ffffff` |
+| `--plyr-progress-loading-size` | The size of the stripes in the loading state in the scrubber. | `25px` |
+| `--plyr-progress-loading-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` |
+| `--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` |
+| `--plyr-range-fill-background` | The fill color of the scrubber/progress. | `--plyr-color-main` |
+| `--plyr-video-range-track-background` | The background of the scrubber/progress. | `--plyr-video-progress-buffered-background` |
+| `--plyr-video-range-thumb-active-shadow-color` | The color of the shadow when the video scrubber handle/thumb is `:active` (pressed). | `rgba(255, 255, 255, 0.5)` |
+| `--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` |
+| `--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` |
+| `--plyr-tooltip-shadow` | The shadow on tooltips. | `0 1px 2px rgba(0, 0, 0, 0.15)` |
+| `--plyr-font-family` | The font family used in the player. | |
+| `--plyr-font-size-base` | The base font size. Mainly used for captions. | `15px` |
+| `--plyr-font-size-small` | The smaller font size. Mainly used for captions. | `13px` |
+| `--plyr-font-size-large` | The larger font size. Mainly used for captions. | `18px` |
+| `--plyr-font-size-xlarge` | The even larger font size. Mainly used for captions. | `21px` |
+| `--plyr-font-size-time` | The font size for the time. | `--plyr-font-size-small` |
+| `--plyr-font-size-menu` | The font size used in the menu. | `--plyr-font-size-small` |
+| `--plyr-font-size-badge` | The font size used for badges. | `9px` |
+| `--plyr-font-weight-regular` | The regular font weight. | `400` |
+| `--plyr-font-weight-bold` | The bold font weight. | `600` |
+| `--plyr-line-height` | The line height used within the player. | `1.7` |
+| `--plyr-font-smoothing` | Whether to enable font antialiasing within the player. | `false` |
+
+You can set them in your CSS for all players:
+
+```css
+:root {
+ --plyr-color-main: #1ac266;
+}
+```
+
+...or for a specific class name:
+
+```css
+.player {
+ --plyr-color-main: #1ac266;
+}
+```
+
+...or in your HTML:
+
+```html
+
+```
+
+### 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
+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
+you write. Check out the JavaScript source for more on this.
+
+## SVG
+
+The icons used in the Plyr controls are loaded in an SVG sprite. The sprite is automatically loaded from our CDN by default. If you already have an icon build
+system in place, you can include the source plyr icons (see `/src/sprite` for source icons).
+
+### Using the `iconUrl` option
+
+You can however specify your own `iconUrl` option and Plyr will determine if the url is absolute and requires loading by AJAX/CORS due to current browser
+limitations or if it's a relative path, just use the path directly.
+
+If you're using the `