Skip to content

Commit

Permalink
Enable autoplay permission for content frame
Browse files Browse the repository at this point in the history
This enables the Play button in Via's video player to work, in Chrome, before
the user has interacted with the YouTube iframe. See
https://developer.chrome.com/blog/autoplay/#iframe-delegation.

Fixes hypothesis/via#1136
  • Loading branch information
robertknight committed Aug 1, 2023
1 parent 6156a4c commit 561b809
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lms/static/scripts/frontend_apps/components/ContentFrame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ export default function ContentFrame({ url, iframeRef }: ContentFrameProps) {
return (
<iframe
ref={iframeRef}
allow="clipboard-write; fullscreen"
// Enable permissions required by Via's video player (and other content
// too).
//
// "autoplay" - Enables Play button to work without first clicking on video
// "clipboard-write" - Used by "Copy transcript" button
// "fullscreen" - Enables full-screen button in player
allow="autoplay; clipboard-write; fullscreen"
className={classnames(
// It's important that this content render full width and grow to fill
// available flex space. n.b. It may be rendered together with grading
Expand Down

0 comments on commit 561b809

Please sign in to comment.