New issue
Advanced search Search tips

Issue 921680 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 17
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Autoplay policy breaks Chrome Remote Desktop use-case

Project Member Reported by jamiewa...@chromium.org, Jan 14

Issue description

Chrome Version: 71.0.3543.0
OS: All

What steps will reproduce the problem?
(1) Set up Chrome Remote Desktop on a Windows or Linux host computer.
(2) Connect to it and tell it to remember the PIN.
(3) Hit refresh (or save as a bookmark and visit it later).

What is the expected result?
The video should be rendered

What happens instead?
No video.

After talking with someone knowledgeable about autoplay, we were able to pin this down to Chrome's autoplay policy blocking the play() call because there has been no user interaction on the page, only with the omnibox or bookmarks bar. It doesn't affect all CRD users, only those who have bookmarked a host and configured it not to require a PIN, but it would be great if we could find a way to allow this use-case.
 
Cc: mlamouri@chromium.org
Can we imagine having the video muted with Chrome Remote Desktop? Is it even possible to get sound through?
We remote both video and audio, although in the case I tested there was no audio so it would have been silent (but not muted). In case it makes a difference, we use separate <video> and <audio> tags for the two streams.

I don't think we want to mute the audio in general, since many users want it and it would be awkward to have to reenable it every time.
Thanks for the suggestion. I was able to fix this by muting the video, and calling play() again on the audio tag after the user has interacted with the remote desktop. It's not ideal because I think users will be confused about why they get no sound when they first connect, but I think it's good enough that we can close this bug. I have a couple of questions:

* Will users eventually get audio autoplay once they've been using the site (and hearing audio from their host) a few times?
* What exactly counts as a user gesture for the purposes of autoplay? I currently have the retry hooked up to mouse clicks and key events; are they both considered evidence that the user is interacting with the site?

Comment 5 by mlamouri@chromium.org, Jan 16 (6 days ago)

* Will users eventually get audio autoplay once they've been using the site (and hearing audio from their host) a few times?

Yes. After a few visits, Chrome will learn that playback happens and allows autoplay with sound. You should be able to feature detect autoplay too.

* What exactly counts as a user gesture for the purposes of autoplay? I currently have the retry hooked up to mouse clicks and key events; are they both considered evidence that the user is interacting with the site?

We have some documentation about this here: https://developers.google.com/web/updates/2018/11/web-audio-autoplay#moving-forward

The snippet is for Web Audio but the logic is the same.

Comment 6 by jamiewa...@chromium.org, Jan 16 (6 days ago)

> You should be able to feature detect autoplay too.

I'm not sure what you mean by this. Right now we just detect a Promise rejection from <audio>.play() and retry after a user gesture in this situation. Would feature detection give us any advantage over that?

Comment 7 by mlamouri@chromium.org, Jan 17 (5 days ago)

What you are doing is some sort of feature detection already as you try to play anyways. You could create a fake audio element to test earlier but I'm not sure if in your case it would be of any help. You may want to show some UI to express that the feed is muted and allow users to "unmute" but that's not really related to the API :)

Let me know if there is anything else we can do to help.

Comment 8 by jamiewa...@chromium.org, Jan 17 (5 days ago)

Status: WontFix (was: Untriaged)
Thanks, I think this solution is good enough for us.

Sign in to add a comment