Skip to content

Commit 357ca4d

Browse files
author
ianyanzhang
committed
1、Update Demo
1 parent 82bdf51 commit 357ca4d

File tree

12 files changed

+373
-46
lines changed

12 files changed

+373
-46
lines changed

Demo/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def common_pods_all
2727
pod 'AFNetworking'
2828
pod 'BlocksKit', '~> 2.2.5'
2929
pod 'CWStatusBarNotification', '~> 2.3.5'
30-
pod 'TXLiteAVSDK_Player', '~> 11.0.14028'
30+
pod 'TXLiteAVSDK_Player', '~> 11.1.14125'
3131
end
3232

3333
def common_pods_smart

Demo/TXLiteAVDemo/SuperPlayerDemo/SuperPlayer/CacheView/VideoCacheListView/VideoCacheListCell.m

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,6 @@ - (SuperPlayerModel *)getSuperPlayModel {
270270
playModel.videoId = videoId;
271271
}
272272

273-
// 获取overlayKey和overlayIv
274-
NSString *overlayStr = [[TXVodDownloadManager shareInstance] getOverlayKeyIv:self.mediaInfo.dataSource.appId
275-
userName:self.mediaInfo.dataSource.userName
276-
fileId:self.mediaInfo.dataSource.fileId
277-
qualityId:(int)self.mediaInfo.dataSource.quality];
278-
if (overlayStr.length > 0) {
279-
NSArray *overlayArray = [overlayStr componentsSeparatedByString:@"_"];
280-
playModel.overlayKey = overlayArray.firstObject;
281-
playModel.overlayIv = overlayArray.lastObject;
282-
}
283-
284273
playModel.customCoverImageUrl = _model.coverImageStr;
285274
playModel.action = 0;
286275
playModel.name = _model.videoName;

Demo/TXLiteAVDemo/SuperPlayerDemo/SuperPlayer/MoviePlayerViewController.m

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -440,28 +440,38 @@ - (void)_refreshVODList {
440440

441441
videoArray = [NSMutableArray array];
442442
p = [[TXPlayerAuthParams alloc] init];
443-
p.appId = 1500005830;
444-
p.fileId = @"243791578431393746";
443+
p.appId = 1252463788;
444+
p.fileId = @"5285890781763144364";
445445
[videoArray addObject:p];
446446
[_authParamArray addObject:videoArray];
447447

448448
videoArray = [NSMutableArray array];
449-
TXMoviePlayInfoResponse *trackInfoResponse = [[TXMoviePlayInfoResponse alloc] init];
450-
trackInfoResponse.name = playerLocalize(@"SuperPlayerDemo.MoviePlayer.multitrackvideo");
451-
trackInfoResponse.videoUrl = MULTI_TRACK_VIDEO;
452-
trackInfoResponse.isCache = NO;
453-
trackInfoResponse.coverUrl = TRACK_COVERURL;
454-
[videoArray addObject:trackInfoResponse];
449+
p = [[TXPlayerAuthParams alloc] init];
450+
p.appId = 1500005830;
451+
p.fileId = @"243791578431393746";
452+
[videoArray addObject:p];
455453
[_authParamArray addObject:videoArray];
456454

457-
videoArray = [NSMutableArray array];
458-
TXMoviePlayInfoResponse *subtitleInfoResponse = [[TXMoviePlayInfoResponse alloc] init];
459-
subtitleInfoResponse.name = playerLocalize(@"SuperPlayerDemo.MoviePlayer.multisubtitledvideo");
460-
subtitleInfoResponse.videoUrl = MULTI_SUBTITLES_VIDEO;
461-
subtitleInfoResponse.isCache = NO;
462-
subtitleInfoResponse.coverUrl = SUBTITLES_COVERURL;
463-
[videoArray addObject:subtitleInfoResponse];
464-
[_authParamArray addObject:videoArray];
455+
NSDictionary *userDic = [[NSUserDefaults standardUserDefaults] objectForKey:@"vodConfig"];
456+
if (userDic != nil && userDic.count > 0 && [[userDic objectForKey:@"resources"] intValue] == 1) {
457+
videoArray = [NSMutableArray array];
458+
TXMoviePlayInfoResponse *trackInfoResponse = [[TXMoviePlayInfoResponse alloc] init];
459+
trackInfoResponse.name = playerLocalize(@"SuperPlayerDemo.MoviePlayer.multitrackvideo");
460+
trackInfoResponse.videoUrl = MULTI_TRACK_VIDEO;
461+
trackInfoResponse.isCache = NO;
462+
trackInfoResponse.coverUrl = TRACK_COVERURL;
463+
[videoArray addObject:trackInfoResponse];
464+
[_authParamArray addObject:videoArray];
465+
466+
videoArray = [NSMutableArray array];
467+
TXMoviePlayInfoResponse *subtitleInfoResponse = [[TXMoviePlayInfoResponse alloc] init];
468+
subtitleInfoResponse.name = playerLocalize(@"SuperPlayerDemo.MoviePlayer.multisubtitledvideo");
469+
subtitleInfoResponse.videoUrl = MULTI_SUBTITLES_VIDEO;
470+
subtitleInfoResponse.isCache = NO;
471+
subtitleInfoResponse.coverUrl = SUBTITLES_COVERURL;
472+
[videoArray addObject:subtitleInfoResponse];
473+
[_authParamArray addObject:videoArray];
474+
}
465475

466476
// 增加轮播视频源
467477
[self loadVideoListData];
@@ -1284,6 +1294,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
12841294
if (cell) {
12851295
if ([[cell getSource].title containsString:playerLocalize(@"SuperPlayerDemo.MoviePlayer.videopreview")]) {
12861296
[self.playerView showVipTipView];
1297+
defaultControlView.disablePipBtn = YES;
12871298
}
12881299

12891300
if ([[cell getSource].title containsString:playerLocalize(@"SuperPlayerDemo.MoviePlayer.videoplaylist")]) {

Demo/TXLiteAVDemo/SuperPlayerKit/SuperPlayer/Skins/SPDefaultControlView.m

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#define MODEL_TAG_BEGIN 20
2121
#define BOTTOM_IMAGE_VIEW_HEIGHT 50
22+
#define FADEOUTTIME 5
2223

2324
@interface SPDefaultControlView () <UIGestureRecognizerDelegate, PlayerSliderDelegate,
2425
SuperPlayerTrackViewDelegate, SuperPlayerSubtitlesViewDelegate>
@@ -71,6 +72,10 @@ - (instancetype)initWithFrame:(CGRect)frame {
7172
self.trackView.hidden = YES;
7273
self.subtitlesView.hidden = YES;
7374
self.nextBtn.hidden = YES;
75+
76+
UILongPressGestureRecognizer *longPress=[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPressAction:)];
77+
longPress.numberOfTouchesRequired = 1;
78+
[self addGestureRecognizer:longPress];
7479
// 初始化时重置controlView
7580
[self playerResetControlView];
7681
}
@@ -81,6 +86,14 @@ - (void)dealloc {
8186
[[NSNotificationCenter defaultCenter] removeObserver:self];
8287
}
8388

89+
-(void)longPressAction:(UILongPressGestureRecognizer *)longPress{
90+
if (!self.isFullScreen) {
91+
return;
92+
}
93+
if ([self.delegate respondsToSelector:@selector(onLongPressAction:)]) {
94+
[self.delegate onLongPressAction:longPress];
95+
}
96+
}
8497
- (void)makeSubViewsConstraints {
8598
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
8699
make.leading.trailing.equalTo(self);
@@ -369,9 +382,19 @@ - (void)progressSliderValueChanged:(UISlider *)sender {
369382
}
370383

371384
- (void)progressSliderTouchEnded:(UISlider *)sender {
372-
[self.delegate controlViewSeek:self where:sender.value];
385+
[self seekTo:sender.value];
386+
}
387+
388+
- (void)onClickProgress:(UITapGestureRecognizer *)gesture{
389+
CGPoint point = [gesture locationInView:self.videoSlider];
390+
CGFloat progress = point.x / CGRectGetWidth(self.videoSlider.frame);
391+
[self seekTo:progress];
392+
}
393+
394+
- (void)seekTo:(CGFloat)pos{
395+
[self.delegate controlViewSeek:self where:pos];
373396
self.isDragging = NO;
374-
[self fadeOut:5];
397+
[self fadeOut:FADEOUTTIME];
375398
}
376399

377400
- (void)backLiveClick:(UIButton *)sender {
@@ -668,6 +691,9 @@ - (PlayerSlider *)videoSlider {
668691
[_videoSlider addTarget:self action:@selector(progressSliderValueChanged:) forControlEvents:UIControlEventValueChanged];
669692
// slider结束滑动事件
670693
[_videoSlider addTarget:self action:@selector(progressSliderTouchEnded:) forControlEvents:UIControlEventTouchUpInside | UIControlEventTouchUpOutside];
694+
// slider点击seek事件
695+
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onClickProgress:)];
696+
[_videoSlider addGestureRecognizer:tapGesture];
671697
_videoSlider.delegate = self;
672698
}
673699
return _videoSlider;
@@ -873,6 +899,12 @@ - (void)chooseSubtitlesInfo:(TXTrackInfo *)info preSubtitlesInfo:(TXTrackInfo *)
873899
}
874900
}
875901

902+
- (void)onSettingViewDoneClickWithDic:(NSMutableDictionary *)dic{
903+
if (self.delegate && [self.delegate respondsToSelector:@selector(onSettingViewDoneClickWithDic:)]) {
904+
[self.delegate onSettingViewDoneClickWithDic:dic];
905+
}
906+
}
907+
876908
#pragma mark - Public method
877909

878910
- (void)setHidden:(BOOL)hidden {

Demo/TXLiteAVDemo/SuperPlayerKit/SuperPlayer/SuperPlayerControlViewDelegate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
- (void)controlViewSwitch:(UIView *)controlView withTrackInfo:(TXTrackInfo *)info preTrackInfo:(TXTrackInfo *)preInfo;
3131
/** 切换字幕按钮事件 */
3232
- (void)controlViewSwitch:(UIView *)controlView withSubtitlesInfo:(TXTrackInfo *)info preSubtitlesInfo:(TXTrackInfo *)preInfo;
33+
/** 设置字幕样式按钮事件 */
34+
- (void)onSettingViewDoneClickWithDic:(NSMutableDictionary *)dic;
3335
/** 修改配置 */
3436
- (void)controlViewConfigUpdate:(SuperPlayerControlView *)controlView withReload:(BOOL)reload;
3537
/** 重新播放 */
@@ -48,6 +50,8 @@
4850
- (void)onRepeatClick;
4951
/** 显示VipView */
5052
- (void)showVipView;
53+
/** 快进/快退按钮*/
54+
- (void)onLongPressAction:(UILongPressGestureRecognizer *)gesture;
5155

5256
@end
5357

Demo/TXLiteAVDemo/SuperPlayerKit/SuperPlayer/SuperPlayerLocalized/en.lproj/SuperPlayerLocalized.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@
4040
"SuperPlayer.chooseoutlinecolor" = "Choose Outline Color";
4141
"SuperPlayer.subtitlessetting" = "Subtitles Setting";
4242
"SuperPlayer.track" = "Track";
43+
"SuperPlayer.fastForward" = "fast forward";
44+
"SuperPlayer.rewind" = "rewind";

Demo/TXLiteAVDemo/SuperPlayerKit/SuperPlayer/SuperPlayerLocalized/zh-Hans.lproj/SuperPlayerLocalized.strings

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@
3939
"SuperPlayer.chooseoutlinecolor" = "选择描边颜色";
4040
"SuperPlayer.subtitlessetting" = "字幕设置";
4141
"SuperPlayer.track" = "音轨";
42+
"SuperPlayer.fastForward" = "快进";
43+
"SuperPlayer.rewind" = "快退";

0 commit comments

Comments
 (0)