Giter Site home page Giter Site logo

jontsnz / google-media-framework-ios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from googleads/google-media-framework-ios

0.0 2.0 0.0 679 KB

The Google Media Framework (GMF) is a lightweight media player designed to make video playback and integration with the Google IMA SDK on iOS easier.

License: Apache License 2.0

Ruby 2.90% Objective-C 96.10% C 1.00%

google-media-framework-ios's Introduction

#Google Media Framework for iOS

Build Status

##Introduction The Google Media Framework (GMF) is a lightweight media player designed to make video playback and integration with the Google IMA SDK on iOS easier.

Google Media Framework iOS Demo

##Features

  • A simple video player UI for video playback on iOS.
  • Easily integrate the Google IMA SDK to enable advertising on your video content.

##Getting started The easiest way to get started is by using CocoaPods.

Create a new single view xcode project, then add the following line to your Podfile:

pod "GoogleMediaFramework", "~> 1.0"

Then run

$ pod install

Then close your project in xcode and open the new xcworkspace that Cococapods just created:

$ open YourProjectName.xcworkspace

Find your new project's ViewController.m and add the following line at the top:

#import <GoogleMediaFramework/GoogleMediaFramework.h>

Then, add a viewDidAppear method:

- (void)viewDidAppear:(BOOL)animated {
  [super viewDidAppear:animated];

  // An example url for the video content.
  NSString *videoURL = @"http://devimages.apple.com/samplecode/adDemo/ad.m3u8";

  // Init the video player view controller.
  GMFPlayerViewController *videoPlayerViewController = [[GMFPlayerViewController alloc] init];

  // Tell the player to play our content url.
  [videoPlayerViewController loadStreamWithURL:[NSURL URLWithString:videoURL]];

  // Tell the video player to start playing.
  [videoPlayerViewController play];

  [self presentViewController:videoPlayerViewController animated:YES completion:nil];
}

Now run your new app, and you should see the video player appear and start playing. (=Note: The close button will not work, as your application needs to know what to do when it is clicked. For a more in-depth example, see the demo app included with the framework.

The demo application shows a more advanced implementation using a UINavigationController to select from different video content and ad tags.

To try the demo app included with the Google Media Framework, clone the Google Media Framework Github repository, generate the xcworkspace file via pod install and open it.

$ git clone https://github.com/googleads/google-media-framework-ios.git GoogleMediaFramework
$ cd GoogleMediaFramework/GoogleMediaFrameworkDemo
$ pod install
$ open GoogleMediaFrameworkDemo.xcworkspace

You can now build the demo project and select a video to play.

The demo app includes the Google Interactive Media Ads (IMA) SDK, which allows you to monetize your video content using Doubleclick for Publishers.

If you don't want to use CocoaPods, you should be able to integrate the framework by cloning the project and manually adding the classes and image resources to your project.

##Where do I report issues? Please report issues on the issues page.

##Support If you have questions about the framework, you can ask them at http://groups.google.com/d/forum/google-media-framework

##How do I contribute? See CONTRIBUTING.md for details.

##Requirements

  • iOS 6.1+

google-media-framework-ios's People

Contributors

tensafefrogs avatar hariharsubramanyam avatar shawnbuso avatar matrad avatar cweill avatar gdambrauskas avatar bshaparenko avatar nvkiet avatar readmecritic avatar

Watchers

John FitzGerald avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.