现在的各大平台都有许多短视频APP
具体当我们遇到了应该怎么使用呢
具体实现
首先创建一个属性,设置视频播放的位置
@property (nonatomic,strong) ZSPlayerView *player;
self.view.backgroundColor = [UIColor grayColor];
AFHTTPSessionManager *manger = [AFHTTPSessionManager manager];
[manger GET:@"http://123.126.40.109:7003/asmr/videos/A1100101.shtml" parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"--------==========%@",responseObject);
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
}];
self.player = [[ZSPlayerView alloc]initWithFrame:CGRectMake(10, 50, self.view.frame.size.width - 20, 200) delegate:self url:@"http://123.126.40.109:7003/asmr/upload/1518430953135.mp4"];
[self.view addSubview:self.player];
UIImageView *iameg = [[UIImageView alloc]initWithFrame:CGRectMake(10, 250, self.view.frame.size.width - 20, 200)];
// iameg.backgroundColor = [UIColor greenColor];
// NSURL *url = [NSURL URLWithString:];
iameg.image = [UIImage imageNamed:@"http://123.126.40.109:7003/asmr/upload/1518430902728.jpg"];
[self.view addSubview:iameg];
别忘了导入头文件哦