Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 290115022
  • Loading branch information
Interactive Media Ads Developer Relations authored and Kiro705 committed Feb 25, 2020
1 parent b06c9ca commit fe084e5
Show file tree
Hide file tree
Showing 23 changed files with 14 additions and 55 deletions.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified advanced/ads.js
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions advanced/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@

<div id="videoplayer">
<video id="content">
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4"></source>
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.webm"></source>
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
</video>
<div id="adcontainer">
</div>
Expand Down
Empty file modified advanced/video_player.js
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions attempt_to_autoplay/ads.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ function onAdsManagerLoaded(adsManagerLoadedEvent) {
// videoContent should be set to the content video element.
adsManager = adsManagerLoadedEvent.getAdsManager(
videoContent, adsRenderingSettings);
// Mute the ad if doing muted autoplay.
const adVolume = (autoplayAllowed && autoplayRequiresMuted) ? 0 : 1;
adsManager.setVolume(adVolume);

// Add listeners to the required events.
adsManager.addEventListener(
Expand Down Expand Up @@ -216,6 +219,8 @@ function onAdError(adErrorEvent) {
// Handle the error logging.
console.log(adErrorEvent.getError());
adsManager.destroy();
// Fall back to playing content.
videoContent.play();
}

function onContentPauseRequested() {
Expand Down
5 changes: 2 additions & 3 deletions attempt_to_autoplay/index.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
</p>
<div id="mainContainer">
<div id="content">
<video id="contentElement">
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4"></source>
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.webm"></source>
<video id="contentElement" playsinline>
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
</video>
</div>
<div id="adContainer"></div>
Expand Down
Empty file modified attempt_to_autoplay/style.css
100755 → 100644
Empty file.
Empty file modified live_stream_prefetch/ads.js
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions live_stream_prefetch/index.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<div id="mainContainer">
<div id="content">
<video id="contentElement">
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4"></source>
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.webm"></source>
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
</video>
</div>
<div id="adContainer"></div>
Expand Down
Empty file modified live_stream_prefetch/style.css
100755 → 100644
Empty file.
Empty file modified mobile_auto_skippable/ads.js
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions mobile_auto_skippable/index.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<div id="mainContainer">
<div id="content">
<video id="contentElement" playsinline muted>
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4"></source>
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.webm"></source>
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
</video>
</div>
<div id="adContainer"></div>
Expand Down
Empty file modified mobile_auto_skippable/style.css
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion playlist/ads.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ Ads.prototype.onAdError_ = function(adErrorEvent) {
* the video player fires the ended event. Here ads are done, so if
* the content video is done, we start the next video. If ads are done but the
* content video is still playing, we just let it finish.
*
* @private
*/
Ads.prototype.onAllAdsCompleted_ = function() {
Expand Down
Empty file modified playlist/application.js
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions playlist/index.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@

<div id="videoplayer">
<video id="content">
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.webm"></source>
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4"></source>
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
</video>
<div id="adcontainer">
</div>
Expand Down
Empty file modified playlist/style.css
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions playlist/video_player.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ var VideoPlayer = function() {
this.videoPlayerContainer_ = document.getElementById('videoplayer');

this.contentIndex = 0;
this.contentUrls = ['http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4',
'http://rmcdn.2mdn.net/Demo/html5/output.mp4'];
this.contentUrls = ['https://storage.googleapis.com/gvabox/media/samples/stock.mp4',
'https://storage.googleapis.com/gvabox/media/samples/android.mp4'];

this.width = 640;
this.height = 360;
Expand Down
Empty file modified simple/ads.js
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions simple/index.html
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<div id="mainContainer">
<div id="content">
<video id="contentElement">
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4"></source>
<source src="http://rmcdn.2mdn.net/Demo/vast_inspector/android.webm"></source>
<source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source>
</video>
</div>
<div id="adContainer"></div>
Expand Down
Empty file modified simple/style.css
100755 → 100644
Empty file.
20 changes: 0 additions & 20 deletions vpaid/linear/VpaidVideoAd.js
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @fileoverview A sample VPAID ad useful for testing a VPAID JS enabled player.
* This ad will just play a video.
*
*/

/**
Expand Down Expand Up @@ -74,7 +73,6 @@ var VpaidVideoPlayer = function() {
/**
* Parameters passed in from the AdParameters section of the VAST.
* Used for video URL and MIME type.
*
* @type {!object}
* @private
*/
Expand All @@ -95,7 +93,6 @@ VpaidVideoPlayer.prototype.handshakeVersion = function(version) {
/**
* Initializes all attributes in the ad. The ad will not start until startAd is\
* called.
*
* @param {number} width The ad width.
* @param {number} height The ad height.
* @param {string} viewMode The ad view mode.
Expand Down Expand Up @@ -254,7 +251,6 @@ VpaidVideoPlayer.prototype.stopAd = function() {

/**
* Called when the video player changes the width/height of the container.
*
* @param {number} width The new width.
* @param {number} height A new height.
* @param {string} viewMode A new view mode.
Expand Down Expand Up @@ -322,7 +318,6 @@ VpaidVideoPlayer.prototype.skipAd = function() {

/**
* Registers a callback for an event.
*
* @param {Function} aCallback The callback function.
* @param {string} eventName The callback type.
* @param {Object} aContext The context for the callback.
Expand All @@ -339,7 +334,6 @@ VpaidVideoPlayer.prototype.subscribe = function(

/**
* Removes a callback based on the eventName.
*
* @param {string} eventName The callback type.
*/
VpaidVideoPlayer.prototype.unsubscribe = function(eventName) {
Expand All @@ -350,7 +344,6 @@ VpaidVideoPlayer.prototype.unsubscribe = function(eventName) {

/**
* Returns whether the ad is linear.
*
* @return {boolean} True if the ad is a linear, false for non linear.
*/
VpaidVideoPlayer.prototype.getAdLinear = function() {
Expand All @@ -359,7 +352,6 @@ VpaidVideoPlayer.prototype.getAdLinear = function() {

/**
* Returns ad width.
*
* @return {number} The ad width.
*/
VpaidVideoPlayer.prototype.getAdWidth = function() {
Expand All @@ -369,7 +361,6 @@ VpaidVideoPlayer.prototype.getAdWidth = function() {

/**
* Returns ad height.
*
* @return {number} The ad height.
*/
VpaidVideoPlayer.prototype.getAdHeight = function() {
Expand All @@ -379,7 +370,6 @@ VpaidVideoPlayer.prototype.getAdHeight = function() {

/**
* Returns true if the ad is expanded.
*
* @return {boolean}
*/
VpaidVideoPlayer.prototype.getAdExpanded = function() {
Expand All @@ -390,7 +380,6 @@ VpaidVideoPlayer.prototype.getAdExpanded = function() {

/**
* Returns the skippable state of the ad.
*
* @return {boolean}
*/
VpaidVideoPlayer.prototype.getAdSkippableState = function() {
Expand All @@ -401,7 +390,6 @@ VpaidVideoPlayer.prototype.getAdSkippableState = function() {

/**
* Returns the remaining ad time, in seconds.
*
* @return {number} The time remaining in the ad.
*/
VpaidVideoPlayer.prototype.getAdRemainingTime = function() {
Expand All @@ -411,7 +399,6 @@ VpaidVideoPlayer.prototype.getAdRemainingTime = function() {

/**
* Returns the duration of the ad, in seconds.
*
* @return {number} The duration of the ad.
*/
VpaidVideoPlayer.prototype.getAdDuration = function() {
Expand All @@ -421,7 +408,6 @@ VpaidVideoPlayer.prototype.getAdDuration = function() {

/**
* Returns the ad volume.
*
* @return {number} The volume of the ad.
*/
VpaidVideoPlayer.prototype.getAdVolume = function() {
Expand All @@ -432,7 +418,6 @@ VpaidVideoPlayer.prototype.getAdVolume = function() {

/**
* Sets the ad volume.
*
* @param {number} value The volume in percentage.
*/
VpaidVideoPlayer.prototype.setAdVolume = function(value) {
Expand All @@ -444,7 +429,6 @@ VpaidVideoPlayer.prototype.setAdVolume = function(value) {

/**
* Returns a list of companion ads for the ad.
*
* @return {string} List of companions in VAST XML.
*/
VpaidVideoPlayer.prototype.getAdCompanions = function() {
Expand All @@ -454,7 +438,6 @@ VpaidVideoPlayer.prototype.getAdCompanions = function() {

/**
* Returns a list of icons.
*
* @return {string} A list of icons.
*/
VpaidVideoPlayer.prototype.getAdIcons = function() {
Expand All @@ -464,7 +447,6 @@ VpaidVideoPlayer.prototype.getAdIcons = function() {

/**
* Logs events and messages.
*
* @param {string} message
*/
VpaidVideoPlayer.prototype.log = function(message) {
Expand All @@ -474,7 +456,6 @@ VpaidVideoPlayer.prototype.log = function(message) {

/**
* Calls an event if there is a callback.
*
* @param {string} eventType
* @private
*/
Expand All @@ -487,7 +468,6 @@ VpaidVideoPlayer.prototype.callEvent_ = function(eventType) {

/**
* Main function called by wrapper to get the VPAID ad.
*
* @return {Object} The VPAID compliant ad.
*/
var getVPAIDAd = function() {
Expand Down
Loading

0 comments on commit fe084e5

Please sign in to comment.