RBPlayer 0.1.5

RBPlayer 0.1.5

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布时间最新发布2016 年 9 月

Ribs 维护。



RBPlayer 0.1.5

  • 作者:
  • ribs

RBPlayer

一些高级功能包括

  • 完全可定制的用户界面
  • 无视图级限制(可以设置为任何大小和位置!)
  • 支持 HTTP Live Streaming 协议
  • 支持方向更改(即使方向锁定已启用)

用法

要运行示例项目,请克隆仓库,并首先在 Example 目录中运行 pod install

要求

iOS 7.0 或更高版本

安装

RBPlayer 通过 CocoaPods 可用。要安装它,请简单地将其以下行添加到您的 Podfile 中:

pod "RBPlayer", "~> 0.1.5"

开始使用

RBPlayerViewController *viewController = [[RBPlayerViewController alloc] init];
[viewController.player playWithURL:[NSURL URLWithString:@"http://xxx.xxx/xx.mp4"]];
[self presentViewController:viewController animated:YES completion:nil];

播放

RBPlayerItem *item = [[RBPlayerItem alloc] init];
item.title = @"这都是什么jb电影";
item.assetTitle = @"清晰";

RBPlayerItemAsset *itemAsset1 = [[RBPlayerItemAsset alloc] initWithType:@"清晰" URL:[NSURL URLWithString:url]];
RBPlayerItemAsset *itemAsset2 = [[RBPlayerItemAsset alloc] initWithType: @"高清" URL:[NSURL URLWithString:url]];

item.assets = @[itemAsset1, itemAsset2];

[self.player replaceCurrentItemWithPlayerItem:item];
[self.player playWithItemAsset:itemAsset1];

自定义

self.player = [[RBVideoPlayer alloc] init];
[self.view addSubview:self.player.view];

self.player.view.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-20-[playerView]-50-|" options:0 metrics:nil views:@{@"playerView":self.player.view}]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-50-[playerView(200)]" options:0 metrics:nil views:@{@"playerView":self.player.view}]];

作者

Ribs, [email protected]

许可证

RBPlayer 适用于 MIT 许可证。有关更多信息,请参阅 LICENSE 文件。