googleads / googleads-ima-html5 Goto Github PK
View Code? Open in Web Editor NEWSamples for the HTML5 IMA SDK.
License: Apache License 2.0
Samples for the HTML5 IMA SDK.
License: Apache License 2.0
Dear,
Am using https://dev.rtb.veuhub.redblink.net/vpaid?pid=10432&consent=[CONSENT]&gdpr=300&width=300&height=250&ua=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/42.0.2311.135%20Safari/537.36%20Edge/12.246 above vpaid tag, but this shows 901 error code in Video Suite Inspector(https://developers.google.com/interactive-media-ads/docs/sdks/html5/vastinspector) and its fired only loaded event , after loaded event it couldn't fire other events , Thanks in advnce
Can I
adsLoader.requestAds(adsRequest); - What does this call return. I was reviewing documentation here https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdsLoader.requestAds and am not able to find anything
Without using the IMA is this call exposed via an api, where we could make an ad request without having to configure a player and ui ??
can i play ad video inside main videoplayer instead of ima player which come top of the videoplayer ?
if you have pre, mid and post rolls and forward skip to the end of the video by click the time line near end, is it supposed to “skip” the mid-rolls ( as it does), in eg videojs it stops and plays the mid rolls, then comes back to the video at the point you choose in the timeline
This is an issue posted as been asked to by the guys over on AMP-video, issue there , here:
ampproject/amphtml#31263
Hello, I have this issue.
I have a VAST like this:
https://cmod592.live.streamtheworld.com/ondemand/ars?type=preroll&fmt=vast&banners=none&stid=109863&version=1.6.1&gdpr=1&gdpr_consent=123456
I don't want to display banners but IMA automatically calls every confirmation URL although banners are not displayed
Hey there,
Hope all is well.
When testing on Android Chrome I have recently started getting the following error:
Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture.
I'm calling initialize
as instructed and I'm correctly passing in my container and videoSlot to the AdDisaplyContainer.
Just wanted to sanity check with you - there are no bugs that you are aware of?
I saw in the documentation a solution for seeking issues; however, when implementing it, seems like there are typos and it doesn't produce the desire behavior. Can you provide an example that shows the behavior correctly, or add it into this repository, please?
Thanks in advance for any hints
When i try the following vmap with the advanced or other examples, on iPad preroll works perfectly but when overlay or fullslot ads start player fires emptied event and video starts from the beginning.
<?xml version="1.0" encoding="utf-8"?> <vmap:VMAP version="1.0" xmlns:vmap="http://www.iab.net/videosuite/vmap"> <vmap:AdBreak timeOffset="start" breakType="linear" breakId="preroll"> <vmap:AdSource id="preroll-ad-1" allowMultipleAds="false" followRedirects="true"> <vmap:AdTagURI templateType="vast3"> <![CDATA[https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=]]> </vmap:AdTagURI> </vmap:AdSource> </vmap:AdBreak> <vmap:AdBreak timeOffset="00:00:20.000" breakType="nonlinear" breakId="overlay"> <vmap:AdSource id="overlay-ad-3" allowMultipleAds="false" followRedirects="true"> <vmap:AdTagURI templateType="vast3"> <![CDATA[https://pubads.g.doubleclick.net/gampad/ads?sz=480x70&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dnonlinear&correlator=]]> </vmap:AdTagURI> </vmap:AdSource> </vmap:AdBreak> <vmap:AdBreak timeOffset="00:00:40.000" breakType="linear" breakId="middroll"> <vmap:AdSource id="middroll-ad-4" allowMultipleAds="false" followRedirects="true"> <vmap:AdTagURI templateType="vast3"> <![CDATA[https://googleads.g.doubleclick.net/pagead/ads?client=ca-video-pub-6042571565839072&slotname=8759539312/3322294072&ad_type=text_image_flash&description_url=http%3A%2F%2Fkanald.com.tr&max_ad_duration=30000&videoad_start_delay=0]]> </vmap:AdTagURI> </vmap:AdSource> </vmap:AdBreak> <vmap:AdBreak timeOffset="end" breakType="linear" breakId="postroll"> <vmap:AdSource id="postroll-ad-7" allowMultipleAds="false" followRedirects="true"> <vmap:AdTagURI templateType="vast3"> <![CDATA[https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/9927946/kanald/programlar/postroll&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=[referrer_url]&description_url=[description_url]&correlator=[timestamp]]]> </vmap:AdTagURI> </vmap:AdSource> </vmap:AdBreak> </vmap:VMAP>
I created a pull request to show the bug: #9
To reproduce the bug:
The first item of the playlist don't play with subtitles but play without subtitles.
The second item of the playlist is always playing fine with subtitles and without subtitles.
Both item of the playlist contains on-demand HLS videos.
If you don't inject the vtt file, both items of the playlist are playing fine.
Hello,
I have a strange issue with the IMA3 SDK on iOS 12. The video ad replaces the source from the main video. Here is an example:
http://staging53.wendyshow.com/ios12bug/
Scenario:
It works as expected on any device I was testing with, except on iOS 12.
Thanks,
Muris
I've created an xml with one Wrapper element, that redirect to other Inline ad.
Both of them have one Tracking event=start.
VASTv3_0 says that all ad server in chain should be pinged with tracking urls. But when the ad started only Inline.Tracking event will be pinged.
Linear assets were found in the VAST ad response, but none of them matched the video player's capabilities error in Opera browser
I have follow this example into my own customized player ,
But i am getting this error although i have same html structure of my player
uncaught exception: AdError 1101: The provided containerElement information: element is invalid.
Can anyone help me please
Thankyou in advance
Html5
Hi,
The AdEvent types are described here but i can't figure which one is the VAST video ad started ? (especially when it is a VPAID which play video ad)
According IAB VPAID 2.0 documentation, the AdStarted
event (google.ima.AdEvent.type.STARTED
?) is fired as the result of calling the startAd() VPAID method. (ad unit started)
But i can't find in documentation the IMA equivalent to VAST AdVideoStart
event :
AdStarted --> google.ima.AdEvent.type.STARTED
AdImpression --> google.ima.AdEvent.type.IMPRESSION
AdVideoStart --> ???
AdVideoFirstQuartile --> google.ima.AdEvent.type.FIRST_QUARTILE
AdVideoMidpoint --> google.ima.AdEvent.type.MIDPOINT
AdVideoThirdQuartile --> google.ima.AdEvent.type.THIRD_QUARTILE
AdVideoComplete --> google.ima.AdEvent.type.COMPLETE
Does someone have a clue ?
To reproduce the bug:
Result: The companion loads but the video ad does not start.
I did the same on IOS devices and it's work properly.
My guess is that video tag did not receive the authorization to play on Android, maybe because IMA use two tags videos on Android and only one tag on IOS.
Hi,
In the simple example index.html, ima sdk script:
<script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
But in the advanced example index.html:
<script type="text/javascript" src="//s0.2mdn.net/instream/html5/ima3.js"></script>
What is difference? Which is right choose?
I'm trying to integrate the HTLM5 IMA SDK in my game launcher as described here.
I use the simple sample to get started. This sample works perfectly with the tag provided in the sample, however, when I use the tag for games mentioned in the Adsense for Games support doc, I get:
{l: "Unable to request ads from server due to network error.", h: 1012, o: "adLoadError"}
Here's the tag that should be used for games to get approved:
https://googleads.g.doubleclick.net/pagead/ads?ad_type=video&client=ca-games-pub-4968145218643279&videoad_start_delay=0&description_url=http%3A%2F%2Fwww.google.com&max_ad_duration=20000&adtest=on
I also noticed that this tag also doesn't work on VAST testers like Vast Inspector. It does seem to work in Google's inspector.
Anyone knows what's causing this issue, and how to resolve this?
Thanks a lot in advance!
On SDK documentation page, it is recommanded to use the same AdsLoader instance for the entire lifecycle of page.
I am working on a web project where user interactions with GUI creates new video elements without changing page. (and destroy previously created)
AdsLoader constructor require an AdDisplayContainer instance which itself accepts an optional HTMLVideoElement. In my case, the HTMLVideoElement should be the newly created video element.
My issue here is that AdsLoader seems to have to no method to set/replace AdDisplayContainer instance.
I would like to know, if it is an acceptable solution to destroy AdDisplayContainer and AdsLoader and re-create them for each newly created video element ? (or should I expect to have issues ?)
I am displaying preroll ads on mobile in fullscreen mode.
It works fine.
However there is an issue when clicking on the X button (top left) when in fullscreen mode, since it trigger the paused
event.
I am listening to the pause event and resume the play of the preroll video.
I would expect the paused
event to be triggered only when clicking on the pause button.
And I would expect the clicking of the X button to behave in the same way as when pinching the video with two fingers, in which case the video exit the fullscreen mode and keep playing.
What do you think?
Would be possible to avoid to trigger the paused
event when clicking on the X button?
We are trying to use the SDK but are having problems in MS Edge, the same problem seems to happen in your simple example:
http://googleads.github.io/googleads-ima-html5/simple/
In browser console we get:
[object Object]AdError 400: There was an error playing the video ad. Caused by: Error: [object MediaError]
Tested browser:
Microsoft Edge 38.14393.0.0
Microsoft EdgeHTML 14.14393
(Might be related to this issue: googleads/videojs-ima#98 )
I just notice that video tag url with '@' causes a crash after the preroll.
For example:
Result:
Ads loaded.
Ad event: loaded
Ad event: start
Ad event: firstquartile
Ad event: midpoint
Ad event: thirdquartile
Ad event: complete
Is there a workaround for this issue ?
Hi, apps that block ads are popular right now.
It would be great if google ima could detect a blocking error.
Now I have to make double requests to vast to check whether the user can load you or not.
I use a similar example as in the solution here.
https://stackoverflow.com/questions/40527328/is-it-possible-to-catch-neterr-blocked-by-client
It would be great if an event appeared on Google Ima that detected an ad block.
I have an issue with the google IMA sdk.
It seems the adDisplayContainer
it's stuck an endless update loop.
this.adDisplayContainer = new google.ima.AdDisplayContainer(
this.$refs.adContainer, this.videoContent);
When I watch the AdDisplayContainer
I get the following error:
Maximum call stack size exceeded
I have reproduced the issue in this JSFiddle:
https://jsfiddle.net/fraMussi/53f6vbjh/7/
And made a question on StackOverflow:
https://stackoverflow.com/questions/61640725/maximum-call-stack-size-exceeded-with-vue-google-ima-sdk
Could you be so kind to have a look?
Dear googleads-ima html5 team,
From the release notes, it reads:
|3.186.1 | 12/7/2017 | AdErrorEvent.getInnerError() may now return an inner AdError object. This allows checking to see if autoplay failed.|
I created a codepen to have a try on this, but I can't see an autoplay issue get caught, the codepen link is: https://codepen.io/anon/pen/ppWOPN .
I am using Chrome v63, with autoplay policy set to "Document User Activation is Required". (For what I am seeing is that the player is freezing on the first frame of the video ad, but no adError message from web console )
Is there anything I've missed?
Thanks,
Iries
Hi
Help I did not understand how to use the vpaid sample.
Where can I find the documentation?
How to connect the vast xml stream to this script?
Below is flvjs's Features
and I want to ask is it could use Google IMA SDK?(Live broadcast for example)
and I found title 'Request video ads' with below code
// Request video ads.
var adsRequest = new google.ima.AdsRequest();
adsRequest.adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' +
'sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&' +
'impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&' +
'cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator=';
I want to ask what is adTagUrl , and where it come from?
I have 2 video.js players on a page. When I click on play button on the first player, ads do not play. Basically I referred to this example https://github.com/googleads/videojs-ima/blob/master/examples/simple/index.html and added 2nd player. Could this possibly be an issue with IMA SDK? Here is a link to my test page : http://solutions.brightcove.com/gsaxena/ima/
The simple and advanced samples do not load correctly on some mobile devices, causing the play button to not appear. Playback seems unaffected on desktop browsers.
Flash has been pronounced dead by most media in 2015, Google AdWords officially announced it in February 2016, that Flash ads will be disabled for new campaigns "Starting June 30th, 2016".
In my opinion it's time to move from Flash to Javascript creatives and enable VPAID2 Javascript by default in all examples. It's documented here "Enabling VPAID 2 support". Thanks.
Hi Team,
AD URL
i am getting "Ad error: AdError 1009: The VAST response document is empty." for "advanced" and "simple" examples, But the same ad url plays in google vast inspector
Controls are not getting displayed on HTML 5 Player when IMA is integrated.
I even tried to seek out the help from the examples but haven't got success. The examples that are mentioned in this repo uses the custom controls out side the player.
Hello, I have a simple question.
I use ima3 to load mpegdash format in Chrome browser, It can't play advert.
But it can play in Edge browser.
this problem is normal?
Thank you for considering my request.
hi, i got this error while running simple example.
Uncaught SyntaxError: Unexpected identifier
'+V(ky(d))+':1 Failed to load resource: the server responded with a status of 404 (Not Found)
'+V(ky(b))+':1 Failed to load resource: the server responded with a status of 404 (Not Found)
'+V(ky(f))+':1 Failed to load resource: the server responded with a status of 404 (Not Found)
bridge3.389.0_en.html:1032 Uncaught ReferenceError: ima is not defined
at bridge3.389.0_en.html:1032
how to reproduce:
loadSdk: function() {
var script = document.createElement('script')
script.setAttribute('src', '//imasdk.googleapis.com/js/sdkloader/ima3_debug.js') // debugging mode
script.onload = this.requestAds.bind(this)
document.getElementsByTagName('head')[0].appendChild( script )
}
I'm doing this but on iOS (only?) it doesn't work:
" [ 0.728s] [ima.loader.AdSourceFetcher] Creating VastAdSource." bridge3.95.1_debug_en.html:483
" [ 0.731s] [ima.loader.VastAdSource] hasMoreAds, this.ads.length: 1 , this.currentAdIndex: -1" bridge3.95.1_debug_en.html:483
" [ 0.733s] [ima.loader.VastAdSource] getNextAd, this.currentAdSource: null" bridge3.95.1_debug_en.html:483
" [ 0.734s] [ima.loader.VastAdSource] hasMoreAds, this.ads.length: 1 , this.currentAdIndex: -1" bridge3.95.1_debug_en.html:483
" [ 0.737s] [ima.loader.VastAdSource] processNextAd_, currentAdIndex: 0, ads.length: 1" bridge3.95.1_debug_en.html:483
" [ 0.740s] [ima.loader.VastAdSource] processInlineAd, successCallback with 1 ads" bridge3.95.1_debug_en.html:483
" [ 0.742s] [ima.loader.VastAdSource] hasMoreAds, this.ads.length: 1 , this.currentAdIndex: 0" bridge3.95.1_debug_en.html:483
" [ 0.744s] [ima.loader.AdsLoaderImpl] exhaustAdSource_, calling success for 1 ads" bridge3.95.1_debug_en.html:483
" [ 0.746s] [ima.loader.AdsLoaderWrapper] dispatchAdsManagerLoadedEvent_, ads.length: 1" bridge3.95.1_debug_en.html:483
" [ 0.749s] [ima.managers.AdsManagerFactory] createAdsManager, adType: video" bridge3.95.1_debug_en.html:483
" [ 0.945s] [ima.managers.BaseAdsManager] Could not display companion ads." bridge3.95.1_debug_en.html:483
" [ 15.952s] [ima.vast.VideoAdEventTracker] dispatching event mediaLoadTimeout" bridge3.95.1_debug_en.html:483
" [ 15.957s] [ima.managers.VastVideoAdsManager] Playback error: [object Object]" bridge3.95.1_debug_en.html:483
" [ 15.969s] [ima.common.ErrorUtils] Error play dispatched: AdError 402: VAST media file loading reached a timeout of 15 seconds."
It works though I do not add the script async, but add it directly in the dom. Any idea?
not working in UC Browser as well as some other Browsers. UC Browser add it's default video player top of it any solution please.
Hi Team,
Have used ad url "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&cmsid=496&vid=short_onecue&correlator="
which is VMAP xml contains pre-roll, midroll (15s) , post-roll ad
Player plays pre-roll and midroll fine. But not post-roll ad
Have used various VMAP ad urls provided by google ima sdk "https://developers.google.com/interactive-media-ads/docs/sdks/html5/tags" and facing issue with post-roll ad
Used simple example provided in github
Thanks and Regards
BHARATH SN
I'm having problems with the skippable ads in iOS, the ad displays correctly but when it finishes it doesn't return to continue with the video playback, in the repo https://github.com/googleads/googleads-ima-html5/tree/master/mobile_auto_skippable you can play the problem, someone has some solution or alternative.
Thanks
Cano
``
Hello,
Nonlinear ads in VMAP not working. When Html5 IMA SDK support it?
in samples we have
<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>
but http://rmcdn.2mdn.net/Demo/vast_inspector/android.mp4 is not found
rmcdn.2mdn.net seems dead
We have been using this for years, and just recently it's begun to stop serving ads. Diving into the errors, I see its throwing "Failed to initialize ad playback element before starting ad playback." and I can not seem to find why.
If I look through the VAST URL from Adsense, the creatives are coming in just fine, it should be running the chosen ad(s). But the player throws this error for some reason. We'd really like to figure out how we can resolve this issue. Currently costing us hundreds $$$ a day in lost revenue.
var adVideoContainer = document.getElementById('ad-video');
var adDisplayContainer = new google.ima.AdDisplayContainer(adVideoContainer);
var adsLoader = new google.ima.AdsLoader(adDisplayContainer);
adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED, function(adEvent){
console.log('ADS_MANAGER_LOADED');
onAdsManagerLoaded(adEvent);
}, true);
adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR, function(adEvent) {
console.log('AD_ERROR');
onMediaEnd();
},false);
function onAdsManagerLoaded(adEvent)
{
var adsRenderingSettings = new google.ima.AdsRenderingSettings();
var adsManager = adEvent.getAdsManager({
currentTime: 0
});
window.adsManager = adsManager;
adsManager.addEventListener( google.ima.AdErrorEvent.Type.AD_ERROR, function(adEvent) {
console.log('AD_ERROR');
onMediaEnd();
});
adsManager.addEventListener( google.ima.AdEvent.Type.ALL_ADS_COMPLETED, function(adEvent) {
console.log('ALL_ADS_COMPLETED');
onMediaEnd();
});
adsManager.addEventListener( google.ima.AdEvent.Type.COMPLETE, function(adEvent) {
console.log('COMPLETE');
onMediaEnd();
});
adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,function(adEvent){
console.log('LOADED');
var ad = adEvent.getAd();
var adData = adEvent.getAdData();
console.log(adData);
if (!ad.isLinear())
{
// show game content
onMediaEnd();
}
else
{
// Ad is being shown, lets do nothing for now...
}
});
try
{
adsManager.init(640, 480, google.ima.ViewMode.NORMAL);
adsManager.start();
}
catch (adError)
{
// this is currently where the ad keeps failing!
console.log(adError);
onMediaEnd();
}
}
var adsRequest = new google.ima.AdsRequest();
adsRequest.adTagUrl = '<?=$adsenseVASTURL?>';
adsRequest.linearAdSlotWidth = 640;
adsRequest.linearAdSlotHeight = 480;
adsRequest.nonLinearAdSlotHeight = 480;
adsRequest.nonLinearAdSlotWidth = 640;
adsLoader.requestAds(adsRequest);
Dear @shawnbuso
with the release of 1 1/2 weeks ago google ima sdk is kinda broken for us.
We are using videojs with your videojs-ima plugin. We actually are on the latest tag (0.8.0, unfortunatelly it is cloaking itself as 0.7.0 in videojs), but since few days only - so we don't think upgrading from videojs-ima github tag 0.6.0 to 0.8.0 did break the behaviour nor did it improve the situation.
We do but think that for some reason the ima sdk does not reuqest ad-video in all cases anymore - one sees the xml-file-reuqest, but no ad-file is done subsequently. This is being true for 15% of our traffic now.
Love to get in touch with you on how to best communicate this issue.
regards
Benedikt
I recently test the VPAID sample (Single VPAID 2.0 Linear) on IMA Sample Tags page using Video Suite Inspector.
The video can play but not clickable.
I've checked the sample tag which has ClickTracking url embedded. To my knowledge, video player should respect this setting and follows the url when user clicks video.
Does someone know why this is not functioning?
It is confused when i use IMA HTML5 SDK for game, it is difficult to find any useful information let me use IMA HTML SDK in my games. there only samples about video. Could you provide official sample about IMA HTML5 SDK for game ?
Hi Shawn,
i am trying to play ad in iphone safari browser but it is not able to play the ad. may be the problem is youtube api iframe flash player. please suggest me what should i do now?
I have tested the Advanced sample, and I found out that using https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dlinear&correlator= (or any of the first 3 linear Ads from https://developers.google.com/interactive-media-ads/docs/sdks/html5/tags), the Ad never plays, and there's an error in console; however, using more complex tags (like https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpod&cmsid=496&vid=short_onecue&correlator=) they play just fine.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.