VLCMediaPlayer

  • Post author:
  • Post category:其他


VLCMediaPlayer比苹果自带的播放器更强大,用法:

#import <UIKit/UIKit.h>

#import <MobileVLCKit/MobileVLCKit.h>

@interface ViewController : UIViewController {


UIView *videoView;

VLCMediaPlayer *vlcPlayer;

}

@end

#import “ViewController.h”

/* 确保选中 GNU C++ 而不是Apple的C++ */

@implementation ViewController

– (void)viewDidLoad {


[super viewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

videoView = [[UIView alloc] initWithFrame:CGRectMake(10, 80, 300, 300)];

videoView.backgroundColor = [UIColor blackColor];

[self.view addSubview:videoView];

// 1. 创建一个播放器

vlcPlayer = [[VLCMediaPlayer alloc] initWithOptions:nil];

// 2. 让videoView作为vlc的视频播放的内



版权声明:本文为hurricane111原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。