Skip to content

Commit

Permalink
docs: add autoplay attribute deprecation note to README (#356)
Browse files Browse the repository at this point in the history
docs: add autoplay deprecation note to README
  • Loading branch information
ldayananda authored Mar 26, 2018
1 parent 81699b4 commit bf82f40
Showing 1 changed file with 4 additions and 0 deletions.
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 by browsers, such as [Safari](https://webkit.org/blog/7734/auto-play-policy-changes-for-macos/) and [Chrome](https://developers.google.com/web/updates/2017/09/autoplay-policy-changes), 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.

### 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

0 comments on commit bf82f40

Please sign in to comment.