forked from googleads/videojs-ima
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/mouseenter mouseleave handlers on i os upd 10 2019 #3
Open
Viktor286hearts
wants to merge
30
commits into
master-hearst
Choose a base branch
from
fix/mouseenter-mouseleave-handlers-on-iOS-upd-10-2019
base: master-hearst
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
278556b
feat: adds a request mode for ad requests
168c3c1
Readme Update: updates the Readme to highlight an example using es6 i…
Kiro705 18186f9
fix: fixed small errors in Readme update
Kiro705 8dd1922
updates for spelling
Kiro705 8be147e
grammer update
Kiro705 1f685b2
one comma
Kiro705 4f34a54
Merge pull request #815 from googleads/es6-readme-update
Kiro705 9968f03
Removes the click eventListener on the adContainer
arnaudcasame 0f88d33
Generates the distribution files
arnaudcasame 0b63fb1
Merge pull request #1 from googleads/master
arnaudcasame 2b854a4
fix: changed to parseFloat
Kiro705 4b5eef9
fix: removed second param from parseFloat
Kiro705 3ceda1b
1.6.1
Kiro705 f8d9546
merge commits for v1.6.1
Kiro705 b32c1dc
Merge pull request #818 from arnaudcasame/master
gschoppe 3d4e995
fix: fixed error in videojs.ima.min.js
Kiro705 a8026ec
Merge pull request #822 from googleads/minified-fix
Kiro705 b76516c
1.6.2
Kiro705 3768f01
Build for samples at v1.6.2
Kiro705 6790115
Updates readme for accurate locale codes
Kiro705 054a57b
update to v1.6.3
Kiro705 16d3c8b
Merge pull request #781 from Afrozaar/master
gschoppe b9c93f5
Merge pull request #827 from googleads/currentChange
Kiro705 6675841
Merge pull request #828 from googleads/locale-update
Kiro705 3e10247
updated dist files for 1.6.3
Kiro705 93d70d2
Merge pull request #829 from googleads/updated-files
Kiro705 43a87b9
1.6.3
Kiro705 5f643a3
CI and test-stage edits inside origin: .travis.yml & package.json
Viktor286hearts a3a263a
fix: edge case for iOS: no mouse enter/leave events on adContainerDiv
Viktor286hearts 70ca5d8
dist manual update (temp)
Viktor286hearts File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
node_modules/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,6 +141,10 @@ var PlayerWrapper = function PlayerWrapper(player, adsPluginSettings, controller | |
this.vjsPlayer.on('readyforpreroll', this.onReadyForPreroll.bind(this)); | ||
this.vjsPlayer.ready(this.onPlayerReady.bind(this)); | ||
|
||
if (this.controller.getSettings().requestMode === 'onPlay') { | ||
this.vjsPlayer.one('play', this.controller.requestAds.bind(this.controller)); | ||
} | ||
|
||
this.vjsPlayer.ads(adsPluginSettings); | ||
}; | ||
|
||
|
@@ -364,11 +368,11 @@ PlayerWrapper.prototype.play = function () { | |
PlayerWrapper.prototype.getPlayerWidth = function () { | ||
var width = (getComputedStyle(this.vjsPlayer.el()) || {}).width; | ||
|
||
if (!width || parseInt(width, 10) === 0) { | ||
if (!width || parseFloat(width) === 0) { | ||
width = (this.vjsPlayer.el().getBoundingClientRect() || {}).width; | ||
} | ||
|
||
return parseInt(width, 10) || this.vjsPlayer.width(); | ||
return parseFloat(width) || this.vjsPlayer.width(); | ||
}; | ||
|
||
/** | ||
|
@@ -379,11 +383,11 @@ PlayerWrapper.prototype.getPlayerWidth = function () { | |
PlayerWrapper.prototype.getPlayerHeight = function () { | ||
var height = (getComputedStyle(this.vjsPlayer.el()) || {}).height; | ||
|
||
if (!height || parseInt(height, 10) === 0) { | ||
if (!height || parseFloat(height) === 0) { | ||
height = (this.vjsPlayer.el().getBoundingClientRect() || {}).height; | ||
} | ||
|
||
return parseInt(height, 10) || this.vjsPlayer.height(); | ||
return parseFloat(height) || this.vjsPlayer.height(); | ||
}; | ||
|
||
/** | ||
|
@@ -697,8 +701,10 @@ AdUi.prototype.createAdContainer = function () { | |
this.assignControlAttributes(this.adContainerDiv, 'ima-ad-container'); | ||
this.adContainerDiv.style.position = 'absolute'; | ||
this.adContainerDiv.style.zIndex = 1111; | ||
this.adContainerDiv.addEventListener('mouseenter', this.showAdControls.bind(this), false); | ||
this.adContainerDiv.addEventListener('mouseleave', this.hideAdControls.bind(this), false); | ||
if (!videojs.browser.IS_IOS) { | ||
this.adContainerDiv.addEventListener('mouseenter', this.showAdControls.bind(this), false); | ||
this.adContainerDiv.addEventListener('mouseleave', this.hideAdControls.bind(this), false); | ||
} | ||
this.createControls(); | ||
this.controller.injectAdContainerDiv(this.adContainerDiv); | ||
}; | ||
|
@@ -1102,13 +1108,13 @@ AdUi.prototype.setShowCountdown = function (showCountdownIn) { | |
}; | ||
|
||
var name = "videojs-ima"; | ||
var version = "1.6.0"; | ||
var version = "1.6.3"; | ||
var license = "Apache-2.0"; | ||
var main = "./dist/videojs.ima.js"; | ||
var module$1 = "./dist/videojs.ima.es.js"; | ||
var author = { "name": "Google Inc." }; | ||
var engines = { "node": ">=0.8.0" }; | ||
var scripts = { "contBuild": "watch 'npm run rollup:max' src", "predevServer": "echo \"Starting up server on localhost:8000.\"", "devServer": "npm-run-all -p testServer contBuild", "lint": "eslint \"src/*.js\"", "rollup": "npm-run-all rollup:*", "rollup:max": "rollup -c configs/rollup.config.js", "rollup:es": "rollup -c configs/rollup.config.es.js", "rollup:min": "rollup -c configs/rollup.config.min.js", "pretest": "npm run rollup", "start": "npm run devServer", "test": "npm-run-all test:*", "test:vjs5": "npm install [email protected] --no-save && npm-run-all -p -r testServer webdriver", "test:vjs6": "npm install video.js@6 --no-save && npm-run-all -p -r testServer webdriver", "test:vjs7": "npm install video.js@7 --no-save && npm-run-all -p -r testServer webdriver", "testServer": "http-server --cors -p 8000 --silent", "preversion": "node scripts/preversion.js && npm run lint && npm test", "version": "node scripts/version.js", "postversion": "node scripts/postversion.js", "webdriver": "mocha test/webdriver/*.js --no-timeouts" }; | ||
var scripts = { "contBuild": "watch 'npm run rollup:max' src", "predevServer": "echo \"Starting up server on localhost:8000.\"", "devServer": "npm-run-all -p testServer contBuild", "lint": "eslint \"src/*.js\"", "rollup": "npm-run-all rollup:*", "rollup:max": "rollup -c configs/rollup.config.js", "rollup:es": "rollup -c configs/rollup.config.es.js", "rollup:min": "rollup -c configs/rollup.config.min.js", "pretest": "npm run rollup", "start": "npm run devServer", "test": "npm-run-all test:*", "test:vjs5": "npm install [email protected] --no-save && npm-run-all -p -r testServer webdriver", "test:vjs6": "npm install video.js@6 --no-save && npm-run-all -p -r testServer webdriver", "test:vjs7": "npm install video.js@7 --no-save && npm-run-all -p -r testServer webdriver", "testServer": "http-server --cors -p 8000 --silent", "preversion": "node scripts/preversion.js && npm run lint && npm test", "version": "node scripts/version.js", "postversion": "node scripts/postversion.js", "webdriver": "mocha test/webdriver/basic-hearst-mod.js --no-timeouts" }; | ||
var repository = { "type": "git", "url": "https://github.com/googleads/videojs-ima" }; | ||
var files = ["CHANGELOG.md", "LICENSE", "README.md", "dist/", "src/"]; | ||
var dependencies = { "can-autoplay": "^3.0.0", "cryptiles": "^4.1.2", "video.js": "^5.19.2 || ^6 || ^7", "videojs-contrib-ads": "^6" }; | ||
|
@@ -1360,7 +1366,6 @@ SdkImpl.prototype.onAdsManagerLoaded = function (adsManagerLoadedEvent) { | |
|
||
this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, this.onAdLoaded.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, this.onAdStarted.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK, this.onAdPaused.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE, this.onAdComplete.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED, this.onAdComplete.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG, this.onAdLog.bind(this)); | ||
|
@@ -1611,7 +1616,7 @@ SdkImpl.prototype.onPlayerReadyForPreroll = function () { | |
SdkImpl.prototype.onPlayerReady = function () { | ||
this.initAdObjects(); | ||
|
||
if (this.controller.getSettings().adTagUrl || this.controller.getSettings().adsResponse) { | ||
if ((this.controller.getSettings().adTagUrl || this.controller.getSettings().adsResponse) && this.controller.getSettings().requestMode === 'onLoad') { | ||
this.requestAds(); | ||
} | ||
}; | ||
|
@@ -1896,7 +1901,8 @@ Controller.IMA_DEFAULTS = { | |
prerollTimeout: 1000, | ||
adLabel: 'Advertisement', | ||
adLabelNofN: 'of', | ||
showControlsForJSAds: true | ||
showControlsForJSAds: true, | ||
requestMode: 'onLoad' | ||
}; | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,10 @@ var PlayerWrapper = function PlayerWrapper(player, adsPluginSettings, controller | |
this.vjsPlayer.on('readyforpreroll', this.onReadyForPreroll.bind(this)); | ||
this.vjsPlayer.ready(this.onPlayerReady.bind(this)); | ||
|
||
if (this.controller.getSettings().requestMode === 'onPlay') { | ||
this.vjsPlayer.one('play', this.controller.requestAds.bind(this.controller)); | ||
} | ||
|
||
this.vjsPlayer.ads(adsPluginSettings); | ||
}; | ||
|
||
|
@@ -370,11 +374,11 @@ PlayerWrapper.prototype.play = function () { | |
PlayerWrapper.prototype.getPlayerWidth = function () { | ||
var width = (getComputedStyle(this.vjsPlayer.el()) || {}).width; | ||
|
||
if (!width || parseInt(width, 10) === 0) { | ||
if (!width || parseFloat(width) === 0) { | ||
width = (this.vjsPlayer.el().getBoundingClientRect() || {}).width; | ||
} | ||
|
||
return parseInt(width, 10) || this.vjsPlayer.width(); | ||
return parseFloat(width) || this.vjsPlayer.width(); | ||
}; | ||
|
||
/** | ||
|
@@ -385,11 +389,11 @@ PlayerWrapper.prototype.getPlayerWidth = function () { | |
PlayerWrapper.prototype.getPlayerHeight = function () { | ||
var height = (getComputedStyle(this.vjsPlayer.el()) || {}).height; | ||
|
||
if (!height || parseInt(height, 10) === 0) { | ||
if (!height || parseFloat(height) === 0) { | ||
height = (this.vjsPlayer.el().getBoundingClientRect() || {}).height; | ||
} | ||
|
||
return parseInt(height, 10) || this.vjsPlayer.height(); | ||
return parseFloat(height) || this.vjsPlayer.height(); | ||
}; | ||
|
||
/** | ||
|
@@ -703,8 +707,10 @@ AdUi.prototype.createAdContainer = function () { | |
this.assignControlAttributes(this.adContainerDiv, 'ima-ad-container'); | ||
this.adContainerDiv.style.position = 'absolute'; | ||
this.adContainerDiv.style.zIndex = 1111; | ||
this.adContainerDiv.addEventListener('mouseenter', this.showAdControls.bind(this), false); | ||
this.adContainerDiv.addEventListener('mouseleave', this.hideAdControls.bind(this), false); | ||
if (!videojs.browser.IS_IOS) { | ||
this.adContainerDiv.addEventListener('mouseenter', this.showAdControls.bind(this), false); | ||
this.adContainerDiv.addEventListener('mouseleave', this.hideAdControls.bind(this), false); | ||
} | ||
this.createControls(); | ||
this.controller.injectAdContainerDiv(this.adContainerDiv); | ||
}; | ||
|
@@ -1108,13 +1114,13 @@ AdUi.prototype.setShowCountdown = function (showCountdownIn) { | |
}; | ||
|
||
var name = "videojs-ima"; | ||
var version = "1.6.0"; | ||
var version = "1.6.3"; | ||
var license = "Apache-2.0"; | ||
var main = "./dist/videojs.ima.js"; | ||
var module$1 = "./dist/videojs.ima.es.js"; | ||
var author = { "name": "Google Inc." }; | ||
var engines = { "node": ">=0.8.0" }; | ||
var scripts = { "contBuild": "watch 'npm run rollup:max' src", "predevServer": "echo \"Starting up server on localhost:8000.\"", "devServer": "npm-run-all -p testServer contBuild", "lint": "eslint \"src/*.js\"", "rollup": "npm-run-all rollup:*", "rollup:max": "rollup -c configs/rollup.config.js", "rollup:es": "rollup -c configs/rollup.config.es.js", "rollup:min": "rollup -c configs/rollup.config.min.js", "pretest": "npm run rollup", "start": "npm run devServer", "test": "npm-run-all test:*", "test:vjs5": "npm install [email protected] --no-save && npm-run-all -p -r testServer webdriver", "test:vjs6": "npm install video.js@6 --no-save && npm-run-all -p -r testServer webdriver", "test:vjs7": "npm install video.js@7 --no-save && npm-run-all -p -r testServer webdriver", "testServer": "http-server --cors -p 8000 --silent", "preversion": "node scripts/preversion.js && npm run lint && npm test", "version": "node scripts/version.js", "postversion": "node scripts/postversion.js", "webdriver": "mocha test/webdriver/*.js --no-timeouts" }; | ||
var scripts = { "contBuild": "watch 'npm run rollup:max' src", "predevServer": "echo \"Starting up server on localhost:8000.\"", "devServer": "npm-run-all -p testServer contBuild", "lint": "eslint \"src/*.js\"", "rollup": "npm-run-all rollup:*", "rollup:max": "rollup -c configs/rollup.config.js", "rollup:es": "rollup -c configs/rollup.config.es.js", "rollup:min": "rollup -c configs/rollup.config.min.js", "pretest": "npm run rollup", "start": "npm run devServer", "test": "npm-run-all test:*", "test:vjs5": "npm install [email protected] --no-save && npm-run-all -p -r testServer webdriver", "test:vjs6": "npm install video.js@6 --no-save && npm-run-all -p -r testServer webdriver", "test:vjs7": "npm install video.js@7 --no-save && npm-run-all -p -r testServer webdriver", "testServer": "http-server --cors -p 8000 --silent", "preversion": "node scripts/preversion.js && npm run lint && npm test", "version": "node scripts/version.js", "postversion": "node scripts/postversion.js", "webdriver": "mocha test/webdriver/basic-hearst-mod.js --no-timeouts" }; | ||
var repository = { "type": "git", "url": "https://github.com/googleads/videojs-ima" }; | ||
var files = ["CHANGELOG.md", "LICENSE", "README.md", "dist/", "src/"]; | ||
var dependencies = { "can-autoplay": "^3.0.0", "cryptiles": "^4.1.2", "video.js": "^5.19.2 || ^6 || ^7", "videojs-contrib-ads": "^6" }; | ||
|
@@ -1366,7 +1372,6 @@ SdkImpl.prototype.onAdsManagerLoaded = function (adsManagerLoadedEvent) { | |
|
||
this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, this.onAdLoaded.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED, this.onAdStarted.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.CLICK, this.onAdPaused.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE, this.onAdComplete.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED, this.onAdComplete.bind(this)); | ||
this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG, this.onAdLog.bind(this)); | ||
|
@@ -1617,7 +1622,7 @@ SdkImpl.prototype.onPlayerReadyForPreroll = function () { | |
SdkImpl.prototype.onPlayerReady = function () { | ||
this.initAdObjects(); | ||
|
||
if (this.controller.getSettings().adTagUrl || this.controller.getSettings().adsResponse) { | ||
if ((this.controller.getSettings().adTagUrl || this.controller.getSettings().adsResponse) && this.controller.getSettings().requestMode === 'onLoad') { | ||
this.requestAds(); | ||
} | ||
}; | ||
|
@@ -1902,7 +1907,8 @@ Controller.IMA_DEFAULTS = { | |
prerollTimeout: 1000, | ||
adLabel: 'Advertisement', | ||
adLabelNofN: 'of', | ||
showControlsForJSAds: true | ||
showControlsForJSAds: true, | ||
requestMode: 'onLoad' | ||
}; | ||
|
||
/** | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason for this check?