ijkplayer ios demo集成

  • 内容
  • 评论
  • 相关

github 地址

https://github.com/bbcallen/ijkplayer

我集成了一个demo

链接: http://pan.baidu.com/s/1mhoALOc 密码: vaz5

根据提示编译,生成 IJKMediaFramework.framework

基本代码

 

在新工程中添加

IJKMediaFramework.framework

.h文件引入

 

#import <IJKMediaFramework/IJKMediaFramework.h>

然后添加两个变量

@property (atomic, strong) NSURL *url;

@property (atomic, retain) id <IJKMediaPlayback> player;

.m文件

 

 

    self.url = [NSURL URLWithString:@"rtmp://xxx.com/stream1558"];

    

    _player = [[IJKFFMoviePlayerController alloc] initWithContentURL:self.url withOptions:nil];

    UIView *playerView = [_player view];

    playerView.frame = self.view.frame;

    playerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

    

    [self.view insertSubview:playerView atIndex:1];

    [_player setScalingMode:IJKMPMovieScalingModeAspectFill];

    [self installMovieNotificationObservers];

    [self.player prepareToPlay];

    [self.player play];

评论

0条评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注