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.
Orientation | Audio | Video |
---|---|---|
Portrait | ||
Landscape |
(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.
Put built "ffmpeg/include" and "ffmpeg/lib" folders into example project's "DLGPlayer/Externals/ffmpeg" folder.
Build project and run demo on your device or simulator.
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!
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!
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];
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.
- Accelerate.framework
- AudioToolbox.framework
- CoreAudio.framework
- CoreGraphics.framework
- CoreMedia.framework
- MediaPlayer.framework
- OpenGLES.framework
- QuartzCore.framework
- VideoToolbox.framework
- libiconv.tbd
- libbz2.tbd
- libz.tbd
- FFmpeg
- kolyvan/kxmovie
- kewlbear/FFmpeg-iOS-build-script
- libav/gas-preprocessor
- Yasm
- CocoaAsyncSocket
- CocoaHTTPServer
Thank you all!
See LICENSE.