From 00ba9bed4f1c33bb2f0b0bd5d38d6fdbce7ded21 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sun, 8 May 2022 08:49:41 -0700 Subject: [PATCH] Minor codereview fixes. --- README.md | 2 +- src/components/embla-plugins/automedia.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 573c6ff3..c2da62c6 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ live: | Option | Default | Overridable | Description | | - | - | - | - | | `preload` | `false` | :heavy_multiplication_x: | Whether or not to preload the live view. Preloading causes the live view to render in the background regardless of what view is actually shown, so it's instantly available when requested. This consumes additional network/CPU resources continually. | -| `auto_play` | `all` | :heavy_multiplication_x: | Whether to automatically play live camera feeds. `never` will never automatically play, `selected` will automatically play when a camera is selected in the carousel, `visible` will automatically play when the browser/tab becomes visible or `all` on any opportunity to automatically play (i.e. either case). Some live live providers (e.g. `webrtc-card`, `jsmpeg`) do not support the prevention of automatic play on initial load, but should still respect the value of this flag on play-after-pause.| +| `auto_play` | `all` | :heavy_multiplication_x: | Whether to automatically play live camera feeds. `never` will never automatically play, `selected` will automatically play when a camera is selected in the carousel, `visible` will automatically play when the browser/tab becomes visible or `all` on any opportunity to automatically play (i.e. either case). Some live providers (e.g. `webrtc-card`, `jsmpeg`) do not support the prevention of automatic play on initial load, but should still respect the value of this flag on play-after-pause.| | `auto_pause` | `never` | :heavy_multiplication_x: | Whether to automatically pause live camera feeds. `never` will never automatically pause, `unselected` will automatically pause when a camera is unselected in the carousel, `hidden` will automatically pause when the browser/tab becomes hidden or `all` on any opportunity to automatically pause (i.e. either case). **Caution**: Some live providers (e.g. `jsmpeg`) may not offer human-accessible means to resume play if it is paused, unless the `auto_play` option (above) is used.| | `auto_mute` | `all` | :heavy_multiplication_x: | Whether to automatically mute live camera feeds. `never` will never automatically mute, `unselected` will automatically mute when a camera is unselected in the carousel, `hidden` will automatically mute when the browser/tab becomes hidden or `all` on any opportunity to automatically mute (i.e. either case).| | `auto_unmute` | `never` | :heavy_multiplication_x: | Whether to automatically unmute live camera feeds. `never` will never automatically unmute, `selected` will automatically unmute when a camera is unselected in the carousel, `visible` will automatically unmute when the browser/tab becomes visible or `all` on any opportunity to automatically unmute (i.e. either case).| diff --git a/src/components/embla-plugins/automedia.ts b/src/components/embla-plugins/automedia.ts index 37041eb3..5a19b6be 100644 --- a/src/components/embla-plugins/automedia.ts +++ b/src/components/embla-plugins/automedia.ts @@ -11,8 +11,9 @@ export type AutoMediaPluginOptionsType = { playerSelector: string; // Note: Neither play nor unmute will activate on selection. The caller is - // expected to call the methods manually when the media is actually loaded - // (not just the slide shown). + // expected to call the `play()` or `unmute()` methods manually when the media + // is actually loaded (and not just when the slide is visible -- the browser + // cannot play media that is not actually loaded yet, e.g. lazy loading). autoPlayCondition?: AutoPlayCondition; autoUnmuteCondition?: AutoUnmuteCondition; autoPauseCondition?: AutoPauseCondition;