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
🏗✨ Basic implementation of VideoInterface for <amp-vimeo> #15326
Conversation
iframe.src = 'https://player.vimeo.com/video/' + encodeURIComponent( | ||
videoid); | ||
const iframe = | ||
htmlFor(element)`<iframe frameborder=0 alllowfullscreen></iframe>`; |
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.
allowfullscreen is misspelled.
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.
Whoops, thanks!
const {element} = this; | ||
|
||
const eventToDispatch = VIMEO_EVENTS[data['event']]; | ||
if (eventToDispatch) { |
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.
Is it worth rechecking that the event is in VIMEO_EVENTS
or is it guaranteed they wont sent events that addEventListener
message hasn't been sent for?
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.
The frame won't send events that you don't listen for.
/** @override */ | ||
preimplementsMediaSessionAPI() { | ||
// TODO(alanorozco): dis tru? | ||
return false; |
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. just checked, they hook into media session API themselves.
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.
Fixed. Forgot I left that comment 😛
|
||
/** @override */ | ||
mute() { | ||
this.sendCommand_(this.setVolumeMethod_(), '0'); |
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.
huh, can you test autoplay on iOS? I hope behind the scene they set muted
attribute if volume = 0, otherwise I expect autoplay to be broken on iOS since they don't allow changing volume and only autoplay if muted
attribute is there.
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 didn't, but now it works! We can just muted=1
on the query params.
|
||
let src = `https://player.vimeo.com/video/${encodeURIComponent(vidId)}`; | ||
|
||
if (this.hasAutoplay_()) { |
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.
as discussed, this would to use the isFullscreenSupported && hasFullscreen which unfortunately is async putting all of this a frame out but that should be fine.
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'm guessing you meant isAutoplaySupported
? :) if so, then fixed.
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.
Lol, context switch overflow
@aghassemi PTAL |
Autoplay support tested manually with mute/unmute + icon.