Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CCVideo
VOD_iOS_SDK
Commits
43f9fa05
Commit
43f9fa05
authored
Jan 12, 2021
by
Hanruisong
Browse files
feat: 更新到4.12.0
1.支持防拖拽功能。 2.锁屏逻辑优化。 3.修复某些设备下投屏异常的问题。 4.SDK下载模块优化,提高稳定性。
parent
ad76c112
Changes
19
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
248 additions
and
47 deletions
+248
-47
Demo/Demo.xcodeproj/project.pbxproj
Demo/Demo.xcodeproj/project.pbxproj
+24
-24
Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/appa.xcuserdatad/UserInterfaceState.xcuserstate
...cuserdata/appa.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Demo/Demo/Classes/DWMainViewController.m
Demo/Demo/Classes/DWMainViewController.m
+1
-0
Demo/Demo/Classes/DWVodPlayViewController.m
Demo/Demo/Classes/DWVodPlayViewController.m
+21
-3
Demo/Demo/Classes/View/Player/DWVodPlayerView.h
Demo/Demo/Classes/View/Player/DWVodPlayerView.h
+5
-0
Demo/Demo/Classes/View/Player/DWVodPlayerView.m
Demo/Demo/Classes/View/Player/DWVodPlayerView.m
+167
-7
Demo/Demo/Classes/View/ProjectionScreen/DWScreeningBgView.m
Demo/Demo/Classes/View/ProjectionScreen/DWScreeningBgView.m
+17
-9
Demo/Demo/DWConfigurationManager.m
Demo/Demo/DWConfigurationManager.m
+1
-0
Demo/Demo/Demo-Info.plist
Demo/Demo/Demo-Info.plist
+2
-0
Demo/Demo/Demo-Prefix.pch
Demo/Demo/Demo-Prefix.pch
+2
-0
Demo/Demo/SDK/CCVodSDK.framework/CCVodSDK
Demo/Demo/SDK/CCVodSDK.framework/CCVodSDK
+0
-0
Demo/Demo/SDK/CCVodSDK.framework/Headers/CCVodSDK.h
Demo/Demo/SDK/CCVodSDK.framework/Headers/CCVodSDK.h
+1
-1
Demo/Demo/SDK/CCVodSDK.framework/Info.plist
Demo/Demo/SDK/CCVodSDK.framework/Info.plist
+0
-0
doc/iOS点播SDK开发指南/1.概述.html
doc/iOS点播SDK开发指南/1.概述.html
+2
-1
doc/iOS点播SDK开发指南/5.更新日志.html
doc/iOS点播SDK开发指南/5.更新日志.html
+0
-0
doc/iOS点播SDK开发指南/6.常见问题.html
doc/iOS点播SDK开发指南/6.常见问题.html
+4
-1
include/CCVodSDK.framework/CCVodSDK
include/CCVodSDK.framework/CCVodSDK
+0
-0
include/CCVodSDK.framework/Headers/CCVodSDK.h
include/CCVodSDK.framework/Headers/CCVodSDK.h
+1
-1
include/CCVodSDK.framework/Info.plist
include/CCVodSDK.framework/Info.plist
+0
-0
No files found.
Demo/Demo.xcodeproj/project.pbxproj
View file @
43f9fa05
...
...
@@ -407,12 +407,12 @@
DD54280B250B55AB0097614C
/* icon_ad_mute@3x.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD542807250B55AB0097614C
/* icon_ad_mute@3x.png */
;
};
DD54280C250B55AB0097614C
/* icon_ad_mute@2x.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD542808250B55AB0097614C
/* icon_ad_mute@2x.png */
;
};
DD54280D250B55AB0097614C
/* icon_ad_mute_select@3x.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD542809250B55AB0097614C
/* icon_ad_mute_select@3x.png */
;
};
DD8
1DFDA2587129C00F83CCC
/* DWResource.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
1DFD82587129C00F83CCC
/* DWResource.bundle */
;
};
DD8
1DFDB2587129C00F83CCC
/* vrlibraw.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
1DFD92587129C00F83CCC
/* vrlibraw.bundle */
;
};
DD8
1DFDC2587141000F83CCC
/* HDBaseUtils
.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
1DFD42587126600F83CCC
/* HDBaseUtils
.framework */
;
};
DD8
1DFDD2587141000F83CCC
/* HDBaseUtils
.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
1DFD42587126600F83CCC
/* HDBaseUtils
.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
DD8
1DFDE2587141500F83CCC
/* CCVodSDK
.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
1DFD32587126600F83CCC
/* CCVodSDK
.framework */
;
};
DD8
1DFDF2587141500F83CCC
/* CCVodSDK
.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
1DFD32587126600F83CCC
/* CCVodSDK
.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
DD8
9BEB025AC266C0000B315
/* DWResource.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
9BEAE25AC266C0000B315
/* DWResource.bundle */
;
};
DD8
9BEB125AC266C0000B315
/* vrlibraw.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
9BEAF25AC266C0000B315
/* vrlibraw.bundle */
;
};
DD8
9BEB225AC26730000B315
/* CCVodSDK
.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
9BEA925AC26340000B315
/* CCVodSDK
.framework */
;
};
DD8
9BEB325AC26740000B315
/* CCVodSDK
.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
9BEA925AC26340000B315
/* CCVodSDK
.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
DD8
9BEB425AC26770000B315
/* HDBaseUtils
.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
9BEAA25AC26340000B315
/* HDBaseUtils
.framework */
;
};
DD8
9BEB525AC26770000B315
/* HDBaseUtils
.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD8
9BEAA25AC26340000B315
/* HDBaseUtils
.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
...
...
@@ -422,8 +422,8 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
DD8
1DFDD2587141000F83CCC
/* HDBaseUtils
.framework in Embed Frameworks */
,
DD8
1DFDF2587141500F83CCC
/* CCVodSDK
.framework in Embed Frameworks */
,
DD8
9BEB325AC26740000B315
/* CCVodSDK
.framework in Embed Frameworks */
,
DD8
9BEB525AC26770000B315
/* HDBaseUtils
.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -993,10 +993,10 @@
DD542807250B55AB0097614C
/* icon_ad_mute@3x.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
"icon_ad_mute@3x.png"
;
sourceTree
=
"<group>"
;
};
DD542808250B55AB0097614C
/* icon_ad_mute@2x.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
"icon_ad_mute@2x.png"
;
sourceTree
=
"<group>"
;
};
DD542809250B55AB0097614C
/* icon_ad_mute_select@3x.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
"icon_ad_mute_select@3x.png"
;
sourceTree
=
"<group>"
;
};
DD8
1DFD32587126600F83CCC
/* CCVodSDK.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
CCVodSDK.framework
;
sourceTree
=
"<group>"
;
};
DD8
1DFD42587126600F83CCC
/* HDBaseUtils.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
HDBaseUtils.framework
;
sourceTree
=
"<group>"
;
};
DD8
1DFD82587129C00F83CCC
/* DWResource.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
DWResource.bundle
;
path
=
CCVodSDK.framework/DWResource.bundle
;
sourceTree
=
"<group>"
;
};
DD8
1DFD92587129C00F83CCC
/* vrlibraw.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
vrlibraw.bundle
;
path
=
CCVodSDK.framework/vrlibraw.bundle
;
sourceTree
=
"<group>"
;
};
DD8
9BEA925AC26340000B315
/* CCVodSDK.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
CCVodSDK.framework
;
sourceTree
=
"<group>"
;
};
DD8
9BEAA25AC26340000B315
/* HDBaseUtils.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
HDBaseUtils.framework
;
sourceTree
=
"<group>"
;
};
DD8
9BEAE25AC266C0000B315
/* DWResource.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
DWResource.bundle
;
path
=
CCVodSDK.framework/DWResource.bundle
;
sourceTree
=
"<group>"
;
};
DD8
9BEAF25AC266C0000B315
/* vrlibraw.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
vrlibraw.bundle
;
path
=
CCVodSDK.framework/vrlibraw.bundle
;
sourceTree
=
"<group>"
;
};
DDF1A579255E8A52007EE8B9
/* MobileCoreServices.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
MobileCoreServices.framework
;
path
=
System/Library/Frameworks/MobileCoreServices.framework
;
sourceTree
=
SDKROOT
;
};
/* End PBXFileReference section */
...
...
@@ -1005,14 +1005,14 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
DD8
1DFDC2587141000F83CCC
/* HDBaseUtils.framework in Frameworks */
,
DD8
9BEB425AC26770000B315
/* HDBaseUtils.framework in Frameworks */
,
048AD12822CDCE83008C8911
/* libxml2.tbd in Frameworks */
,
043441FF225EF2BB003F7EC1
/* CoreServices.framework in Frameworks */
,
352CBDD91FD6980C00D24715
/* AudioToolbox.framework in Frameworks */
,
352CBDD71FD697E800D24715
/* MediaPlayer.framework in Frameworks */
,
B88562A41DED1AC8008D1763
/* SystemConfiguration.framework in Frameworks */
,
B57CC7C018E2E581001A1696
/* AVFoundation.framework in Frameworks */
,
DD8
1DFDE2587141500F83CCC
/* CCVodSDK.framework in Frameworks */
,
DD8
9BEB225AC26730000B315
/* CCVodSDK.framework in Frameworks */
,
B57CC7BE18E2E575001A1696
/* CoreLocation.framework in Frameworks */
,
B57CC7BC18E2E569001A1696
/* CoreMedia.framework in Frameworks */
,
B547EC4C18E033FB00BC980C
/* CoreGraphics.framework in Frameworks */
,
...
...
@@ -1847,7 +1847,7 @@
isa
=
PBXGroup
;
children
=
(
044C66A122D46DAE0032396F
/* Demo.entitlements */
,
DD8
1DFD22587126600F83CCC
/* SDK */
,
DD8
9BEA825AC26340000B315
/* SDK */
,
0434420D225F0EDD003F7EC1
/* Classes */
,
B547EC5818E033FB00BC980C
/* DWAppDelegate.h */
,
B547EC5918E033FB00BC980C
/* DWAppDelegate.m */
,
...
...
@@ -1874,13 +1874,13 @@
name
=
"Supporting Files"
;
sourceTree
=
"<group>"
;
};
DD8
1DFD22587126600F83CCC
/* SDK */
=
{
DD8
9BEA825AC26340000B315
/* SDK */
=
{
isa
=
PBXGroup
;
children
=
(
DD8
1DFD82587129C00F83CCC
/* DWResource.bundle */
,
DD8
1DFD92587129C00F83CCC
/* vrlibraw.bundle */
,
DD8
1DFD32587126600F83CCC
/* CCVodSDK.framework */
,
DD8
1DFD42587126600F83CCC
/* HDBaseUtils.framework */
,
DD8
9BEAE25AC266C0000B315
/* DWResource.bundle */
,
DD8
9BEAF25AC266C0000B315
/* vrlibraw.bundle */
,
DD8
9BEA925AC26340000B315
/* CCVodSDK.framework */
,
DD8
9BEAA25AC26340000B315
/* HDBaseUtils.framework */
,
);
path
=
SDK
;
sourceTree
=
"<group>"
;
...
...
@@ -1896,7 +1896,7 @@
B547EC4318E033FB00BC980C
/* Frameworks */
,
B547EC4418E033FB00BC980C
/* Resources */
,
DD0F24D3255E22B000DA2705
/* Embed Frameworks */
,
DD8
1DFD72587128B00F83CCC
/* ShellScript */
,
DD8
9BEAD25AC26580000B315
/* ShellScript */
,
);
buildRules
=
(
);
...
...
@@ -2056,7 +2056,7 @@
04AB4A3722B1F22A00BB9BF9
/* icon_exercises_error@2x.png in Resources */
,
04D60ED822719B9C0009C572
/* icon_play_vr_inselect_select@2x.png in Resources */
,
043D4E6B22D5C91D00FCDCBE
/* icon_sound_add@2x.png in Resources */
,
DD8
1DFDA2587129C00F83CCC
/* DWResource.bundle in Resources */
,
DD8
9BEB025AC266C0000B315
/* DWResource.bundle in Resources */
,
04346AC8249720C6005A3396
/* icon_screenshot@2x.png in Resources */
,
04B7A661226B0E5E00951983
/* icon_question_multi_select@3x.png in Resources */
,
04AB4A3F22B1F22A00BB9BF9
/* icon_exercises_answer_d_select@2x.png in Resources */
,
...
...
@@ -2154,7 +2154,7 @@
04346AC0249720C6005A3396
/* brightness.png in Resources */
,
04B7A65F226B0E5E00951983
/* icon_question_single_select@2x.png in Resources */
,
0491DD1F24B5604300DF40C7
/* icon_barrage_color_select@3x.png in Resources */
,
DD8
1DFDB2587129C00F83CCC
/* vrlibraw.bundle in Resources */
,
DD8
9BEB125AC266C0000B315
/* vrlibraw.bundle in Resources */
,
04BAA93D22D4787B000495B4
/* icon_screen_list@2x.png in Resources */
,
04AB4A2622B1F22A00BB9BF9
/* icon_exercises_answer_g_normal@2x.png in Resources */
,
04B7A65C226B0E5E00951983
/* icon_question_multi_select@2x.png in Resources */
,
...
...
@@ -2204,7 +2204,7 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
DD8
1DFD72587128B00F83CCC
/* ShellScript */
=
{
DD8
9BEAD25AC26580000B315
/* ShellScript */
=
{
isa
=
PBXShellScriptBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
...
...
Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/appa.xcuserdatad/UserInterfaceState.xcuserstate
View file @
43f9fa05
No preview for this file type
Demo/Demo/Classes/DWMainViewController.m
View file @
43f9fa05
...
...
@@ -89,6 +89,7 @@
}];
[
task
resume
];
}
-
(
void
)
reloadLoaclData
...
...
Demo/Demo/Classes/DWVodPlayViewController.m
View file @
43f9fa05
...
...
@@ -33,6 +33,8 @@ typedef enum : NSUInteger {
@property
(
nonatomic
,
strong
)
DWScreeningBgView
*
screenBgView
;
//投屏控制器
@property
(
nonatomic
,
assign
)
BOOL
isLock
;
@end
@implementation
DWVodPlayViewController
...
...
@@ -41,7 +43,6 @@ typedef enum : NSUInteger {
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
initParams
];
[
self
initUI
];
...
...
@@ -207,6 +208,10 @@ typedef enum : NSUInteger {
#pragma mark - notification
-
(
void
)
deviceOrientationChangeNotification
{
if
(
self
.
isLock
)
{
return
;
}
UIDeviceOrientation
orientation
=
[
UIDevice
currentDevice
].
orientation
;
UIInterfaceOrientation
interfaceOrientation
=
(
UIInterfaceOrientation
)
orientation
;
...
...
@@ -296,6 +301,8 @@ typedef enum : NSUInteger {
//选集选择事件
-
(
void
)
vodPlayerView
:(
DWVodPlayerView
*
)
playerView
ChooseSelection
:(
NSInteger
)
selectionIndex
{
[
self
.
playerView
saveSliderSchedule
];
DWVodModel
*
vodModel
=
[
self
.
vidoeList
objectAtIndex
:
selectionIndex
];
self
.
vodModel
=
vodModel
;
[
self
startRequestVideo
:
self
.
vodModel
.
videoId
];
...
...
@@ -372,6 +379,12 @@ typedef enum : NSUInteger {
[
self
startRequestAdInfo
:
3
];
}
//锁屏事件
-
(
void
)
vodPlayerViewLockScreen
:(
BOOL
)
isLock
{
self
.
isLock
=
isLock
;
}
#pragma mark - 投屏相关
-
(
void
)
screeningReturnButtonAction
{
...
...
@@ -395,7 +408,8 @@ typedef enum : NSUInteger {
-
(
void
)
screeningBgViewCloseAction
{
self
.
playerView
.
isScreening
=
NO
;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
screenBgView
removeFromSuperview
];
self
.
screenBgView
=
nil
;
...
...
@@ -448,6 +462,8 @@ typedef enum : NSUInteger {
[
self
.
adShowView
adFinish
];
}
self
.
playerView
.
isShowAd
=
NO
;
[
self
.
playerView
saveSliderSchedule
];
self
.
vodModel
=
vodModel
;
DWConfigurationManager
*
manager
=
[
DWConfigurationManager
sharedInstance
];
...
...
@@ -579,6 +595,7 @@ typedef enum : NSUInteger {
-
(
void
)
initParams
{
self
.
cellStyle
=
DWVodPlayTableViewCellStyleDefault
;
self
.
isLock
=
NO
;
}
-
(
void
)
initUI
...
...
@@ -669,7 +686,8 @@ typedef enum : NSUInteger {
-
(
BOOL
)
shouldAutorotate
{
return
YES
;
return
!
self
.
isLock
;
// return YES;
}
/*
...
...
Demo/Demo/Classes/View/Player/DWVodPlayerView.h
View file @
43f9fa05
...
...
@@ -32,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
vodPlayerViewDidEnterWindowsModel
:(
DWVodPlayerView
*
)
playerView
;
//片尾广告事件
-
(
void
)
vodPlayerViewEndAd
:(
DWVodPlayerView
*
)
playerView
;
//锁屏事件
-
(
void
)
vodPlayerViewLockScreen
:(
BOOL
)
isLock
;
@end
...
...
@@ -89,6 +91,9 @@ NS_ASSUME_NONNULL_BEGIN
//播放下一集
-
(
void
)
playNextVideo
;
//切换视频,保存已看进度
-
(
void
)
saveSliderSchedule
;
@end
NS_ASSUME_NONNULL_END
Demo/Demo/Classes/View/Player/DWVodPlayerView.m
View file @
43f9fa05
...
...
@@ -54,6 +54,9 @@
@property
(
nonatomic
,
strong
)
UIButton
*
windowsPlayOrPauseButton
;
@property
(
nonatomic
,
strong
)
UIButton
*
windowsResumeButton
;
@property
(
nonatomic
,
assign
)
BOOL
allowSlider
;
//是否开启防拖拽,默认关闭
@property
(
nonatomic
,
assign
)
CGFloat
sliderTime
;
//禁止拖拽时间
//是否加载完毕
@property
(
nonatomic
,
assign
)
BOOL
readyToPlay
;
...
...
@@ -251,6 +254,10 @@ static CGFloat barrageBgHeight = 40;
//是否开启画中画
self
.
allowPictureInPicture
=
NO
;
//是否开启防拖拽功能,默认关闭
self
.
allowSlider
=
NO
;
self
.
sliderTime
=
0
;
self
.
isShowAd
=
NO
;
self
.
allowImpact
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"allowImpact"
]
boolValue
];
...
...
@@ -510,6 +517,12 @@ static CGFloat barrageBgHeight = 40;
[
self
nextButtonAction
];
}
//切换视频,保存已看进度
-
(
void
)
saveSliderSchedule
{
[
self
writeSliderWithVideoID
:
self
.
vodModel
.
videoId
];
}
#pragma mark - function
//保存videoModel ,并对打点,问答,字幕等功能数据进行处理
-
(
void
)
setVideoModel
:(
DWVodVideoModel
*
)
videoModel
...
...
@@ -625,7 +638,6 @@ static CGFloat barrageBgHeight = 40;
[
_disableGesButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
@10
);
}];
}
if
(
interfaceOrientation
==
UIInterfaceOrientationLandscapeRight
)
{
...
...
@@ -642,7 +654,6 @@ static CGFloat barrageBgHeight = 40;
[
_disableGesButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
@
(
self
.
areaInsets
.
left
));
}];
}
[
self
.
currentLabel
mas_remakeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
...
...
@@ -1239,10 +1250,17 @@ static CGFloat barrageBgHeight = 40;
self
.
isSlidering
=
NO
;
return
;
}
CGFloat
durationInSeconds
=
CMTimeGetSeconds
(
self
.
playerView
.
player
.
currentItem
.
duration
);
CGFloat
time
=
durationInSeconds
*
value
;
//主要逻辑在这里处理
if
(
self
.
allowSlider
)
{
if
(
time
>
self
.
sliderTime
)
{
time
=
self
.
sliderTime
;
}
}
//授权验证功能
if
(
!
self
.
enable
)
{
NSInteger
freetime
=
self
.
videoModel
.
authorize
.
freetime
;
...
...
@@ -1282,6 +1300,67 @@ static CGFloat barrageBgHeight = 40;
}];
}
-
(
void
)
writeSliderWithVideoID
:(
NSString
*
)
videoID
{
if
(
!
videoID
)
{
return
;
}
if
(
!
self
.
allowSlider
)
{
return
;
}
NSMutableDictionary
*
infoDict
;
if
([[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
DWVIDEOPLAYSCHEDULE
])
{
infoDict
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
DWVIDEOPLAYSCHEDULE
]
mutableCopy
];
}
else
{
infoDict
=
[[
NSMutableDictionary
alloc
]
init
];
}
[
infoDict
setObject
:
@
(
self
.
sliderTime
)
forKey
:
videoID
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
infoDict
forKey
:
DWVIDEOPLAYSCHEDULE
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
}
-
(
CGFloat
)
readSliderWithVideoID
:(
NSString
*
)
videoID
{
if
(
!
videoID
)
{
return
0
;
}
if
(
!
self
.
allowSlider
)
{
return
0
;
}
//取记忆播放的时间点
NSUserDefaults
*
userDefaults
=
[
NSUserDefaults
standardUserDefaults
];
NSMutableDictionary
*
infoDict
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
DWVIDEOPLAYSCHEDULE
];
if
(
!
[
infoDict
objectForKey
:
videoID
])
{
return
0
;
}
CGFloat
sliderTime
=
[[
infoDict
objectForKey
:
videoID
]
floatValue
];
if
(
sliderTime
==
0
)
{
//取记忆播放位置
CGFloat
playTime
=
0
;
id
saveTime
=
nil
;
if
(
self
.
videoModel
)
{
saveTime
=
[
userDefaults
objectForKey
:
self
.
videoModel
.
videoId
];
}
else
{
saveTime
=
[
userDefaults
objectForKey
:
self
.
downloadModel
.
filePath
];
}
if
([
saveTime
isKindOfClass
:[
NSDictionary
class
]])
{
//旧版本存储的播放数据
playTime
=
[[
saveTime
objectForKey
:
@"playbackTime"
]
floatValue
];
}
else
{
playTime
=
[
saveTime
floatValue
];
}
sliderTime
=
playTime
;
}
return
sliderTime
;
}
#pragma mark - func Timer
-
(
void
)
initFuncGesture
...
...
@@ -1350,8 +1429,9 @@ static CGFloat barrageBgHeight = 40;
UIDeviceOrientation
orientation
=
[
UIDevice
currentDevice
].
orientation
;
UIInterfaceOrientation
interfaceOrientation
=
(
UIInterfaceOrientation
)
orientation
;
if
(
self
.
isLock
)
{
[
_topFuncBgView
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
@
(
-
topHeight
));
make
.
height
.
equalTo
(
@
(
topHeight
));
...
...
@@ -1362,6 +1442,29 @@ static CGFloat barrageBgHeight = 40;
make
.
height
.
equalTo
(
@
(
bottomHeight
));
}];
/*
[self addSubview:self.gifButton];
[_gifButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(@(self.areaInsets.right));
make.centerY.equalTo(self).offset(24);
make.width.and.height.equalTo(@30);
}];
[self addSubview:self.disableGesButton];
[_disableGesButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@(self.areaInsets.left));
make.centerY.equalTo(self);
make.width.and.height.equalTo(@30);
}];
[self addSubview:self.screenShotButton];
[self.screenShotButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(@(self.areaInsets.right));
make.centerY.equalTo(self).offset(-24);
make.width.and.height.equalTo(@30);
}];
*/
if
(
appear
)
{
if
(
interfaceOrientation
==
UIInterfaceOrientationLandscapeLeft
)
{
...
...
@@ -1379,6 +1482,7 @@ static CGFloat barrageBgHeight = 40;
}
if
(
interfaceOrientation
==
UIInterfaceOrientationLandscapeRight
)
{
[
_gifButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
@
(
10
+
30
));
}];
...
...
@@ -1392,6 +1496,23 @@ static CGFloat barrageBgHeight = 40;
}];
}
if
(
interfaceOrientation
==
UIInterfaceOrientationPortrait
)
{
[
_gifButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
@
(
10
+
30
));
}];
[
_screenShotButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
@
(
10
+
30
));
}];
[
_disableGesButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
@
(
self
.
areaInsets
.
left
));
}];
}
}
else
{
if
(
interfaceOrientation
==
UIInterfaceOrientationLandscapeLeft
)
{
...
...
@@ -1423,6 +1544,20 @@ static CGFloat barrageBgHeight = 40;
}];
}
if
(
interfaceOrientation
==
UIInterfaceOrientationPortrait
)
{
[
_gifButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
@
(
10
+
30
));
}];
[
_screenShotButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
@
(
10
+
30
));
}];
[
_disableGesButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
@
(
-
40
));
}];
}
}
}
else
{
if
(
appear
)
{
...
...
@@ -1479,7 +1614,6 @@ static CGFloat barrageBgHeight = 40;
[
_disableGesButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
@
(
self
.
areaInsets
.
left
));
}];
}
if
(
self
.
isShowMarkView
&&
self
.
isFull
)
{
...
...
@@ -1536,7 +1670,6 @@ static CGFloat barrageBgHeight = 40;
[
_disableGesButton
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
@
(
-
self
.
areaInsets
.
left
-
30
));
}];
}
[
self
showOrHiddenMarkView
:
YES
];
...
...
@@ -1737,14 +1870,18 @@ static CGFloat barrageBgHeight = 40;
[
self
saveNsUserDefaults
];
[
self
.
barrageManager
cancelRequest
];
[
self
writeSliderWithVideoID
:
self
.
downloadModel
.
videoId
];
}
else
{
if
(
!
self
.
isFull
)
{
[
self
saveNsUserDefaults
];
[
self
.
barrageManager
cancelRequest
];
[
self
writeSliderWithVideoID
:
self
.
vodModel
.
videoId
];
}
}
if
([
_delegate
respondsToSelector
:
@selector
(
vodPlayerView
:
ReturnBackAction
:
)])
{
[
_delegate
vodPlayerView
:
self
ReturnBackAction
:
self
.
isFull
];
}
...
...
@@ -2028,6 +2165,14 @@ static CGFloat barrageBgHeight = 40;
//非锁屏
[
self
createFuncTimer
];
}
if
([
self
.
delegate
respondsToSelector
:
@selector
(
vodPlayerViewLockScreen
:)])
{
[
self
.
delegate
vodPlayerViewLockScreen
:
self
.
isLock
];
}
if
(
!
self
.
isLock
)
{
[[
UIDevice
currentDevice
]
setValue
:[
NSNumber
numberWithInteger
:
UIDeviceOrientationLandscapeLeft
]
forKey
:
@"orientation"
];
}
}
-
(
void
)
setIsLock
:(
BOOL
)
isLock
...
...
@@ -3350,6 +3495,9 @@ static CGFloat barrageBgHeight = 40;
}
}
//读取可拖拽位置
self
.
sliderTime
=
[
self
readSliderWithVideoID
:
self
.
downloadModel
?
self
.
downloadModel
.
videoId
:
self
.
vodModel
.
videoId
];
//读取原先的播放时间 用oldTimeScrub方法
[
self
.
playerView
oldTimeScrub
:
self
.
switchTime
];
...
...
@@ -3368,6 +3516,12 @@ static CGFloat barrageBgHeight = 40;
[
self
endRecordGif
];
}
if
(
self
.
downloadModel
)
{
[
self
writeSliderWithVideoID
:
self
.
downloadModel
.
videoId
];
}
else
{
[
self
writeSliderWithVideoID
:
self
.
vodModel
.
videoId
];
}
DWConfigurationManager
*
manager
=
[
DWConfigurationManager
sharedInstance
];
if
(
manager
.
isOpenAd
)
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
vodPlayerViewEndAd
:)])
{
...
...
@@ -3388,6 +3542,12 @@ static CGFloat barrageBgHeight = 40;
[
self
hideHudWithMessage
:
nil
];
}
if
(
self
.
allowSlider
)
{
if
(
self
.
sliderTime
<
time
)
{
self
.
sliderTime
=
time
;
}
}
self
.
currentPlayDuration
=
time
;
//授权验证功能
...
...
Demo/Demo/Classes/View/ProjectionScreen/DWScreeningBgView.m
View file @
43f9fa05
...
...
@@ -210,21 +210,20 @@ static CGFloat bottomFuncBgHeight = 39;
-
(
void
)
upnpSubscriptionPlay
{
[
self
play
];
// [self play];
[
self
.
renderer
getTransportInfo
];
[
self
.
renderer
getPositionInfo
];
}
-
(
void
)
upnpSubscriptionPause
{
[
self
pause
];
// [self pause];
[
self
.
renderer
getTransportInfo
];
}
-
(
void
)
upnpSubscriptionStop
{
//结束投屏
[
self
.
renderer
stop
];
//结束订阅
[
self
.
subscription
cancelSubscribe
];
...
...
@@ -236,7 +235,8 @@ static CGFloat bottomFuncBgHeight = 39;
-
(
void
)
upnpSubscriptionWithError
:(
NSError
*
)
error
{
[
@"订阅失败"
showAlert
];
// [@"订阅失败" showAlert];
[
error
.
localizedDescription
showAlert
];
}
#pragma mark - DWUPnPResponseDelegate
...
...
@@ -245,8 +245,9 @@ static CGFloat bottomFuncBgHeight = 39;
{
NSLog
(
@"upnpUndefinedResponse resXML:%@
\n
postXML:%@"
,
resXML
,
postXML
);
if
(
!
resXML
)
{
[
self
.
renderer
getTransportInfo
];
//投屏失败