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

docs: add autoplay deprecation note to README #356

Merged
merged 3 commits into from
Mar 26, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ The following events are slated for removal from contrib-ads and will have no sp
* `adscanceled` (EVENT) -- In the future, this event will no longer result in special behavior in contrib-ads. It was intended to cancel all ads, but it was never fully implemented. Instead, trigger `nopreroll` and `nopostroll`.
* `adserror` (EVENT) -- In the future, this event will no longer result in special behavior in contrib-ads. Today, this event skips prerolls when seen before a preroll ad break. It skips postrolls if seen after contentended and before a postroll ad break. It ends linear ad mode if seen during an ad break. These behaviors should be replaced using `skipLinearAdMode` and `endLinearAdMode` in the ad integration.

## Autoplay

Using the `autoplay` attribute on the video element is not supported. Due to Autoplay Restrictions [introduced](https://developers.google.com/web/updates/2017/09/autoplay-policy-changes) by [browsers](https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/), using the `autoplay` attribute on the player will often not behave as expected. The recommended [best practice](https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#best-practices) is to use the `player.play()` method to autoplay when autoplay without user interaction is not restricted and have access to the [play promise](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play) if it is available on that browser.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the webkit.org link maybe say "by browsers such as [Safari]" so it's clear the link is about Safari.


### Public Methods

These are methods on `player.ads` that can be called at runtime to inspect the ad plugin's state. You do not need to implement them yourself.
Expand Down