Skip to content

Commit

Permalink
feat(Ima-ads): add output for ima-ads play/pause/end
Browse files Browse the repository at this point in the history
add output for ima-ads play/pause/end
  • Loading branch information
jorgeucano committed Jul 16, 2018
1 parent 9aa1b56 commit c767504
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ima-ads/vg-ima-ads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,22 @@ export class VgImaAds implements OnInit, OnDestroy {
}
this.hide();
this.API.play();
this.onAdStop.emit(true);
}

onAllAdsComplete() {
this.hide();
// The last ad was a post-roll
if (this.ima.adsManager.getCuePoints().join().indexOf('-1') >= 0) {
this.API.pause(); // it was stop() in Videogular v1
this.onAdStop.emit(true);
}
}

onAdComplete() {
// TODO: Update view with current ad count
this.ima.currentAd++;
this.onAdStop.emit(true);
}

show() {
Expand All @@ -277,6 +280,7 @@ export class VgImaAds implements OnInit, OnDestroy {

onContentEnded() {
this.ima.adsLoader.contentComplete();
this.onAdStop.emit(true);
}

onChangeFullscreen(fsState: boolean) {
Expand Down

0 comments on commit c767504

Please sign in to comment.