Skip to content

Commit

Permalink
fix SuperPlayerModel
Browse files Browse the repository at this point in the history
  • Loading branch information
shengcui2018 committed Mar 23, 2020
1 parent 4555a6d commit 0dc1fca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion SuperPlayer/SuperPlayerModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ - (NSURLSessionTask *)requestWithCompletion:
AFHTTPSessionManager *manager = self.sessionManager;
int ver = self.videoId ? 4 : 2;
NSString *url = [NSString stringWithFormat:@"https://%@/getplayinfo/v%d/%ld/%@",
kPlayCGIHostname, ver, self.appId, self.videoId.fileId];
kPlayCGIHostname, ver, self.appId, self.videoId ? self.videoId.fileId : self.videoIdV2.fileId];

// 防盗链参数
NSDictionary *params = [self _buildParams];
Expand Down Expand Up @@ -164,3 +164,6 @@ - (NSDictionary *)_buildParams {
}

@end

@implementation SuperPlayerVideoIdV2
@end
6 changes: 3 additions & 3 deletions SuperPlayer/SuperPlayerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ - (void)reloadModel {
- (void)_playWithModel:(SuperPlayerModel *)playerModel {
[_currentLoadingTask cancel];
_currentLoadingTask = nil;

_playerModel = playerModel;

[self pause];

NSString *videoURL = playerModel.playingDefinitionUrl;
if (videoURL != nil) {
[self configTXPlayer];
} else if (playerModel.videoId) {
} else if (playerModel.videoId || playerModel.videoIdV2) {
self.isLive = NO;
__weak __typeof(self) weakSelf = self;
_currentLoadingTask = [_playerModel requestWithCompletion:
Expand Down

0 comments on commit 0dc1fca

Please sign in to comment.