Commit ca86f7a8 authored by Han Ruisong's avatar Han Ruisong
Browse files

升级到4.5.1

1.修复小窗模式导致的播放异常的问题。
2.修复离线播放页面UI显示异常的问题。
parent 01bb3d2d
No preview for this file type
This diff is collapsed.
......@@ -3,4 +3,22 @@
uuid = "AD3D3292-9E0B-4C03-BAEE-512F2BB8893D"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "59905C0D-ED77-42B3-B1A3-FFC8759E9B02"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Demo/Classes/DWVodPlayViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "51"
endingLineNumber = "51"
landmarkName = "-viewDidLoad"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -43,7 +43,6 @@
}
}
[self.playerView playLocalVideo:self.downloadModel];
[self.playerView reLayoutWithScreenState:YES];
/*
//若需体验SDK自带皮肤的播放器,请将上面代码注释掉,使用下面的代码即可。
......@@ -73,6 +72,7 @@
self.navigationController.navigationBar.hidden = YES;
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"orientation"];
[self.playerView reLayoutWithScreenState:YES];
}
-(void)viewWillDisappear:(BOOL)animated
......@@ -95,6 +95,7 @@
#pragma mark - DWVodPlayerViewDelegate
-(void)vodPlayerView:(DWVodPlayerView *)playerView ReturnBackAction:(BOOL)isFull
{
DWAPPDELEGATE.vodPlayerView = nil;
[self.playerView closePlayer];
[self.navigationController popViewControllerAnimated:YES];
}
......@@ -102,7 +103,7 @@
//窗口模式播放
-(void)vodPlayerViewDidEnterWindowsModel:(DWVodPlayerView *)playerView
{
// DWAPPDELEGATE.vodPlayerView.delegate = nil;
DWAPPDELEGATE.vodPlayerView = self.playerView;
[DWAPPDELEGATE.vodPlayerView enterWindowsModel];
[self.navigationController popViewControllerAnimated:YES];
......
......@@ -94,7 +94,7 @@
{
//请自行替换数据
NSArray * videos = @[];
for (int i = 0; i < videos.count; i++) {
DWVodModel * vodModel = [[DWVodModel alloc]init];
vodModel.videoId = [videos objectAtIndex:i];
......@@ -199,7 +199,7 @@
}
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
{
DWVodModel * vodModel = [self.videoList objectAtIndex:indexPath.row];
DWVodPlayViewController * vodPlayVC = [[DWVodPlayViewController alloc]init];
vodPlayVC.vodModel = vodModel;
......
......@@ -242,6 +242,7 @@ typedef enum : NSUInteger {
-(void)vodPlayerView:(DWVodPlayerView *)playerView ReturnBackAction:(BOOL)isFull
{
if (!isFull) {
DWAPPDELEGATE.vodPlayerView = nil;
[self.playerView closePlayer];
[self.navigationController popViewControllerAnimated:YES];
}else{
......@@ -319,6 +320,7 @@ typedef enum : NSUInteger {
-(void)vodPlayerViewDidEnterWindowsModel:(DWVodPlayerView *)playerView
{
//如果开启了小窗,开小窗,没开启正常
DWAPPDELEGATE.vodPlayerView = self.playerView;
[DWAPPDELEGATE.vodPlayerView enterWindowsModel];
[self.navigationController popViewControllerAnimated:YES];
}
......@@ -431,6 +433,7 @@ typedef enum : NSUInteger {
bdUtility.verificationCode = [DWConfigurationManager sharedInstance].verification;
//音频 + 视频数据,这里仅做示范,可根据自己项目业务逻辑来调整
bdUtility.mediatype = @"0";
__weak typeof(self) weakSelf = self;
bdUtility.finishBlock = ^(NSArray<DWVodVideoModel *> * _Nonnull playInfosArray) {
if (playInfosArray.count == 0) {
......@@ -438,53 +441,8 @@ typedef enum : NSUInteger {
return;
}
for (DWVodVideoModel * videoModel in playInfosArray) {
if (!videoModel) {
//某个视频数据获取失败
continue;
}
if (videoModel.authorize && !videoModel.authorize.enable) {
//授权验证未通过,无法下载
continue;
}
//这里根据自身业务逻辑进行调整, 默认全部下载首个媒体数据
DWVideoQualityModel * qualityModel = videoModel.videoQualities.firstObject;
if (!qualityModel) {
qualityModel = videoModel.radioQualities.firstObject;
}
DWDownloadSessionManager * manager = [DWDownloadSessionManager manager];
//验证当前任务是否已经在下载队列中
if ([manager checkLocalResourceWithVideoId:videoModel.videoId WithQuality:qualityModel.quality]) {
continue;
}
//获取视频图片地址,保存
NSString * imageUrl = @"icon_placeholder.png";
NSString * title = @"";
for (DWVodModel * vodModel in self.vidoeList) {
if ([vodModel.videoId isEqualToString:videoModel.videoId]) {
imageUrl = vodModel.imageUrl;
title = vodModel.title;
break;
}
}
DWDownloadModel * model = [DWDownloadSessionManager createDownloadModel:videoModel Quality:qualityModel.quality AndOthersInfo:@{@"imageUrl":imageUrl,@"title":title}];
if (!model) {
[@"DownloadModel创建失败,请检查参数" showAlert];
continue;
}
[manager startWithDownloadModel:model];
}
[weakSelf startDownloadTask:playInfosArray];
[[NSString stringWithFormat:@"已开始下载%lu个视频",(unsigned long)playInfosArray.count] showAlert];
};
bdUtility.errorBlock = ^(NSError * _Nonnull error) {
......@@ -493,6 +451,57 @@ typedef enum : NSUInteger {
[bdUtility start];
}
-(void)startDownloadTask:(NSArray<DWVodVideoModel *> *)playInfosArray
{
for (DWVodVideoModel * videoModel in playInfosArray) {
if (!videoModel) {
//某个视频数据获取失败
continue;
}
if (videoModel.authorize && !videoModel.authorize.enable) {
//授权验证未通过,无法下载
continue;
}
//这里根据自身业务逻辑进行调整, 默认全部下载首个媒体数据
DWVideoQualityModel * qualityModel = videoModel.videoQualities.firstObject;
if (!qualityModel) {
qualityModel = videoModel.radioQualities.firstObject;
}
DWDownloadSessionManager * manager = [DWDownloadSessionManager manager];
//验证当前任务是否已经在下载队列中
if ([manager checkLocalResourceWithVideoId:videoModel.videoId WithQuality:qualityModel.quality]) {
continue;
}
//获取视频图片地址,保存
NSString * imageUrl = @"icon_placeholder.png";
NSString * title = @"";
for (DWVodModel * vodModel in self.vidoeList) {
if ([vodModel.videoId isEqualToString:videoModel.videoId]) {
imageUrl = vodModel.imageUrl;
title = vodModel.title;
break;
}
}
DWDownloadModel * model = [DWDownloadSessionManager createDownloadModel:videoModel Quality:qualityModel.quality AndOthersInfo:@{@"imageUrl":imageUrl,@"title":title}];
if (!model) {
[@"DownloadModel创建失败,请检查参数" showAlert];
continue;
}
[manager startWithDownloadModel:model];
}
[[NSString stringWithFormat:@"已开始下载%lu个视频",(unsigned long)playInfosArray.count] showAlert];
}
-(void)vodPlayBottomViewCancelButtonAction
{
......
......@@ -42,7 +42,7 @@
@property(nonatomic,strong)UIView * radioBgView;
@property(nonatomic,strong)UIImageView * radioImageView;
@property(nonatomic,assign)BOOL openWindowsPlay;//是否开启窗口播放功能
//@property(nonatomic,assign)BOOL openWindowsPlay;//是否开启窗口播放功能
@property(nonatomic,assign)BOOL isWindowsPlay;//当前是否在小窗模式
@property(nonatomic,strong)UIPanGestureRecognizer * windowsPan;//窗口拖拽手势
......@@ -208,7 +208,7 @@ static const CGFloat gifSeconds = 0.25;
self.allowBackgroundPlay = NO;
//是否开启小窗播放
self.openWindowsPlay = YES;
// self.openWindowsPlay = YES;
self.isWindowsPlay = NO;
......@@ -1023,15 +1023,36 @@ static const CGFloat gifSeconds = 0.25;
}
-(void)setOpenWindowsPlay:(BOOL)openWindowsPlay
-(void)startDownloadTask:(DWVodVideoModel *)vodVideo
{
_openWindowsPlay = openWindowsPlay;
DWVideoQualityModel * qualitiyModel = self.playerView.qualityModel;
if (_openWindowsPlay) {
DWAPPDELEGATE.vodPlayerView = self;
DWDownloadSessionManager * manager = [DWDownloadSessionManager manager];
//验证当前任务是否已经在下载队列中
if ([manager checkLocalResourceWithVideoId:self.videoModel.videoId WithQuality:qualitiyModel.quality]) {
[@"当前任务已经在下载队列中" showAlert];
return;
}
NSString * imageUrl = nil;
NSString * title = @"";
if (self.vodModel) {
imageUrl = self.vodModel.imageUrl;
title = self.vodModel.title;
}else{
DWAPPDELEGATE.vodPlayerView = nil;
imageUrl = @"icon_placeholder.png";
}
DWDownloadModel * model = [DWDownloadSessionManager createDownloadModel:vodVideo Quality:qualitiyModel.quality AndOthersInfo:@{@"imageUrl":imageUrl,@"title":title}];
if (!model) {
[@"DownloadModel创建失败,请检查参数" showAlert];
return;
}
[manager startWithDownloadModel:model];
[[NSString stringWithFormat:@"开始下载:%@",vodVideo.title] showAlert];
}
#pragma mark - func Timer
......@@ -1296,9 +1317,9 @@ static const CGFloat gifSeconds = 0.25;
//进入窗口模式
-(void)enterWindowsModel
{
if (!self.openWindowsPlay) {
return;
}
// if (!self.openWindowsPlay) {
// return;
// }
self.isWindowsPlay = YES;
......@@ -1329,19 +1350,20 @@ static const CGFloat gifSeconds = 0.25;
self.disableGesButton.hidden = YES;
self.windowsButton.hidden = YES;
self.screenShotButton.hidden = YES;
self.windowsCloseButton.hidden = NO;
self.windowsPlayOrPauseButton.hidden = NO;
self.windowsResumeButton.hidden = NO;
}
//退出窗口模式
-(void)quitWindowsModel
{
if (!self.openWindowsPlay) {
return;
}
// if (!self.openWindowsPlay) {
// return;
// }
self.isWindowsPlay = NO;
......@@ -1456,7 +1478,7 @@ static const CGFloat gifSeconds = 0.25;
//顶部
-(void)backButtonAction
{
if (!self.isFull && !self.openWindowsPlay) {
if (!self.isFull) {
[self saveNsUserDefaults];
}
......@@ -2676,6 +2698,8 @@ static const CGFloat gifSeconds = 0.25;
return;
}
__weak typeof(self) weakSelf = self;
//获取下载地址 hlsSupport传@"0"
DWPlayInfo *playinfo = [[DWPlayInfo alloc] initWithUserId:[DWConfigurationManager sharedInstance].DWAccount_userId andVideoId:self.videoModel.videoId key:[DWConfigurationManager sharedInstance].DWAccount_apikey hlsSupport:@"0"];
......@@ -2688,6 +2712,7 @@ static const CGFloat gifSeconds = 0.25;
};
playinfo.finishBlock = ^(DWVodVideoModel *vodVideo) {
if (!vodVideo) {
[@"网络资源暂时不可用" showAlert];
return;
......@@ -2698,37 +2723,7 @@ static const CGFloat gifSeconds = 0.25;
return;
}
//这里根据自己业务逻辑进行调整,此处只是示例
DWVideoQualityModel * qualitiyModel = self.playerView.qualityModel;
DWDownloadSessionManager * manager = [DWDownloadSessionManager manager];
//验证当前任务是否已经在下载队列中
if ([manager checkLocalResourceWithVideoId:self.videoModel.videoId WithQuality:qualitiyModel.quality]) {
[@"当前任务已经在下载队列中" showAlert];
return;
}
NSString * imageUrl = nil;
NSString * title = @"";
if (self.vodModel) {
imageUrl = self.vodModel.imageUrl;
title = self.vodModel.title;
}else{
imageUrl = @"icon_placeholder.png";
}
DWDownloadModel * model = [DWDownloadSessionManager createDownloadModel:vodVideo Quality:qualitiyModel.quality AndOthersInfo:@{@"imageUrl":imageUrl,@"title":title}];
if (!model) {
[@"DownloadModel创建失败,请检查参数" showAlert];
return;
}
[manager startWithDownloadModel:model];
[[NSString stringWithFormat:@"开始下载:%@",vodVideo.title] showAlert];
[weakSelf startDownloadTask:vodVideo];
};
[playinfo start];
......
......@@ -26,5 +26,5 @@
#import "DWVodAdInfoModel.h"
//版本号
#define SDK_VERSION @"4.5.0"
#define SDK_VERSION @"4.5.1"
No preview for this file type
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -125,7 +125,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
......@@ -93,7 +93,7 @@
<footer>
<div class="footer-copyright">
<p class="copyright">Copyright &copy; 2020 com.bokecc. All rights reserved. Updated: 2020-05-13</p>
<p class="copyright">Copyright &copy; 2019 com.bokecc. All rights reserved. Updated: 2019-07-02</p>
<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment