Skip to content

Working with the IJKPlayer iOS version

Asha edited this page Nov 17, 2016 · 4 revisions

Build iOS

  • clone the repo
$ git clone https://github.com/ashqal/ijkplayer.git ijkplayer-ios
  • make sure the repo is
$ git clone https://github.com/ashqal/ijkplayer.git ijkplayer-ios
  • check again
$ git clone https://github.com/ashqal/ijkplayer.git ijkplayer-ios
  • build for the FFMPEG with ijkplayer
$ cd ijkplayer-ios
$ git checkout -B latest k0.6.0

$ ./init-ios.sh

$ cd ios
$ ./compile-ffmpeg.sh clean
$ ./compile-ffmpeg.sh all
  • open the demo
// under the ijkplayer-ios folder

$ git checkout MDExtDemo
$ cd ios/IJKMediaDemo/
$ pod update

// open the demo with IJKMediaDemo.xcworkspace
  • code in the demo
....
#import "MDVRLibrary.h"

@interface IJKVideoViewController()
@property (nonatomic,strong) MDVRLibrary* vrLibrary;
@end

- (void)viewDidLoad{
    [super viewDidLoad];
    ...

    
    [self createVRLibrary];
}

- (void) createVRLibrary{
    /////////////////////////////////////////////////////// MDVRLibrary
    MDVRConfiguration* config = [MDVRLibrary createConfig];
    
    [config asVideoWithYUV420PProvider:[MDIJKAdapter wrap:self.player.view]]; // working with ijk
    [config setContainer:self view:self.view];
    
    // optional
    [config displayMode:MDModeDisplayNormal];
    [config interactiveMode:MDModeInteractiveTouch];
    [config pinchEnabled:true];
    
    self.vrLibrary = [config build];
    /////////////////////////////////////////////////////// MDVRLibrary
}
Clone this wiki locally