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

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.

You can create an IMA-integrated video player in 3 simple steps:

1. Download the video.js source and dependencies

  1. Grab the latest video.js player from videojs.com
  2. Grab the contrib-ads library from GitHub
  3. Grab the IMA plugin from our GitHub repo
Alternatively, if you’re an npm user, you can install our plugin and the above dependencies with
npm install videojs-ima

2. Declare your video player


Make sure your html file references the required JavaScript and CSS files downloaded in step one (see the example in the README for more complete HTML). Add the following code to load the IMA SDK and declare a video player:
<script type=“text/javascript” 
    src=“//imasdk.googleapis.com/js/sdkloader/ima3.js”></script>
<video id="content_video" class="video-js vjs-default-skin" controls> 
  <source src="YOUR_VIDEO_SOURCE" type="YOUR_VIDEO_TYPE" />
</video>
YOUR_VIDEO_TYPE is the encoding for your video. For more information on supported HTML5 video types, see this Wikipedia article.

3. Initialize the video player and IMA plugin


In a JavaScript block or separate JavaScript file, include the following code:
// Initialize the video.js player.
var player = videojs('content_video'); // your video tag’s id

// Declare options for the IMA plugin.
var options = {
  id: 'content_video',
  adTagUrl: 'YOUR_AD_TAG'

// Additional options available but not required.
// See our README for more info.
};

// Initialize the IMA plugin.
player.ima(options);

// Request ads.
player.ima.requestAds();

// Start video playback (will play ads if there is a pre-roll,
// content otherwise).
player.play();

With these few lines of code, you’ve got a complete video player with an IMA integration. For more information and additional documentation, see our GitHub repo README.

If you have any questions, feel free to contact us via the Google Media Framework forum.



gmf_android_landscape.png
Google Media Framework for Android


GMF Features
  • Ready to use Video player for your apps and websites
  • Demo apps include production ready integrations with the IMA ads SDK
  • GMF is free and open source, so can be customized to meet your specific needs (Send us a pull request!)
  • Easily customize the UI color and add or remove buttons
  • Support for iOS 7+ and Android 4.1+

We hope these frameworks enable you to simply make great mobile video apps and awesome web video experiences. You can send us thoughts or questions via the GMF Google group.

GitHub Links

-- The Google Media Framework Team