mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-26 17:46:26 +03:00
fix: AD_STARTED fires before ad started with AWS Media Tailor (#5855)
Fixes https://github.com/shaka-project/shaka-player/issues/5854
This commit is contained in:
committed by
GitHub
parent
508e5cfbba
commit
b39f33466e
@@ -612,8 +612,13 @@ shaka.ads.MediaTailorAdManager = class {
|
||||
*/
|
||||
setupCurrentAdListeners_() {
|
||||
const MediaTailorAdManager = shaka.ads.MediaTailorAdManager;
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.IMPRESSION_);
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.START_);
|
||||
let needFirstEvents = false;
|
||||
if (!this.video_.paused) {
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.IMPRESSION_);
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.START_);
|
||||
} else {
|
||||
needFirstEvents = true;
|
||||
}
|
||||
this.adListeners_.push({
|
||||
target: this.video_,
|
||||
type: 'volumechange',
|
||||
@@ -636,7 +641,13 @@ shaka.ads.MediaTailorAdManager = class {
|
||||
target: this.video_,
|
||||
type: 'play',
|
||||
listener: () => {
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.RESUME_);
|
||||
if (needFirstEvents) {
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.IMPRESSION_);
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.START_);
|
||||
needFirstEvents = false;
|
||||
} else {
|
||||
this.sendTrackingEvent_(MediaTailorAdManager.RESUME_);
|
||||
}
|
||||
},
|
||||
});
|
||||
this.adListeners_.push({
|
||||
|
||||
Reference in New Issue
Block a user