|
@@ -17,7 +17,8 @@
|
|
|
#import <AVFoundation/AVFoundation.h>
|
|
#import <AVFoundation/AVFoundation.h>
|
|
|
#import "JXCollectionViewController.h"
|
|
#import "JXCollectionViewController.h"
|
|
|
#import "JXCommentViewController.h"
|
|
#import "JXCommentViewController.h"
|
|
|
-@interface JXDetailViewController () <JXSuperPlayerDelegate, UICollectionViewDelegate, UICollectionViewDataSource,JXCollectionViewControllerDelegate>
|
|
|
|
|
|
|
+#import <TXLiteAVSDK_Player/TXLiteAVSDK.h>
|
|
|
|
|
+@interface JXDetailViewController () <JXSuperPlayerDelegate, UICollectionViewDelegate, UICollectionViewDataSource,JXCollectionViewControllerDelegate,TXVodPlayListener>
|
|
|
|
|
|
|
|
// 播放器
|
|
// 播放器
|
|
|
@property (nonatomic, strong) UIView *playerContainer;
|
|
@property (nonatomic, strong) UIView *playerContainer;
|
|
@@ -40,7 +41,8 @@
|
|
|
@property (nonatomic, strong) NSArray<JXEpisode *> *episodes;
|
|
@property (nonatomic, strong) NSArray<JXEpisode *> *episodes;
|
|
|
@property (nonatomic, strong) JXInteraction *interaction;
|
|
@property (nonatomic, strong) JXInteraction *interaction;
|
|
|
@property (nonatomic, assign) NSInteger currentEpisodeIndex;
|
|
@property (nonatomic, assign) NSInteger currentEpisodeIndex;
|
|
|
-
|
|
|
|
|
|
|
+@property (strong, nonatomic) UISlider *videoSlider;
|
|
|
|
|
+@property (nonatomic,assign) BOOL isHuadong;
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
@implementation JXDetailViewController
|
|
@implementation JXDetailViewController
|
|
@@ -61,7 +63,7 @@
|
|
|
|
|
|
|
|
// 隐藏导航栏返回按钮
|
|
// 隐藏导航栏返回按钮
|
|
|
self.navigationItem.hidesBackButton = YES;
|
|
self.navigationItem.hidesBackButton = YES;
|
|
|
-
|
|
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeProgress:) name:@"videoProgressChanged" object:nil];
|
|
|
[self setupUI];
|
|
[self setupUI];
|
|
|
[self loadData];
|
|
[self loadData];
|
|
|
}
|
|
}
|
|
@@ -183,16 +185,9 @@
|
|
|
// 创建播放器
|
|
// 创建播放器
|
|
|
JXSuperPlayer *player = [[JXSuperPlayer alloc] initWithContainerView:playerContainer];
|
|
JXSuperPlayer *player = [[JXSuperPlayer alloc] initWithContainerView:playerContainer];
|
|
|
player.delegate = self;
|
|
player.delegate = self;
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- // 标题
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// 右侧互动按钮
|
|
// 右侧互动按钮
|
|
|
[self setupInteractionButtonsForCell:cell];
|
|
[self setupInteractionButtonsForCell:cell];
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
UILabel * seeL = [[UILabel alloc] initWithFrame:CGRectMake(16, kScreenHeight - 14-safebottom, SCREEN_WIDTH - 32, 14)];
|
|
UILabel * seeL = [[UILabel alloc] initWithFrame:CGRectMake(16, kScreenHeight - 14-safebottom, SCREEN_WIDTH - 32, 14)];
|
|
|
seeL.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
|
seeL.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
|
|
seeL.textColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1];
|
|
seeL.textColor = [UIColor colorWithRed:173/255.0 green:173/255.0 blue:173/255.0 alpha:1];
|
|
@@ -217,6 +212,23 @@
|
|
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showHJ:)];
|
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showHJ:)];
|
|
|
[bottomView addGestureRecognizer:tap];
|
|
[bottomView addGestureRecognizer:tap];
|
|
|
|
|
|
|
|
|
|
+ UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(16,34, SCREEN_WIDTH-32, 2)];
|
|
|
|
|
+ [bottomView addSubview:slider];
|
|
|
|
|
+ slider.maximumValue = 1;
|
|
|
|
|
+ slider.minimumValue = 0;
|
|
|
|
|
+ [slider setThumbImage:[UIImage imageNamed:@"b_jdt.png"] forState:UIControlStateNormal];
|
|
|
|
|
+ [slider setThumbImage:[UIImage imageNamed:@"b_jdtb.png"] forState:UIControlStateHighlighted];
|
|
|
|
|
+ [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
|
|
|
|
|
+ [slider setMinimumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted];
|
|
|
|
|
+ [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateNormal];
|
|
|
|
|
+ [slider setMaximumTrackImage:[UIImage imageNamed:@"jdt.png"] forState:UIControlStateHighlighted] ;
|
|
|
|
|
+ [slider setMinimumTrackTintColor:COLOR(0, 0, 0, 0.1)];
|
|
|
|
|
+ [slider setMaximumTrackTintColor:COLOR(0, 0, 0, 0.1)];
|
|
|
|
|
+ slider.alpha = 0.6;
|
|
|
|
|
+ self.videoSlider = slider;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
UILabel *descLabel = [[UILabel alloc] init];
|
|
UILabel *descLabel = [[UILabel alloc] init];
|
|
|
descLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
|
descLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
|
|
descLabel.textColor = [UIColor whiteColor];
|
|
descLabel.textColor = [UIColor whiteColor];
|
|
@@ -314,8 +326,20 @@
|
|
|
NSLog(@"[JXShortDrama] 🗨️ commentVC present 完成!");
|
|
NSLog(@"[JXShortDrama] 🗨️ commentVC present 完成!");
|
|
|
}];
|
|
}];
|
|
|
}
|
|
}
|
|
|
|
|
+- (void)changeProgress:(NSNotification *)niti{
|
|
|
|
|
+ if (!self.isHuadong){
|
|
|
|
|
+ NSDictionary *user = niti.userInfo;
|
|
|
|
|
+ JXEpisode *episode = self.episodes[self.currentEpisodeIndex];
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if ([user[@"fileId"] isEqualToString:episode.fileId] ) {
|
|
|
|
|
+ float progress = [user[@"progress"] floatValue];
|
|
|
|
|
+ self.videoSlider.value = progress;
|
|
|
|
|
+ NSLog(@"进度--%f",progress);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- (void)collectionViewControllerDidSelectEpisode:(NSString *)episodeId {
|
|
- (void)collectionViewControllerDidSelectEpisode:(NSString *)episodeId {
|
|
|
NSLog(@"[JXShortDrama] 选择播放剧集: %@", episodeId);
|
|
NSLog(@"[JXShortDrama] 选择播放剧集: %@", episodeId);
|