Code Monkey home page Code Monkey logo

mpmovieplayercontroller-xcdoverlayview's Introduction

About

Pod Version Platform License

Displaying some information in overlay to a movie is an easy task. Synchronizing the overlay with the playback controls of MPMoviePlayerController is a hard task. MPMoviePlayerController+XCDOverlayView lets you add your own view to a MPMoviePlayerController and automatically synchronizes it with the playback controls.

Animated Screenshot

Requirements

  • Runs on iOS 7.0 and later

Installation

MPMoviePlayerController+XCDOverlayView is available through CocoaPods.

pod "MPMoviePlayerController+XCDOverlayView", "~> 1.0.0"

Alternatively, you can manually use the provided static library. In order to do so you must:

  1. Create a workspace (File → New → Workspace…)
  2. Add your project to the workspace
  3. Add the MPMoviePlayerController+XCDOverlayView project to the workspace
  4. Drag and drop the libMPMoviePlayerController+XCDOverlayView.a file referenced from MPMoviePlayerController+XCDOverlayView → Products → libMPMoviePlayerController+XCDOverlayView.a into the Link Binary With Libraries build phase of your app’s target.

These steps will ensure that #import <MPMoviePlayerController+XCDOverlayView/MPMoviePlayerController+XCDOverlayView.h> will work properly in your project.

Usage

MPMoviePlayerController+XCDOverlayView is a category on MPMoviePlayerController which adds a single property:

@property (nonatomic, strong) UIView *overlayView_xcd;

Here is a basic usage example:

MPMoviePlayerViewController *moviePlayerViewController = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
[self presentMoviePlayerViewControllerAnimated:moviePlayerViewController];
UIView *overlayView = [UIView new];
// Add subviews to overlayView
moviePlayerViewController.moviePlayer.overlayView_xcd = overlayView;

The overlayView will be automatically resized to always fit between the top and bottom playback control views. The easiest way to position your views is to use Auto Layout inside the overlay view. See the demo project for an example of subviews centered and aligned at the top and bottom.

## Limitations

  • MPMoviePlayerController+XCDOverlayView only works with full screen movie player controllers.

  • Although MPMoviePlayerController+XCDOverlayView doesn't user private APIs, it relies on implementation details, see the PlaybackControlViews function.

License

MPMoviePlayerController+XCDOverlayView is available under the MIT license. See the LICENSE file for more information.

mpmovieplayercontroller-xcdoverlayview's People

Contributors

0xced avatar

Watchers

James Cloos avatar yaolizhi 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.