Skip to content

Commit

Permalink
fix(ads): Fixed Ads workflow when playing midroll Ads not updating pr…
Browse files Browse the repository at this point in the history
…operly Play button
  • Loading branch information
rafa8626 committed May 2, 2018
1 parent 6e4e174 commit 2d1bbc8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ All [HTML5 media events](https://developer.mozilla.org/en-US/docs/Web/Guide/Even

Event | Description
--- | ---
`controlshidden` | Event executed when controls timer stops and hides control bar (video only)
`controlschanged` | Event triggered when an element modified the state of the controls and they regenerate (i.e., adding new cpation)
`adsended` | Event executed when an Ad ends playing (currently used to change the Replay icon to Pause when playing a postroll Ad)
`controlshidden` | Event executed when controls timer stops and hides control bar (video only).
`controlschanged` | Event triggered when an element modified the state of the controls and they regenerate (i.e., adding new caption).
`captionschanged` | Event triggered when user changes the current caption by selecting a new one from the `Settings` menu.
`adsended` | Event executed when an Ad ends playing (currently used to change the Replay icon to Pause when playing a postroll Ad).

## Contributions

Expand Down
3 changes: 3 additions & 0 deletions src/js/media/ads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ class Ads {
case google.ima.AdEvent.Type.STARTED:
if (ad.isLinear()) {
this.adsActive = true;
const playEvent = addEvent('play');
this.element.dispatchEvent(playEvent);

if (this.media.ended) {
this.adsEnded = false;
const endEvent = addEvent('adsended');
Expand Down

0 comments on commit 2d1bbc8

Please sign in to comment.