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

Disable option to activate autoplay with YT. #3794

Merged
merged 3 commits into from Jun 28, 2016

Conversation

cramforce
Copy link
Member

While autoplay is landing in mobile browsers (for now it is still blocked in Safari and Chrome), we deactivate this for now to ensure the experience if good when it becomes available. Autoplay support will be added back later this year with support for features like

  • no autoplay off screen
  • mute by default
  • only autoplay a single video per page

While autoplay is landing in mobile browsers (for now it is still blocked in Safari and Chrome), we deactivate this for now to ensure the experience if good when it becomes available. Autoplay support will be added back later this year with support for features like

- no autoplay off screen
- mute by default
- only autoplay a single video per page
@muxin
Copy link
Contributor

muxin commented Jun 27, 2016

I put data-param-autoplay as an example in the doc and examples.
Maybe we should change the example to some other data-param in youtube.amp.html, test-amp-youtube.js and amp-youtube.md

@cramforce
Copy link
Member Author

@muxin Good point! Done.

expect(iframe.src).to.contain('myParam=hello%20world');
// autoplay is temporarily black listed.
expect(iframe.src).to.not.contain('autoplay=1');
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 testing that it gets removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see.

Copy link
Contributor

Choose a reason for hiding this comment

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

The test is failing because of re-calculating the params - as I mentioned in a comment above.

@mkhatib mkhatib added LGTM and removed NEEDS REVIEW labels Jun 27, 2016
if ('autoplay' in params) {
delete params['autoplay'];
user.warn('Autoplay is currently not support with amp-youtube.');
}
src = addParamsToUrl(src, getDataParamsFromAttributes(this.element));
Copy link
Contributor

Choose a reason for hiding this comment

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

This actually doesn't use the params const above and it recalculates the params. Please fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 🐑

@mkhatib mkhatib added NEEDS REVIEW and removed LGTM labels Jun 27, 2016
@mkhatib mkhatib added LGTM and removed NEEDS REVIEW labels Jun 28, 2016
@mkhatib
Copy link
Contributor

mkhatib commented Jun 28, 2016

LGTM

@cramforce cramforce merged commit 16fb151 into ampproject:master Jun 28, 2016
@cramforce cramforce deleted the no-autoplay branch June 28, 2016 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants