Tag Archives: ima_sdk

What’s new with IMA iOS SDK Beta 15?

Last week, we released beta version 15 of the IMA SDK for iOS. This release includes two new features:

  • Ad buffer events via IMAAdsManager delegates
  • Debugging mode

Ad buffer events

We’re providing more information on ad buffering by introducing new buffering events via the following optional IMAAdsManagerDelegate methods:

  • adsManagerAdPlaybackReady:
  • adsManagerAdDidStartBuffering:
  • adsManager:adDidBufferToMediaTime:

Collectively, these delegate methods provide more transparency into buffer events, giving you more control over the user’s ad experience. For more detailed information on these new methods, take a look at the reference documentation.

Debugging mode

We’ve introduced a new debugging mode setting to allow for more verbose logging to the console. You can now set IMASettings.enableDebugMode to YES to enable debug mode. This should not be used in production, as it will show a watermark on the ad player.

A note about CocoaPods

If you’re using CocoaPods with the IMA SDK, please make sure to use at least version 0.38.

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

IMA HTML5 Rendering

The HTML5 SDK has two main ways to render ads: what we call “standard” rendering and “custom ad playback.” To avoid confusion and to keep you all informed, here’s a breakdown of those rendering modes and how the SDK decides which to use.

Standard Rendering

If you're using the HTML5 SDK you probably have a web page playing your content in a <video> element. In standard rendering, the SDK will create another <video> element and render it in the ad display container div you provided, which should be placed on top of your video player. The ads will then play in this SDK-owned video player on top of your content player. To the user, it looks like one video player switching from content to an ad, but in reality it’s another video player appearing on top of your content to play an ad and then disappearing. For a visual representation of what’s going on, see the image below.

Why use standard rendering?

The main benefit to this standard rendering involves buffering. Using a separate video player to render ads allows us to preserve your content buffer while ads are playing. If you’re playing a pre-roll, you can start loading your content when the ad starts and buffer the content the whole time the ad is playing. For mid-rolls, the separate player allows you to preserve your content buffer while ads are playing - if your viewer has buffered 10 minutes of your content, and you play an ad at the 5 minute mark, they won’t lose the content in the buffer for 00:05:00-00:10:00.

Custom Ad Playback

As avid blog readers will know, we recommend always passing in your content video element as the custom playback element. If you’re not already doing this, check out our guide to custom ad playback. The HTML5 SDK will intelligently use custom ad playback only when it deems necessary, as described below. When it’s not necessary, it will use standard ad playback.

What is custom ad playback?

When the SDK decides to use custom playback mode, it renders video ads in the same player as your content. This means you lose the buffer-related benefits of standard rendering. If your viewer has buffered 10 minutes of your content, and you play an ad at the 5 minute mark, they will lose the content in the buffer beyond the ad. Certain ad formats (such as AdSense) require an SDK-owned player and can't play in your content player.

Why use custom ad playback?

Simply put, some platforms do not support multiple, simultaneous, active video elements. On those platforms, the SDK can’t create its own ad player because the one allotted video player slot per page is already occupied by your content player. If the SDK tries to play an ad in a second video player, it will either fail to play (freezing the player) or make it impossible for the content to restart after the ad is finished (again freezing the player). Thus we must show the ad and video content in the same player.

How does the SDK know when to use custom ad playback?

The HTML5 SDK looks at the UserAgent string of each browser on which it’s loaded. When it sees a browser that it knows has trouble with multiple video elements, it uses custom ad playback. Currently those browsers are limited to Android and iPhone. We’re in the process of phasing out custom ad playback on Android 4.0+ to bring the benefits of standard playback to users.

Now you know all there is to know about HTML5 video ad rendering. As always, if you have any questions feel free to contact us via the support forum.

New Swift Samples for the IMA SDK

We’re excited to announce the addition of Swift samples to the IMA SDK! To view these samples check out our GitHub repo. Along with these new samples we’ve also added Swift snippets to our quick start guide.

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

IMA SDK for iOS Beta 13 Released

Today we’re announcing the release of beta version 13 of the IMA SDK for iOS. This release includes two new major features:

  1. The SDK can be included as a framework in your project.
  2. The SDK now supports ad playing in the background.

Importing the SDK as a Framework

Prior to today’s release, importing the SDK involved manually adding every header file to your project, importing every header file individually in your source, and manually including the required frameworks. With the new framework model, you can add a single .framework file to your app and replace all of your header import source lines with a single import statement.

For CocoaPods Users

If you use CocoaPods, your build will fail after you update to beta 13. But fear not, you can fix this in a matter of seconds with the following steps:

  1. Locate and remove each instance of an imported IMA header file in your source (these will look like #import “IMA<something>.h”).
  2. Add the following line to the first header or implementation file to access an IMA object:
    @import GoogleInteractiveMediaAds;

For Manual Importers

If you don’t use Cocoapods, your path to upgrade is slightly different. You can update using the following steps:

  1. Remove all of the IMA header files and the IMA library file from your project.
  2. Under "Build Phases” > “Link Binary With Libraries”, click the plus sign, select “Add Other...”, and navigate to the downloaded and extracted SDK files. Select GoogleInteractiveMediaAds.framework from whichever folder applies to your implementation (with or without AdMob) and click “Open”.
  3. Follow the two steps above for CocoaPods users.

Background Ad Playback

Since our launch, one of the most requested features has been background ad playback. Suppose, for example, you author a music streaming app, and you want to be able to request and play ads in the background. With today’s release, however, we now support requesting and playing ads in a background service. For more info and implementation instructions, see our Background Ad Playback guide.

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

Ads API Workshops on Display Content Now Available

A few weeks back we hosted a workshop for the Display Ads APIs and SDKs where we gave presentations on the DFP API, IMA SDK, and Mobile Ads SDK. If you weren’t able to attend, or want a refresher on something you saw that day, you can check out our presentation videos and slides. If you have any questions about those videos, feel free to ask on our respective forums:

IMA Android SDK Beta 10 released

Today we're releasing Beta 10 of the IMA Android SDK. This is primarily a service release to address performance and bug fixes, but the release also includes some API changes to be aware of.

Changes in Beta 10

  • Added ImaSdkSettings.getMaxRedirects and ImaSdkSettings.setMaxRedirects.
  • IMA API classes are now final.
  • The following AdError.AdErrorCode values have been removed:
    • API_ERROR - instead use UNKNOWN_AD_RESPONSE.
    • PLAYLIST_MALFORMED_RESPONSE - instead use UNKNOWN_AD_RESPONSE.
    • REQUIRED_LISTENERS_NOT_ADDED - was not being raised by the SDK.
    • VAST_INVALID_URL - instead use VAST_LOAD_TIMEOUT.
  • Bug fixes.

Download IMA Android SDK Beta 10

You can get this latest release of the IMA Android SDK from our IMA SDK downloads page.

Check out the release notes page to stay up to date on IMA Android SDK releases.

Other questions?

As always, feel free to drop us a line on the IMA SDK forum and follow our Google+ page for other announcements and updates.

Reducing Google Play services’ impact on APK size

Like any Android library, the Google Play services SDK impacts the final size of applications that include it. Good developers care about the size of their apps, so today we’d like to show you two ways that you can leverage the Android plugin for gradle to reduce the APK size of applications that include Google Play services.

  1. Split JAR Architecture

    Beginning with Google Play services 6.5, additional maven artifacts have been added to the Google Repository that contain single domains of functionality. This means that you can include just those portions of Google Play services that your app uses. For example, here’s how to configure gradle to incorporate the JAR that contains functionality relating to ads:


    dependencies {
    compile 'com.google.android.gms:play-services-ads:6.5.+'
    }

    That line instructs gradle to include everything Mobile Ads developers need, with the exception of the IMA SDK JAR needed for IMA applications.

    Please note that if you currently initialize Mobile Ads SDK banner ads via XML layout files, you should continue including the full Google Play services artifact. See this blog post for more information.

  2. Shrink Resources

    The Android gradle plugin supports the ability to automatically exclude unused resources during the build process via the shrinkResources gradle property. To take advantage of this in your release builds, just add “shrinkResources true” to your build.gradle file’s release configuration:


    android {
    buildTypes {
    release {
    minifyEnabled true
    shrinkResources true
    }
    }
    }

    Note that the shrinkResources property requires that minifyEnabled be set to true as well, though that’s already a good practice for release builds.

Both of these techniques are quick to implement, so consider giving them a try. In testing, the use of shrinkResources and the new, split JAR maven artifacts reduced the APK size of our Interstitial Example by 1.2MB -- almost 50%!

If you have questions about these techniques and how to put them to work in your applications, visit us on the Mobile Ads SDK forum or the IMA SDK forum.

Announcing v6.5 of the Google Mobile Ads SDK for Android

Today we’re announcing the release of v6.5 of the Google Mobile Ads SDK! It’s listed as Google Play services 6.5 (Rev. 22) in the Android SDK manager, and is available for download right now. Those of you using Android Studio should download Google Repository (Rev. 14) to get the latest Gradle artifacts.

Under the hood improvements (greater stability, more efficient use of resources) make up most of the changes, but we’re pleased to note that this will be the first version of the SDK to support a split jar architecture. Previously, the SDK was compiled as a single, all-encompassing JAR file. Beginning with this release, however, it’s also built into separate JARs, each covering a specific domain of functionality. Interactive Media Ads (IMA) and Mobile Ads developers can now reference part of the Play Services SDK without needing to import the whole thing. This in turn reduces the APK size and memory footprint of your applications.

Taking advantage of the new architecture is easy -- you just need to change how you’re incorporating the SDK in your build process. Here’s an excerpt from a typical build.gradle file for an app that uses the SDK to display mobile ads:


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:6.+'
}

And here’s one that targets the ads library specifically, new in v6.5:


dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-ads:6.+'
}

That’s it! Gradle will now incorporate the new, smaller JAR into your application. If your app consumes other services from the SDK, simply add the relevant JARs (play-services-games or play-services-location, for example) to your build file as well.

IMA developers can make this change now. If you’re a Mobile Ads developer, one important thing to note is that the new split jar architecture currently works only with projects that configure banner ads in Java code, and not in XML. We plan to support XML configurations in the future, but for now if you’re defining and configuring your AdViews in an XML layout file, you should continue to reference Play Services in the existing manner.

You can read the Google Play Services Announcement on the Android Developers Blog for a summary of what’s new with this release. For a full list of Mobile Ads SDK changes, check out our release notes. For technical questions, post them on our forum.

IMA SDK for iOS Beta 10 Release

Last week we released beta 10 of the IMA SDK for iOS. This release comes with a few new features including the following:

  • Ad rendering via the new WKWebView in iOS 8
  • Addition of calling classes in delegate methods
  • New TAPPED event for tracking user taps on the ad container

The most important thing to know about this release is that you will now need to include the WebKit framework as an optional framework in your implementation and build for 64-bit support. If you are a Cocoapods user, this will be done for you in the generated xcworkspace when you upgrade to beta 10 via pod install.

Ad rendering via the new WKWebView in iOS 8

We’ve moved ad rendering from UIWebView to the new WKWebView in iOS 8 implementations. This should fix a number of issues we saw with the old web view in iOS 8, including skip button unresponsiveness and delayed tracking event firings. As a side effect of this change, you’ll need to include the WebView framework as an optional framework in your project and build for 64-bit support. If you’re a Cocoapods user, this will be done for you when you run pod install to get the latest version of the SDK.

Addition of calling classes in delegate methods

After the beta 9 release, we noticed that a few of our delegate methods were missing a reference to their calling class, which put them out of line with iOS standards. We’ve resolved this issue in beta 10 and marked the old methods (without a reference to the calling class) as deprecated. You can see a list of the new methods in our release notes.

New TAPPED event for tracking user taps on the ad container

Since launch, one of our most requested features has been to add the ability to respond to user taps on the ad container while an ad is playing. We’re happy to announce that Beta 10 fulfills this request by adding kIMAAdEvent_TAPPED to the list of AdsManager events. You can start listening to this event by setting up your AdsManager delegate as follows:

  - (void)adsManager:(IMAAdsManager *)adsManager
didReceiveAdEvent:(IMAAdEvent *)event {
if (event.type == kIMAAdEvent_TAPPED) {
// Handle TAPPED event
}
}

This event will be fired any time a user taps on a non-clickable part of an ad (taps on the "Learn more" or "Skip" buttons will not result in a TAPPED event).

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

IMA HTML5 SDK now supports Internet Explorer 11

Today we're announcing support for Internet Explorer 11 in the IMA HTML5 SDK. The SDK is now compatible with the desktop versions of Chrome, Firefox, Safari, and Internet Explorer, as well as the mobile versions of Chrome, Safari, and the default Android browser. For more information on the supported platforms of the IMA SDK, check out the supported video player platforms.

Getting started

There are no configuration or setting changes to the IMA HTML5 SDK to enable IE11 support. If you already have a player with the IMA HTML5 SDK integrated, you can start serving to IE11 visitors immediately.

If you want to walk through integrating the IMA HTML5 SDK with an HTML5 video player, check out our quick start guide.

Older Internet Explorer versions

Currently only IE11 is supported; some publishers are using the IMA HTML5 SDK with IE10 without issues, but it isn't officially supported. SDK support will be focused on on IE11 and subsequent versions given the upgrade rate from IE10 to IE11. Version 9 and earlier of Internet Explorer are not supported by the IMA HTML5 SDK and likely will not correctly serve video ads.

Questions?

If you have any questions about Internet Explorer support or other IMA SDK questions, feel free to contact us via the support forum.