From e8d883edba3ee87ff5fbef043ffa50a1a4ae391b Mon Sep 17 00:00:00 2001 From: Sam Potts Date: Sat, 14 Nov 2020 13:24:11 +1100 Subject: v3.6.3 (#2016) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * force fullscreen events to trigger on plyr element (media element in iOS) and not fullscreen container * Fixing "missing code in detail" for PlyrEvent type When using typescript and listening for youtube statechange event, it is missing the code property definition inside the event (even though it is provided in the code). By making events a map of key-value, we can add easily custom event type for specific event name. Since YouTube "statechange" event differs from the basic PlyrEvent, I added a new Event Type "PlyrStateChangeEvent" having a code property corresponding to a YoutubeState enum defined by the YouTube API documentation. This pattern follows how addEventListener in the lib.dom.d.ts is defined. * Update link to working dash.js demo (was broken) * Fix PreviewThumbnailsOptions type According to the docs, the `src` should also accept an array of strings. * fix issue #1872 * Check if key is a string before attempt --plyr checking * Fix for Slow loading videos not autoplaying * Fix for Slow loading videos not autoplaying * Network requests are not cancelled after the player is destroyed * Fix for apect ratio problem when using Vimeo player on mobile devices (issue #1940) * chore: update packages and linting * Invoke custom listener on triggering fullscreen via double-click * Fix volume when unmuting from volume 0 * adding a nice Svelte plugin that I found * Add missing unit to calc in media query * Assigning player's lastSeekTime on rewind/fast forward to prevent immediate controls hide on mobile * Fix youtube not working when player is inside shadow dom * v3.6.2 * ESLint to use common config * add BitChute to users list * Fix aspect ratio issue * Revert noCookie change * feat: demo radius tweaks * fix: poster image shouldn’t receive click events * chore: package updates * chore: linting * feat: custom controls option for embedded players * Package upgrades * ESLint to use common config * Linting changes * Update README.md * chore: formatting * fix: revert pointer events change for poster * fix: hack for Safari 14 not repainting Vimeo embed on entering fullscreen * fix: demo using custom controls for YouTube * doc: Add STROLLÿN among the list of Plyr users * Fixes #2005 * fix: overflowing volume slider * chore: clean up CSS * fix: hide poster when not using custom controls * Package upgrades * ESLint to use common config * Linting changes * chore: revert customControls default option (to prevent breaking change) * docs: changelog for v3.6.3 Co-authored-by: Som Meaden Co-authored-by: akuma06 Co-authored-by: Jonathan Arbely Co-authored-by: Takeshi Co-authored-by: Hex Co-authored-by: Syed Husain Co-authored-by: Danielh112 Co-authored-by: Danil Stoyanov Co-authored-by: Guru Prasad Srinivasa Co-authored-by: Stephane Fortin Bouchard Co-authored-by: Zev Averbach Co-authored-by: Vincent Orback Co-authored-by: trafium Co-authored-by: xansen <27698939+xansen@users.noreply.github.com> Co-authored-by: zoomerdev <59863739+zoomerdev@users.noreply.github.com> Co-authored-by: Mikaël Castellani Co-authored-by: dirkjf --- src/js/ui.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/js/ui.js') diff --git a/src/js/ui.js b/src/js/ui.js index d3d6fd69..c8b19677 100644 --- a/src/js/ui.js +++ b/src/js/ui.js @@ -135,7 +135,7 @@ const ui = { } // If there's a play button, set label - Array.from(this.elements.buttons.play || []).forEach(button => { + Array.from(this.elements.buttons.play || []).forEach((button) => { button.setAttribute('aria-label', label); }); @@ -172,13 +172,16 @@ const ui = { // Set property synchronously to respect the call order this.media.setAttribute('data-poster', poster); + // Show the poster + this.elements.poster.removeAttribute('hidden'); + // Wait until ui is ready return ( ready .call(this) // Load image .then(() => loadImage(poster)) - .catch(err => { + .catch((err) => { // Hide poster on error unless it's been set by another call if (poster === this.poster) { ui.togglePoster.call(this, false); @@ -214,7 +217,7 @@ const ui = { toggleClass(this.elements.container, this.config.classNames.stopped, this.stopped); // Set state - Array.from(this.elements.buttons.play || []).forEach(target => { + Array.from(this.elements.buttons.play || []).forEach((target) => { Object.assign(target, { pressed: this.playing }); target.setAttribute('aria-label', i18n.get(this.playing ? 'pause' : 'play', this.config)); }); @@ -270,8 +273,8 @@ const ui = { // Loop through values (as they are the keys when the object is spread 🤔) Object.values({ ...this.media.style }) // We're only fussed about Plyr specific properties - .filter(key => !is.empty(key) && key.startsWith('--plyr')) - .forEach(key => { + .filter((key) => !is.empty(key) && is.string(key) && key.startsWith('--plyr')) + .forEach((key) => { // Set on the container this.elements.container.style.setProperty(key, this.media.style.getPropertyValue(key)); -- cgit v1.2.3