|
|
@@ -37,6 +37,13 @@
|
|
|
[self.view setBackgroundColor:[UIColor whiteColor]];
|
|
|
|
|
|
[self.view addSubview:self.containerView];
|
|
|
+ [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.top.mas_equalTo(self.navBarBGView.mas_bottom);
|
|
|
+ }];
|
|
|
+
|
|
|
self.playerManager = [[ZFAVPlayerManager alloc] init];
|
|
|
/// 播放器相关
|
|
|
self.player = [ZFPlayerController playerWithPlayerManager:self.playerManager containerView:self.containerView];
|
|
|
@@ -48,19 +55,20 @@
|
|
|
/// 播放完成
|
|
|
self.player.playerDidToEnd = ^(id _Nonnull asset) {
|
|
|
@zf_strongify(self)
|
|
|
- [self.player.currentPlayerManager replay];
|
|
|
+ //[self.player.currentPlayerManager replay];
|
|
|
[self.player playTheNext];
|
|
|
if (!self.player.isLastAssetURL) {
|
|
|
- NSString *title = [NSString stringWithFormat:@"视频标题%zd",self.player.currentPlayIndex];
|
|
|
- [self.controlView showTitle:title coverURLString:nil fullScreenMode:ZFFullScreenModeLandscape];
|
|
|
+// NSString *title = [NSString stringWithFormat:@"视频标题%zd",self.player.currentPlayIndex];
|
|
|
+// [self.controlView showTitle:title coverURLString:nil fullScreenMode:ZFFullScreenModeLandscape];
|
|
|
} else {
|
|
|
[self.player stop];
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ self.player.playerPlayFailed = ^(id<ZFPlayerMediaPlayback> _Nonnull asset, id _Nonnull error) {
|
|
|
+ HLog(@"%@----%@",asset,error);
|
|
|
+ };
|
|
|
|
|
|
- [self.controlView showTitle:@"自定义控制层" coverURLString:nil fullScreenMode:ZFFullScreenModeAutomatic];
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
|
@@ -71,16 +79,23 @@
|
|
|
|
|
|
//http://transfertest.armclouding.com:10006/getFile?path=/storage/C47D-46D2/mp4/loginVideo.mp4
|
|
|
|
|
|
- NSString *filePath = _VideoDataMode.path;
|
|
|
- NSString *urlStr = ksharedAppDelegate.NASFileService;
|
|
|
- NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
|
|
|
-
|
|
|
- fileUrl = @"http://transfertest.armclouding.com:10010/getFile?path=/sdcard/bb.mp4";
|
|
|
- fileUrl = [fileUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
|
|
-
|
|
|
- NSURL * sourceMovieURL= [NSURL URLWithString:fileUrl];
|
|
|
-
|
|
|
- self.playerManager.assetURL = sourceMovieURL;
|
|
|
+ if(!self.playerManager.assetURL){
|
|
|
+ NSString *filePath = _VideoDataMode.path;
|
|
|
+ NSString *urlStr = ksharedAppDelegate.NASFileService;
|
|
|
+ NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
|
|
|
+ NSString *showUrl = [[NSString alloc] initWithFormat:@"%@getThumbnail?path=%@",urlStr,filePath];
|
|
|
+ //HLog(@"%@",fileUrl);
|
|
|
+ //fileUrl = @"http://transfertest.armclouding.com:10010/getFile?path=/sdcard/bb.mp4";
|
|
|
+ fileUrl = [fileUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
|
|
+
|
|
|
+ NSURL * sourceMovieURL= [NSURL URLWithString:fileUrl];
|
|
|
+
|
|
|
+ self.playerManager.assetURL = sourceMovieURL;
|
|
|
+
|
|
|
+ self.titleLabel.text = _VideoDataMode.name;
|
|
|
+ [self.controlView showTitle:@"" coverURLString:showUrl fullScreenMode:ZFFullScreenModeAutomatic];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated {
|