Coder Social home page Coder Social logo

czqasn / dlgplayer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devileo/dlgplayer

0.0 1.0 0.0 339 KB

A media player for iOS based on FFmpeg 3.2.2

License: GNU Lesser General Public License v3.0

Objective-C 97.51% GLSL 0.07% CSS 0.19% HTML 0.43% JavaScript 1.80%

dlgplayer's Introduction

DLGPlayer

A media player for iOS based on FFmpeg 3.2.2.
DLGPlayer uses kolyvan/kxmovie as reference when written and NO deprecated functions and methods are used.
If you found any deprecated function or method, please submit an issue to me.
Great thanks for Konstantin Boukreev's kxmovie.

0. Screenshots

Orientation Audio Video
Portrait
Landscape

1. Build FFmpeg for iOS

(1) Download FFmpeg source from FFmpeg official site.

Download and unzip ffmpeg-3.2.2.tar.bz2

(2) Use kewlbear/FFmpeg-iOS-build-script to build FFmpeg for iOS

Follow the steps in the README.md of kewlbear/FFmpeg-iOS-build-script to build FFmpeg for iOS.

(3) Put built FFmpeg include files and libraries into DLGPlayer/Externals/ffmpeg folder.

Put built "ffmpeg/include" and "ffmpeg/lib" folders into example project's "DLGPlayer/Externals/ffmpeg" folder.

2. Run demo

Build project and run demo on your device or simulator.

3. Play media

(1) Put any media files such as mp4 or mp3 into your server's folder.

Make sure those media files can be access by url (such as http://192.168.31.120/media.mp4) from browser.
Then input "http://192.168.31.120/media.mp4" into the text box on the top of the main view and go!

(2) Transfer any media files using file management.

Select "Local Files" in the main view.
Transfer the media files according to the tips on the top of the file management view.
Select any one media file listed in the table and enjoy it!

4. Usage

(1) Use DLGPlayerViewController to play a media file with HUD.

    DLGPlayerViewController *vc = [[DLGPlayerViewController alloc] init];
    vc.autoplay = YES;
    vc.repeat = YES;
    vc.preventFromScreenLock = YES;
    vc.restorePlayAfterAppEnterForeground = YES;
    vc.view.frame = self.view.frame;
    [self.view addSubview:vc.view];
    vc.url = @"http://192.168.31.120/media.mp4";
    [vc open];

(2) Use DLGPlayer to play a media file without HUD.

    DLGPlayer *player = [[DLGPlayer alloc] init];
    UIView *v = player.playerView;
    v.frame = self.view.frame;
    [self.view addSubview:v];
    [player open:@"http://192.168.31.120/media.mp4"];
    [player play];

See DLGPlayerViewController class for more usage details.

5. Required frameworks and libraries

  • Accelerate.framework
  • AudioToolbox.framework
  • CoreAudio.framework
  • CoreGraphics.framework
  • CoreMedia.framework
  • MediaPlayer.framework
  • OpenGLES.framework
  • QuartzCore.framework
  • VideoToolbox.framework
  • libiconv.tbd
  • libbz2.tbd
  • libz.tbd

6. References

Thank you all!

7. License

See LICENSE.

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.