Skip to content

Commit

Permalink
Build for samples at v1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiro705 committed Oct 4, 2019
1 parent d6fe08b commit 57efd1c
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
23 changes: 21 additions & 2 deletions dist/videojs.ima.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ PlayerWrapper.prototype.addContentEndedListener = function (listener) {
* Reset the player.
*/
PlayerWrapper.prototype.reset = function () {
// Attempts to remove the contentEndedListener before adding it.
// This is to prevent an error where an erroring video caused multiple
// contentEndedListeners to be added.
this.vjsPlayer.off('contentended', this.boundContentEndedListener);

this.vjsPlayer.on('contentended', this.boundContentEndedListener);
this.vjsControls.show();
if (this.vjsPlayer.ads.inAdBreak()) {
Expand Down Expand Up @@ -1106,7 +1111,7 @@ AdUi.prototype.setShowCountdown = function (showCountdownIn) {
};

var name = "videojs-ima";
var version = "1.6.3";
var version = "1.7.0";
var license = "Apache-2.0";
var main = "./dist/videojs.ima.js";
var module$1 = "./dist/videojs.ima.es.js";
Expand Down Expand Up @@ -1303,6 +1308,11 @@ SdkImpl.prototype.initAdObjects = function () {

this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, this.onAdsManagerLoaded.bind(this), false);
this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdsLoaderError.bind(this), false);

this.controller.playerWrapper.vjsPlayer.trigger({
type: 'ads-loader',
adsLoader: this.adsLoader
});
};

/**
Expand Down Expand Up @@ -1340,7 +1350,10 @@ SdkImpl.prototype.requestAds = function () {
}

this.adsLoader.requestAds(adsRequest);
this.controller.triggerPlayerEvent('ads-request', adsRequest);
this.controller.playerWrapper.vjsPlayer.trigger({
type: 'ads-request',
AdsRequest: adsRequest
});
};

/**
Expand Down Expand Up @@ -1374,6 +1387,11 @@ SdkImpl.prototype.onAdsManagerLoaded = function (adsManagerLoadedEvent) {
this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED, this.onAdResumed.bind(this));
}

this.controller.playerWrapper.vjsPlayer.trigger({
type: 'ads-manager',
adsManager: this.adsManager
});

if (!this.autoPlayAdBreaks) {
this.initAdsManager();
}
Expand Down Expand Up @@ -1552,6 +1570,7 @@ SdkImpl.prototype.onAdLog = function (adEvent) {
* update the ad UI.
*/
SdkImpl.prototype.onAdPlayheadTrackerInterval = function () {
if (this.adsManager === null) return;
var remainingTime = this.adsManager.getRemainingTime();
var duration = this.currentAd.getDuration();
var currentTime = duration - remainingTime;
Expand Down
23 changes: 21 additions & 2 deletions dist/videojs.ima.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,11 @@ PlayerWrapper.prototype.addContentEndedListener = function (listener) {
* Reset the player.
*/
PlayerWrapper.prototype.reset = function () {
// Attempts to remove the contentEndedListener before adding it.
// This is to prevent an error where an erroring video caused multiple
// contentEndedListeners to be added.
this.vjsPlayer.off('contentended', this.boundContentEndedListener);

this.vjsPlayer.on('contentended', this.boundContentEndedListener);
this.vjsControls.show();
if (this.vjsPlayer.ads.inAdBreak()) {
Expand Down Expand Up @@ -1112,7 +1117,7 @@ AdUi.prototype.setShowCountdown = function (showCountdownIn) {
};

var name = "videojs-ima";
var version = "1.6.3";
var version = "1.7.0";
var license = "Apache-2.0";
var main = "./dist/videojs.ima.js";
var module$1 = "./dist/videojs.ima.es.js";
Expand Down Expand Up @@ -1309,6 +1314,11 @@ SdkImpl.prototype.initAdObjects = function () {

this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, this.onAdsManagerLoaded.bind(this), false);
this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, this.onAdsLoaderError.bind(this), false);

this.controller.playerWrapper.vjsPlayer.trigger({
type: 'ads-loader',
adsLoader: this.adsLoader
});
};

/**
Expand Down Expand Up @@ -1346,7 +1356,10 @@ SdkImpl.prototype.requestAds = function () {
}

this.adsLoader.requestAds(adsRequest);
this.controller.triggerPlayerEvent('ads-request', adsRequest);
this.controller.playerWrapper.vjsPlayer.trigger({
type: 'ads-request',
AdsRequest: adsRequest
});
};

/**
Expand Down Expand Up @@ -1380,6 +1393,11 @@ SdkImpl.prototype.onAdsManagerLoaded = function (adsManagerLoadedEvent) {
this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED, this.onAdResumed.bind(this));
}

this.controller.playerWrapper.vjsPlayer.trigger({
type: 'ads-manager',
adsManager: this.adsManager
});

if (!this.autoPlayAdBreaks) {
this.initAdsManager();
}
Expand Down Expand Up @@ -1558,6 +1576,7 @@ SdkImpl.prototype.onAdLog = function (adEvent) {
* update the ad UI.
*/
SdkImpl.prototype.onAdPlayheadTrackerInterval = function () {
if (this.adsManager === null) return;
var remainingTime = this.adsManager.getRemainingTime();
var duration = this.currentAd.getDuration();
var currentTime = duration - remainingTime;
Expand Down
Loading

0 comments on commit 57efd1c

Please sign in to comment.