Closed Bug 1480738 Opened 2 years ago Closed 2 years ago

Iframe with audio URL autoplays

Categories

(Core :: Audio/Video: Playback, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: evilpie, Assigned: alwu)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Attached file Test case
As I had assumed in bug 1477415, we need to make sure the audio/video document is _actually_ top-level before allowing it to autoplay. In the attach test case the audio plays automatically without a permission prompt.
Flags: needinfo?(alwu)
Ah, sorry, I didn't realize you're talking about this case. I'll fix it.
Thank you!
Assignee: nobody → alwu
Flags: needinfo?(alwu)
Comment on attachment 8997562 [details]
Bug 1480738 - part2 : add test.

https://reviewboard.mozilla.org/r/261262/#review268366


Code analysis found 2 defects in this patch:
 - 2 defects found by mozlint

You can run this analysis locally with:
 - `./mach lint path/to/file` (JS/Python/etc)


If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx


::: toolkit/content/tests/browser/browser_autoplay_videoDocument.js:23
(Diff revision 1)
>    });
>  }
>  
> +async function checkIsIframeVideoDocumentAutoplay(browser) {
> +  info("- create iframe video document -");
> +  await ContentTask.spawn(browser, PAGE, async(pageURL) => {

Error: Missing space before function parentheses. [eslint: space-before-function-paren]

::: toolkit/content/tests/browser/browser_autoplay_videoDocument.js:34
(Diff revision 1)
> +    });
> +    await iframeLoaded;
> +  });
> +
> +  info("- check whether iframe video document starts playing -");
> +  await ContentTask.spawn(browser, null, async() => {

Error: Missing space before function parentheses. [eslint: space-before-function-paren]
Priority: -- → P2
Comment on attachment 8997561 [details]
Bug 1480738 - part1 : only allow top-level video document to autoplay.

https://reviewboard.mozilla.org/r/261260/#review268402
Attachment #8997561 - Flags: review?(cpearce) → review+
Comment on attachment 8997562 [details]
Bug 1480738 - part2 : add test.

https://reviewboard.mozilla.org/r/261262/#review268404
Attachment #8997562 - Flags: review?(cpearce) → review+
Pushed by alwu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/23f078580a97
part1 : only allow top-level video document to autoplay. r=cpearce
https://hg.mozilla.org/integration/autoland/rev/8c52db0efc88
part2 : add test. r=cpearce
https://hg.mozilla.org/mozilla-central/rev/23f078580a97
https://hg.mozilla.org/mozilla-central/rev/8c52db0efc88
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.