-
Notifications
You must be signed in to change notification settings - Fork 974
Notify users when autoplay has been blocked and provide option to allow it #8751
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks really good, one question I have though is regarding the wording used in the notification:
"Media autoplay on has been blocked. Do you want to allow it?"
Contrast that with requests for full screen, location, or media capture:
"Allow to use fullscreen mode?"
"Allow to see your location?"
"Allow to use your camera and/or mic?"
I think we should adopt the same pattern:
"Allow to autoplay media?"
fixed in b8fc59c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing on YT, video kept loading until I decided what to do with notification. Deciding to disable autoplay, loading persists and pause button is shown rather than play button. Seems like video is not fully loaded and I had to click twice on the pause button to get it working. I felt confused by that.
Regarding UX the best scenario I can think of is having video stopped (play indicator visible) with video placeholder showing instead of forever loading until user decide what to do with notification.
Those are just my thoughts and my guess is that the above is beyond the scope of this PR and it's a great thing to have as-is, so LGTM
…ow it Display "Block autoplay" in bravey shield Fix #8738 Auditors: @bbondy, @bsclifton, @jonathansampson Test Plan: Covered by automatic test
ok, done |
*/ | ||
autoplayBlocked: function (location, tabId) { | ||
AppDispatcher.dispatch({ | ||
actionType: appConstants.APP_AUTOPLAY_BLOCKED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not blocking merging, but why is location needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is for displaying origin for message box
https://github.com/brave/browser-laptop/pull/8751/files#diff-d4f09c262fdb2f86d8f7407afb926c8eR19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just mean that the browser process already has this info so it is not needed to send from the window renderer. Pls do for a follow up but not high priority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically it just leaves the chance that someone will use the API wrongly at some point, so better not to include it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments left; changes look good 😄
if (tabId) { | ||
const tab = webContents.fromTabID(tabId) | ||
if (tab && !tab.isDestroyed()) { | ||
return tab.reload() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is being returned here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do a follow-up along with
Line 83 in b2618c9
return tab.reload() |
autoplay: { | ||
enabled: false | ||
noAutoplay: { | ||
enabled: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per our discussions, we want to default this to false, right? So that content isn't blocked
cc: @bradleyrichter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the default is false, the notification won't popup in most of the cases because https://github.com/brave/browser-laptop/pull/8751/files#diff-d4f09c262fdb2f86d8f7407afb926c8eR21
The only case it will show up is users toggle global autoplay to block and without site setting of autoplay to the website
The setting is similar to our default fullscreen
setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the understanding we were defaulting to on with notification bar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake- I think I missed part of the convo 😄 ++
Auditors: @bbondy, @bsclifton
Auditors: @bbondy, @bsclifton
Auditors: @bbondy, @bsclifton
Display "Block autoplay" in bravey shield
Fix #8738
Address #8739
Auditors: @bbondy, @bsclifton, @jonathansampson
Test Plan:
Covered by automatic test
git rebase -i
to squash commits (if needed).