lbry-desktop/ui
infinite-persistence 2dac41e5e5
Mute video when autoplay is blocked by browser policy (#6087)
## Issue
When opening a video directly in Chrome Incognito, the video should autoplay (since that's the default Lbry setting), but it doesn't due to browser policy
https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

## Changes
- We don't want to forcefully mute the video when `autoplay=true`; we just want to do it when the browser policy is applied.
- Fortunately, there is already an existing code-block for us to check that.

## Test cases
- [x] "Autoplay=Off" should not be affected.
- [x] After manually unmuting, the next autoplayed video should not be muted (this is "user interacted" opening, so the policy allows autoplay)
- [x] If manually muting, the next autoplayed video should retain user's last setting.

## Known issues
- I've seen `error` occasionally being undefined in the `catch` block. In those cases, the solution doesn't work. We could remove `if (player.autoplay() && !player.muted())` and simply just try muting it, but for now it's better to ensure `NotAllowedError` is due to unmuted first before applying the fix.
- This doesn't work for Firefox as there is an explicit "Allow Autoplay" button in the address bar that user needs to click themselves. Applies to all sites.
2021-05-19 11:56:54 -04:00
..
component Mute video when autoplay is blocked by browser policy (#6087) 2021-05-19 11:56:54 -04:00
constants Notification: handle "creator_comment" (#6069) 2021-05-14 10:59:36 -04:00
effects Fix blank gif avatars (#6060) 2021-05-14 11:00:07 -04:00
modal Continuation of "Add release date field #5514" (#6049) 2021-05-15 00:10:28 -04:00
page ChannelThumbnail fixes (#6075) 2021-05-17 15:51:21 -04:00
redux fetch notofication/categories for notification types dropdown 2021-04-30 12:45:46 -04:00
scss Continuation of "Add release date field #5514" (#6049) 2021-05-15 00:10:28 -04:00
util improve logic for own comments showing first (#6073) 2021-05-17 15:55:23 -04:00
analytics.js integrate some Odysee code with master 2021-04-27 19:56:30 -04:00
app.js refactor lbrytv web server 2019-11-11 13:27:29 -05:00
comments.js hyperchats 2021-04-23 16:20:17 -04:00
i18n.js Revert "Simplify language lists" 2021-04-06 15:42:27 -04:00
index.jsx When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
logWarningConsoleMessage.js new lbc icon 2020-09-29 17:12:32 -04:00
native.js working 2020-12-16 10:52:22 -05:00
reducers.js use redux for livestream claim setup 2021-04-23 14:51:09 -04:00
rewards.js When a new reward is acquired, only close modals if the reward comes from reward_code 2021-01-08 08:16:41 -07:00
store.js CoinSwap: websocket + multi-coin 2021-04-13 14:02:25 -04:00