[go: nahoru, domu]

The IMA Dynamic Ad Insertion (DAI) SDK lets apps make stream requests for ad and content video streams, either VOD or live content. The SDK then enables a video player to play the combined stream so you don't have to manage switching between ad and content video within your apps.

To improve support for HTML5 publishers, we have expanded the features provided by the Video.js-IMA plugin to include DAI for HLS streams. With the latest version of the plugin, you can enable a Video.js player to request ads and content in a single HLS stream. Check out the new DAI sample app and the DAI README file for implementation details on how the Video.js-IMA plugin can simplify your IMA DAI integration.

For more information on IMA DAI, please see the IMA HTML5 DAI getting started guide. If you have any questions or feedback about using DAI with the Video.js-IMA plugin, please raise an issue on GitHub.



CAF DAI SDK ReleasedThe Interactive Media Ads team is excited to announce that we’ve teamed up with the Cast Application Framework team to bring you the CAF DAI SDK, a fully supported solution for casting DAI video streams to Chromecast devices. This project is a complete rewrite of our original IMA SDK for Cast, significantly reducing the amount of code publishers need to write and streamlining the integration between the two SDKs.

The CAF DAI SDK provides a deep integration with Chromecast Application Framework's native Ad Breaks, meaning that adding around 30 lines of code to an existing CAF receiver can enable:
  • DAI support for both Live and VOD streams
  • Media queue management
  • Sender and receiver UI, including ad break markers
  • Bidirectional communications between sender and receiver
  • Skippable ad support on VOD streams

With the previous SDK, all of these functions required manual implementation.


A fully-featured CAF DAI integration



IMA SDK for Cast deprecatedAs of December 13, 2021, both the client-side and DAI versions of the IMA SDK for cast are now deprecated. Publishers who are currently using the IMA SDK for cast to implement client-side advertisements are encouraged to migrate to using CAF native ad breaks. Publishers who are currently using the IMA SDK for cast to implement DAI advertisements are encouraged to migrate to the new CAF DAI SDK. These new implementation options offer publishers significantly simpler integrations with better stability and tighter integration with the entire cast ecosystem.
Advertisement Type Deprecated Solution Recommended Solution
Client Side IMA SDK for Cast CAF native ad breaks
DAI IMA SDK for Cast CAF DAI SDK

The Client side and DAI versions of the IMA SDK for Cast will continue to function for the foreseeable future but support and new development will be focused on the CAF DAI SDK moving forward. The IMA SDK team will continue to offer best attempt support for the deprecated SDKs through December of 2022, however, some limitations of the older platform may only be resolved by migrating to the new workflows described above.


We highly recommend that publishers who are currently using the older IMA SDK for Cast begin migrating to these new workflows for improved stability, simplified integration, and a much more polished developer experience.





For more information about these changes, check out the developer documentation. If you have any issues migrating your integration from the IMA SDK for Cast to the CAF DAI SDK, feel free to reach out via our developer forums.

Updated (3/16/2021): We have launched the new “pause” behavior on 25% of IMA traffic. This feature will be enabled on 100% of IMA traffic by April 16, 2021. Publishers looking to temporarily disable the new pause behavior may do so using the ImaSdkSettings.setFeatureFlags() API:

adsLoader.getSettings().setFeatureFlags({'disableClickAdPause': true});

This feature flag will be available to publishers to disable the new pause behavior until June 1, 2021 to give publishers more time to make the recommended changes outlined below. After June 1, 2021, this feature flag will no longer function and will become a no-op.

Update (1/14/2021): The new target date for the changes to pause behavior to begin to launch is February 14th, 2021. Initially these changes will only affect a low percentage of requests in order to allow publishers time to make any adjustments without affecting their entire inventory. These changes will ramp up to 100% of IMA impressions on March 2nd, 2021.

Update (11/13/2020): The November 9th launch got rolled back due to the release negatively impacting some publishers. These changes are now being delayed until Q1 2021, with a more specific date to follow. The new date has now been updated in the below text.

Update (10/27/2020): The targeted date for the changes to pause behavior is now set for November 9th, 2020. This has been updated in the below text, instead of the original date of October 13th, 2020.

The IMA SDK is preparing to release changes to pause behavior when user clicks cause navigation away from the page or app. When this happens, the ad will be paused automatically by the SDK. These changes will launch on February 14th, 2021 for a low percentage of IMA requests. By April 16th, 2021 the changes to pause behavior will ramp up to affect 100% of IMA requests.

The IMA client-side SDKs already pause ad playback for ad click-throughs, but these changes add automatic pausing to many other user actions. The IMA DAI SDKs currently do not pause for any click events. For either implementation, if your code does not already provide a way for users to resume ad playback when ads are paused, we recommend adding a way to resume ad playback following ad pause events.

When the SDK automatically pauses the ad, the PAUSED event will be fired. We recommend that publishers listen for this event, and update the UI to allow the viewer to resume the ad. If this UI is not shown, the player may be permanently paused on the ad without a way for the user to resume ad or content playback.

Client-side changes

  • On Desktop web, the SDK will automatically pause when the user clicks on an ad which results in navigation away from the page.
    • This behavior already exists for mobile web and mobile apps.
  • On all platforms, the SDK will attempt to automatically pause if the user clicks on the:
    • Learn more button
    • Ad click (desktop)
    • Non-linear ad
    • Icon click
    • AdChoices icon

Dynamic Ad Insertion (DAI) changes

  • On all platforms for DAI, the SDK will attempt to automatically pause if the user clicks on the:
    • Learn more button
    • Ad click (desktop)
    • Icon click
    • AdChoices icon

Pause events

The table below shows which API is called when a pause event occurs:

IMA platform SDK version Pause event for client-side SDK Pause event for DAI SDK
HTML5 The current evergreen version. google.ima.AdEvent.Type.PAUSED The video player’s pause event.
Android V3.20.0 and later. videoAdPlayer.pauseAd() videoStreamPlayer.pause()
iOS/tvOS All versions kIMAAdEvent_PAUSE kIMAAdEvent_PAUSE

Note: For Android, the onPause event is only available on v3.20.0 and later. For previous versions the IMA SDK will not automatically pause ads, and developers will not have to implement these changes.

Please see the following code snippet as an example of setting up a listener for the PAUSED event for a client-side HTML5 IMA SDK implementation:

adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED, function() {
    showAdResumeUI();
});

function showAdResumeUI() {
  // TODO: Add a play button that resumes playback.
}

Please review your IMA SDK integrations and make any necessary adjustments to handle the pause event so that you’re prepared for when the changes go live on February 14th, 2021. Please look for announcements about pause behavior changes in the IMA HTML5 SDK release notes. If you have questions about making these changes for your own IMA SDK integrations, feel free to reach out to us on the IMA SDK forum.

The Secure Interactive Media Interface Definition (SIMID) is a new ad format for interactive video ads. It was designed to be the successor of the Video Player Ad-Serving Interface Definition (VPAID) according to the Interactive Advertising Bureau. SIMID addresses many of the issues with VPAID, including slow loading times, security limitations, and being difficult to debug with only a single error code (901).

SIMID support is available in the HTML5, Android, and iOS IMA SDKs for client-side ads starting with the following releases:

Improvements in the SIMID API Model over VPAID

Unlike VPAID, the code for SIMID ad creatives runs in a secure sandbox so that it cannot access other resources on the page. With SIMID, the player maintains control while the creative sends messages to the player about which actions are needed to perform its functions. This is demonstrated in the diagram below:

As a result, SIMID offers the following advantages over VPAID:

  • Improved security by sandboxing the ad from the publishers page
  • Improved asset transparency by including the media file in the VAST response
  • Support for pre-caching
  • Faster load times
  • Improved error reporting from more granular error codes

Using SIMID with the IMA SDK

SIMID creatives are ready to be used within VAST ad-tags. To get started, see the IAB’s example on GitHub or test it yourself using this SIMID ad tag. If you have questions about the IMA SDK, see the SDK documentation or reach out to us on the IMA SDK forum.

With the release of version 3.16.0 of the Interactive Media Ads SDK (IMA SDK) for Android, the location where we host the SDK has changed to Google's Maven Repository.

As a result of this change, your Android project should include a reference to the google() repository (Google's Maven Repository) as a dependency. Previously, the SDK was hosted on JCenter. You can now remove the jcenter() reference from your Android project’s build.gradle file, as long as none of your other dependencies are hosted there.

The google() repository should be referenced in the project-level build.gradle file of your project. You should then import the IMA SDK in the app/build.gradle file. See an example in the following code snippet from the Adding the IMA Android SDK to the player app section of the Android IMA SDK getting started guide.

repositories {
    google()
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.16.0'
}

Another change that comes from this update is that the com.google.android.gms:play-services-ads-identifier target is now included as a dependency of the IMA SDK and is no longer required to be explicitly included in the app/build.gradle file.

If you have questions about the IMA SDK for Android, please see the SDK documentation, or reach out to us on the IMA SDK forum.

(If you want to continue getting email updates about our blog posts, read on. If you don't want email updates from this blog, you can skip this post.)

For some products, the Google Ads Developer team has used Google groups as a way to allow API users to subscribe and get new relevant blog posts delivered to their email address. Starting now, the way you can get email updates about blog posts is changing. We will no longer send an email to the Google group for each new blog post. We will continue to use the Google groups for other important updates, however.

For users who still want email updates, we've introduced new FeedBurner links on the right-hand panel of our blog homepage. You can subscribe to the RSS feed by clicking on the link for the product you're interested in, or subscribe by email by clicking on the [+] link to the right of the product name.

If you use any of the APIs that we discuss on this blog, make sure you subscribe to the feed to keep up with the latest news and updates:

On May 15, 2018, Google will be sunsetting Flash in the IMA SDKs. This change will affect all users of the Flash IMA SDK, and a very small number of users of the HTML5 IMA SDK.

Changes to the Flash SDK As of May 15, 2018, attempts to load the Flash IMA SDK will fire an AdErrorEvent.AD_ERROR from the AdsLoader. This is a change to the portion of the Flash SDK that is loaded at run time, and therefore will affect all Flash SDK implementations in production. If you've followed our implementation best practices, your handler for this error will play your content video:


private function initAdsLoader():void {
  ...
  adsLoader.addEventListener(AdErrorEvent.AD_ERROR, adsLoadErrorHandler);
}

private function adsLoadErrorHandler(event:AdErrorEvent):void {
  trace("warning", "Ads load error: " + event.error.errorMessage);
  videoPlayer.play();
}
We strongly encourage all publishers still using the Flash SDK to migrate to the HTML5 SDK. As part of this sunset, we will also be removing the Flash SDK documentation from developers.google.com and removing the Flash samples from GitHub.

Changes to the HTML5 SDK As of May 15, 2018, the HTML5 IMA SDK will stop supporting all Flash ads. This includes linear, non-linear, and companion ads. If your VAST response includes only Flash media files, the IMA SDK will throw error 403 - VAST_LINEAR_ASSET_MISMATCH for linear ads, and error 503 - VAST_NONLINEAR_ASSET_MISMATCH for non-linear ads. Flash companion ads will fail silently. The HTML5 SDK stopped supporting Flash VPAID ads with the deprecation of the Flash IMA SDK last June.


As always, if you have any questions, feel free to contact us via the support forum.


As previously announced, as of March 15th, 2018, the Google Media Framework (GMF) for Android is deprecated in favor of the IMA ExoPlayer plugin. All development and support for GMF has been halted. If you are a GMF Android user, we recommend you migrate to the IMA ExoPlayer plugin at your earliest convenience. Alternatively, to keep using GMF Android, you will have to fork and maintain it yourself.

Note: We are NOT deprecating GMF for iOS.

If you have any questions, feel free to contact us via the IMA SDK developer forum.

We’re excited to announce that we’ve teamed up with the Accelerated Mobile Pages team to bring you amp-ima-video, an IMA-SDK-enabled video player extension for AMP pages. This extension has been an AMP experiment for the past few months, but today we’re moving from experiment to public release.

amp-ima-video provides an AMP-enabled video player with the IMA SDK pre-integrated, so you can easily play and monetize content on your AMP pages. Simply provide your content URL and an ad tag, and we’ll handle playing back the video and ad(s). The extension currently supports linear in-stream single ads and VMAP playlists. To see it in action, check out the AMP by Example page for the extension.

If you have any questions or issues with the extension, please file them via the AMP issue tracker on GitHub.

With the release of v3.7.0 of the IMA iOS SDK, we will stop providing forum support and bug fixes for iOS IMA SDK issues specifically related to iOS 8 and below.

What does this mean if an app is currently targeting iOS 8?

  • There are no changes in v3.7.0 specifically designed to break compatibility, so the iOS IMA SDK will continue to work with iOS 8 in the short term. However, future releases are not guaranteed to continue to work with iOS 8.
  • Bugs that only affect iOS 8 will no longer be investigated.
  • If you are using our GoogleAds-IMA-iOS-SDK CocoaPod and want to update to v3.7.0, you'll need to start targeting iOS 9+.

What about other iOS versions?

We periodically stop supporting older iOS versions when adoption levels fall below a certain level. Whenever we end support for a major iOS release, we make announcements on our blog and release notes page.

As always, if you have any questions, feel free to reach out to us on our support forum.

MacOS High Sierra includes a new version of Safari, Safari 11. This new version by default will remove support for auto-playing videos unless they are muted. If your desktop site currently autoplays unmuted video with the IMA SDK, your users will see the first frame of the ad, but the ad will not play. To resolve this, you can either change your implementation to click-to-play, or attempt to autoplay and revert to click-to-play if that fails. We've also added a new error that will fire if the SDK is asked to autoplay an ad but is prevented from doing so by the browser. Continue reading for more info on these solutions.

Click-to-play

The simple, advanced, and playlist IMA SDK samples use this click-to-play functionality. In short, you add a play button to your UI, and render that play button on page load. Your code should then delay calls to adDisplayContainer.initialize(), adsManager.init() and adsManager.start() until the user clicks that play button.

Attempt to autoplay

We've added a new sample to our GitHub repo, Attempt to Autoplay. This sample will autoplay ads if allowed, and if not, will follow the above click-to-play workflow. The sample starts by attempting to autoplay the content video. If autoplay succeeds, it pauses the content to play a pre-roll. This happens in an instant, so the users will not see any content actually play before the ads. If this autoplay attempt fails, the sample renders a play button and waits for the user to click that button to initialize the ad display container and play ads.

New error for failed autoplay

We've added AdError.ErrorCode.AUTOPLAY_DISALLOWED which the SDK will fire if it is asked to autoplay an ad but is prevented from doing so by the browser. You should not see this error if you've properly implemented one of the solutions above. This error is wrapped in a VIDEO_PLAY_ERROR; you can look for it as follows:

onAdError(adErrorEvent) {
  if (adErrorEvent.getError().getInnerError().getErrorCode() ==
      google.ima.AdError.ErrorCode.AUTOPLAY_DISALLOWED) {
    // The browser prevented the SDK from autoplaying an ad.
  }
}

If you have any questions, feel free to reach out to us on our support forum.

On March 15, 2018, we are stopping development and support for Google Media Framework (GMF) for Android in favor of the new ExoPlayer IMA extension. GMF's technology and approach are based on an older version of ExoPlayer.

The new v2 version of ExoPlayer and the ExoPlayer IMA Extension make basic integration simple enough that a layer between ExoPlayer and the IMA SDK is no longer necessary. The new approach is cleaner, requires less code, and uses the most up-to-date version of ExoPlayer.

Support for GMF for Android will end on March 15, 2018, after which we will no longer respond to issues or make any further releases of GMF for Android. The repository will also be shut down at this time. If you want to access the code, you can clone the repository before the March 15, 2018 shutdown date.

Note: We are NOT deprecating GMF for iOS.

If you have any questions, feel free to contact us via the IMA SDK developer forum.

Users of ExoPlayer, an extensible, open-source media player for Android, can now easily integrate with the IMA SDK using the new ExoPlayer IMA extension. The IMA extension, released alongside ExoPlayer 2.5, wraps the IMA SDK for Android and provides seamless ad playback.

The extension ensures that ads are integrated into ExoPlayer's video timeline, and UI components are ad-aware. It also reduces buffering by eliminating the need to swap out and rebuffer the video player's source when transitioning between ads and content.

You can find more details on the extension in ExoPlayer's blog post on Medium, and find the extension on GitHub. If you have any questions or issues, please file them on ExoPlayer's issue tracker.

Starting with iOS 10, Safari on iPhone and iPod supports inline video playback. This opens up some new rendering options for your video player and the IMA SDK, but also introduces some caveats.

So what changed?

Previously, Safari on iPhone played all video in a fullscreen player. With iOS 10, Safari now supports the playsinline parameter on a video element to play that content inline.

Fullscreen playback on iPhone Mobile Safari. The default with iOS 10+ and the only option for iOS <= 10

Inline playback on iPhone Mobile Safari. A new option in iOS 10+

How will the IMA SDK work with inline video playback on mobile Safari?

On iPhone Safari, the IMA SDK re-uses your content player to play ads. We call this "custom playback." So if you add the playsinline parameter to your content video tag, IMA ads will also play inline - it's as easy as that.

Inline video playback also opens the door for the IMA SDK to play skippable ads on iPhone Mobile Safari. Previously these ads were dropped by the SDK because we could not render a skip button on top of the fullscreen player. If your player is inline, however, we can render that skip button, but there's a catch.

So what's the catch?

IMA SDK skippable ads are not supported with the "custom playback" method. To use skippable ads, you'll need to use our new API, ImaSdkSettings.setDisableCustomPlaybackForIOS10Plus(). This will cause the IMA SDK to render the ad in its own inline player on top of your content player. That player does support skippable ads. Disabling "custom playback", however, will break your fullscreen implementation for iPhone web.

Why do I need custom playback on iOS?

The need for "custom playback" on iOS boils down to one thing - fullscreen support. Mobile Safari only supports fullscreen via videoPlayer.webkitEnterFullscreen(). In this mode, the SDK cannot render anything on top of your content player. Therefore, to support fullscreen ad playback we must use "custom playback".

What if I want skippable ads and fullscreen support?

Unfortunately, this is not possible on mobile Safari today - you must choose between support for skippable ads and support for fullscreen.

What's the deal with iOS <10?

Prior versions of iOS (<10) do not have support for playsinline, so pages in those environments will always use "custom playback" mode, with support for fullscreen but no support for skippable ads.

I'm still confused.

That's OK! This is a complicated change with a lot of moving parts. Below is a support matrix outlining what is and is not supported based on your content player's playsinline mode and the "custom playback" mode you've set for the IMA SDK. Remember, this matrix only applies to iOS 10 and above - anything running version iOS 9 or below falls into the top left quadrant of the matrix, as this is the only option.

To help developers integrate with the IMA SDK, we're always looking for ways to provide both basic and advanced examples of features supported by the SDK. Toward this end, we're pleased to release a sample JavaScript VPAID creative and sample ad tag to aid in troubleshooting JavaScript VPAID 2.0 creatives. You can check out the new sample on GitHub, and find the new ad tag in our list of IMA sample tags as 'Sample VPAID 2.0 Linear'.

The VPAID sample plays a linear video ad and demonstrates the use of the video player proxy element required to run a VPAID ad in a secure iframe.

If you have any questions, feel free to contact us via the IMA SDK developer forum.

With the advent of video players that support streaming media formats such as HLS and DASH, publishers can now easily support these formats with the IMA SDK for Android. Here is a list of steps to make this work:

  • Use a video player that can play streaming video, such as ExoPlayer.
  • Inform the SDK of your video player's capabilities.

The latter is done via the SDK's AdsRenderingSettings API. Create a new instance of AdsRenderingSettings and then create a list of MIME types you plan to support:

AdsRenderingSettings adsRenderingSettings = 
    ImaSdkFactory.getInstance().createAdsRenderingSettings();
ArrayList arrayList = new ArrayList();
arrayList.add("application/x-mpegURL"); //HLS
arrayList.add("application/dash+xml"); //DASH
adsRenderingSettings.setMimeTypes(arrayList);

Then initialize the AdsManager using these AdsRenderingSettings:

adsManager.init(adsRenderingSettings);

This will allow the SDK to choose streaming ad media to play in your video player. Make sure to add any additional MIME types you plan to support, such as MP4, as this approach assumes that any MIME types not passed in are not supported.

FAQ

How do I play HLS ads using the IMA SDK for iOS?

The default video player used by the iOS IMA SDK supports HLS, so it is not necessary to set that in AdsRenderingSettings.

Will this work with the SDK-owned player?

No, currently you must use custom playback by implementing the VideoAdPlayer interface. For an example of how to do this, check out our guide on custom playback or AdvancedExample.

If you have any questions, feel free to contact us via the support forum.

We're pleased to announce that we'll be holding a series of Display Ads API Workshops in April 2017. These workshops are a half-day of tech talks, group discussions, networking activities, and one-on-one time with Googlers geared toward developers who use the DoubleClick for Publishers API, Interactive Media Ads SDK, or Mobile Ads SDKs.

These workshops offer you the following:

  • A great way for you to meet with the display ads API team to ask questions in person and give feedback directly to us.
  • A great opportunity to meet and exchange ideas with fellow developers in the community.
  • Previews of API and SDK roadmaps and select upcoming features.
  • For the first time, one-on-one office hours with ads API Googlers. Sign-ups will be available on-site on the day of the workshops.

The workshops will be held in the following cities:

For more information on the agenda and a preview of our talks, please see our workshop page.

As always, if you have any questions, feel free to drop us a line on the DFP API forums, IMA SDK forums, Mobile Ads SDK forums, or the Ads Developer Google+ page.

One of the most important factors in keeping users on your page or in your app is latency - the lower your latency, the more likely your users are to stick around. With this in mind, we'd like to remind you about our best practices for reducing latency with the IMA SDKs. In general, you can reduce latency by doing as much IMA set-up work as possible on page or app load, before your user tries to play a video. The following can be done in all of the SDKs before the user attempts to play a video:

  • Creating your ads loader.
  • Creating your ads request.
  • Requesting ads.
  • Obtaining the ads manager.
  • Registering ads manager event handlers.

You can find more information on optimizing latency in each of our SDKs at the links below:

As always, if you have any questions, feel free to contact us via the support forum.

On June 1, 2017, Google will cease development of Flash in the IMA SDKs. This will end support for the IMA SDK for Flash, as well as support for Flash VPAID ads in the HTML5 SDK. We strongly encourage all publishers still using the Flash SDK to migrate to the HTML5 SDK. We also strongly encourage advertisers still trafficking Flash VPAID ads to migrate those ads to JavaScript VPAID.

What does this mean for the Flash SDK?

We will not actively prevent ad serving to the Flash SDK. However, new releases will stop after June 1st and we will no longer fix bugs or answer support questions. If ad serving or playback stops working after this date for the Flash SDK, it will not be fixed. We strongly encourage you to migrate to the HTML5 SDK.

What does this mean for the HTML5 SDK?

We will no longer support Flash VPAID ads in the HTML5 SDK. Flash VPAID ads served to the HTML5 SDK will not be rendered and the SDK will fire an error. We strongly encourage you to migrate your Flash VPAID ads to JavaScript VPAID.

As always, if you have any questions, feel free to contact us via the support forum.

On February 1, 2017, we will implement a new deprecation policy for the IMA SDKs for iOS and Android. The Flash and HTML5 SDKs are unaffected by this policy because they are downloaded at runtime, so all developers are always using the latest version.

Each release will be deprecated 12 months after its successor is released.

As of February 1, 2017, the following SDK versions will no longer be supported:

  • IMA Android prior to version 3.1.3
  • IMA iOS prior to version 3.1.0

If you are currently on one of these versions, we strongly suggest upgrading to the latest version before the new policy takes effect.

Once an SDK version is deprecated, we cannot guarantee that version will continue to work. If we receive reports of crashes related to a deprecated version of the IMA SDK, we may discontinue serving ads to that version. We will also no longer field support requests for these versions on the IMA SDK support forum.

To maintain support, publishers on the latest version of an SDK will have 12 months to move to a new version once its successor is released. To "support" an SDK means we will investigate bugs in that SDK version and work on fixes. If a bug fix requires a change to the library itself, the fix will be applied to the newest version.

For a list of supported SDK versions and their deprecation dates, see the new deprecation schedule pages for iOS and Android. As always, if you have any questions, feel free to contact us via the support forum.