videojs / videojs-contrib-ads

A Tool for Building Video.js Ad Plugins
http://videojs.github.io/videojs-contrib-ads/
Other
381 stars 257 forks source link

feat: add pageUrl macro #476

Closed mister-ben closed 4 years ago

mister-ben commented 5 years ago

Adds a player.pageUrl macro. This is intended as the URL at which the player has been embedded, whether directly or via an iframe. The name of the macro hopefully makes it clear that this is not an embed URL for the player itself.

If the player is in an iframe, this resolves to document.referrer, otherwise to window.location.href.

A test is only included for the iframe case for now, as the tests themselves run in an iframe.

mister-ben commented 5 years ago

Failing tests are unrelated

misteroneill commented 5 years ago

Failing tests are related to Firefox 66. I believe @alex-barstow is fixing that in another PR>