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

🏗✨ Basic implementation of VideoInterface for <amp-vimeo> #15326

Merged
merged 14 commits into from May 17, 2018

Conversation

alanorozco
Copy link
Member

@alanorozco alanorozco commented May 15, 2018

Autoplay support tested manually with mute/unmute + icon.

@alanorozco alanorozco requested a review from aghassemi May 16, 2018 18:59
@alanorozco alanorozco changed the title 🏗✨ Basic implementation of VideoInterface for <amp-vimeo> (in progress) 🏗✨ Basic implementation of VideoInterface for <amp-vimeo> May 16, 2018
iframe.src = 'https://player.vimeo.com/video/' + encodeURIComponent(
videoid);
const iframe =
htmlFor(element)`<iframe frameborder=0 alllowfullscreen></iframe>`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowfullscreen is misspelled.

Copy link
Member Author

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) {
Copy link
Contributor

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?

Copy link
Member Author

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;
Copy link
Contributor

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.

Copy link
Member Author

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');
Copy link
Contributor

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.

Copy link
Member Author

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_()) {
Copy link
Contributor

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.

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, context switch overflow

@alanorozco
Copy link
Member Author

@aghassemi PTAL

@alanorozco alanorozco merged commit 419c192 into ampproject:master May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Media Features in AMP
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

3 participants