Tag Archives: ima_sdk

Announcing the IMA SDK AMP Extension

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.

Ending support for iOS 8 in the IMA SDK

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.

Changes to autoplay in Safari 11 for desktop

MacOS High Sierraincludes 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.

Deprecating GMF for Android

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.

ExoPlayer Releases IMA Extension

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.

New Custom Playback APIs for IMA HTML5 and Mobile Safari

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.

New VPAID Sample for the IMA HTML5 SDK

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.

Playing streaming ads with the IMA SDK for Android

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 VideoAdPlayerinterface. 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.

Register now for the April 2017 Display Ads API Workshops

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 Googlersgeared 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.

Register now for the April 2017 Display Ads API Workshops

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 Googlersgeared 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.