Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New template: Hover/tap for sound #294

Open
alykat opened this issue Oct 11, 2018 · 0 comments
Open

New template: Hover/tap for sound #294

alykat opened this issue Oct 11, 2018 · 0 comments
Assignees

Comments

@alykat
Copy link
Member

alykat commented Oct 11, 2018

See: https://www.npr.org/2018/04/02/598287888/photos-why-they-marched-in-their-own-words

This should support:

  • Photo
  • Audiofile (MP3)
  • Photo credit
  • Caption (optional)
  • Caption placement (left, right, bottom) (optional)
  • Pullquote (optional)
  • Pullquote placement (left, right, bottom) (optional)

Important note: Chrome now suppresses autoplay video and audio if the user hasn't interacted with a page. This seems to affect our "hover for sound" embedded projects, like pigeon races. The error I see in console:

Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.

Passing the autoplay parameter to the iframe -- as mentioned here: https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#iframe -- doesn't universally fix this. (Supporting the param also will require an update to the npr pym loader and to pym.)

In the short term, I think "click-to-play" is the best way to go. Longer-term, there's probably some kind of detection to see if autoplay is supported and, if not, display a click message instead.

@alykat alykat self-assigned this Oct 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant