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
bdf2ea22
Commit
bdf2ea22
authored
Oct 20, 2020
by
Hanruisong
Browse files
feat: 更新到 4.10.0
1.课堂练习功能优化。 2.修复demo中进度条在iOS14上显示异常的问题。
parent
26e0cdd2
Changes
146
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
434 additions
and
74 deletions
+434
-74
Demo/Demo.xcodeproj/project.pbxproj
Demo/Demo.xcodeproj/project.pbxproj
+49
-12
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
-1
Demo/Demo/Classes/View/Exercises/DWExercisesAlertView.h
Demo/Demo/Classes/View/Exercises/DWExercisesAlertView.h
+9
-1
Demo/Demo/Classes/View/Exercises/DWExercisesAlertView.m
Demo/Demo/Classes/View/Exercises/DWExercisesAlertView.m
+32
-4
Demo/Demo/Classes/View/Exercises/DWExercisesQuestionView.h
Demo/Demo/Classes/View/Exercises/DWExercisesQuestionView.h
+6
-0
Demo/Demo/Classes/View/Exercises/DWExercisesQuestionView.m
Demo/Demo/Classes/View/Exercises/DWExercisesQuestionView.m
+102
-11
Demo/Demo/Classes/View/Exercises/DWExercisesView.h
Demo/Demo/Classes/View/Exercises/DWExercisesView.h
+6
-1
Demo/Demo/Classes/View/Exercises/DWExercisesView.m
Demo/Demo/Classes/View/Exercises/DWExercisesView.m
+115
-12
Demo/Demo/Classes/View/Player/DWPlayerSlider.m
Demo/Demo/Classes/View/Player/DWPlayerSlider.m
+20
-6
Demo/Demo/Classes/View/Player/DWVodPlayerView.m
Demo/Demo/Classes/View/Player/DWVodPlayerView.m
+71
-21
Demo/Demo/DWAppDelegate.h
Demo/Demo/DWAppDelegate.h
+0
-1
Demo/Demo/DWAppDelegate.m
Demo/Demo/DWAppDelegate.m
+0
-1
Demo/Demo/DWConfigurationManager.m
Demo/Demo/DWConfigurationManager.m
+1
-1
Demo/Demo/Images/icon_exercises_close@2x.png
Demo/Demo/Images/icon_exercises_close@2x.png
+0
-0
Demo/Demo/Images/icon_exercises_close@3x.png
Demo/Demo/Images/icon_exercises_close@3x.png
+0
-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/Headers/DWPlayerSkinView.h
Demo/Demo/SDK/CCVodSDK.framework/Headers/DWPlayerSkinView.h
+0
-1
Demo/Demo/SDK/CCVodSDK.framework/Headers/DWVodVideoModel.h
Demo/Demo/SDK/CCVodSDK.framework/Headers/DWVodVideoModel.h
+21
-0
No files found.
Demo/Demo.xcodeproj/project.pbxproj
View file @
bdf2ea22
...
...
@@ -401,9 +401,13 @@
B57CC7BE18E2E575001A1696
/* CoreLocation.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B57CC7BD18E2E575001A1696
/* CoreLocation.framework */
;
};
B57CC7C018E2E581001A1696
/* AVFoundation.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B57CC7BF18E2E581001A1696
/* AVFoundation.framework */
;
};
B88562A41DED1AC8008D1763
/* SystemConfiguration.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B88562A31DED1AC8008D1763
/* SystemConfiguration.framework */
;
};
DD11422C251DE391005610EC
/* CCVodSDK.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD11422A251DE390005610EC
/* CCVodSDK.framework */
;
};
DD11422E251DE399005610EC
/* HDBaseUtils.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD11422B251DE390005610EC
/* HDBaseUtils.framework */
;
};
DD11422F251DE399005610EC
/* HDBaseUtils.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD11422B251DE390005610EC
/* HDBaseUtils.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
DD21E564253EBCEA00A6E3FA
/* CCVodSDK.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD21E562253EBCE900A6E3FA
/* CCVodSDK.framework */
;
};
DD21E566253EBCF100A6E3FA
/* HDBaseUtils.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD21E563253EBCE900A6E3FA
/* HDBaseUtils.framework */
;
};
DD21E567253EBCF100A6E3FA
/* HDBaseUtils.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD21E563253EBCE900A6E3FA
/* HDBaseUtils.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
DD21E56A253EBD6D00A6E3FA
/* vrlibraw.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD21E568253EBD6C00A6E3FA
/* vrlibraw.bundle */
;
};
DD21E56B253EBD6D00A6E3FA
/* DWResource.bundle in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD21E569253EBD6C00A6E3FA
/* DWResource.bundle */
;
};
DD25727D24F79DED00D9BB55
/* icon_exercises_close@3x.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD25727B24F79DED00D9BB55
/* icon_exercises_close@3x.png */
;
};
DD25727E24F79DED00D9BB55
/* icon_exercises_close@2x.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD25727C24F79DED00D9BB55
/* icon_exercises_close@2x.png */
;
};
DD54280A250B55AB0097614C
/* icon_ad_mute_select@2x.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
DD542806250B55AA0097614C
/* icon_ad_mute_select@2x.png */
;
};
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 */
;
};
...
...
@@ -417,7 +421,7 @@
dstPath
=
""
;
dstSubfolderSpec
=
10
;
files
=
(
DD
11422F251DE399005610EC
/* HDBaseUtils.framework in Embed Frameworks */
,
DD
21E567253EBCF100A6E3FA
/* HDBaseUtils.framework in Embed Frameworks */
,
);
name
=
"Embed Frameworks"
;
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -981,8 +985,12 @@
B57CC7BD18E2E575001A1696
/* CoreLocation.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
CoreLocation.framework
;
path
=
System/Library/Frameworks/CoreLocation.framework
;
sourceTree
=
SDKROOT
;
};
B57CC7BF18E2E581001A1696
/* AVFoundation.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
AVFoundation.framework
;
path
=
System/Library/Frameworks/AVFoundation.framework
;
sourceTree
=
SDKROOT
;
};
B88562A31DED1AC8008D1763
/* SystemConfiguration.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
SystemConfiguration.framework
;
path
=
System/Library/Frameworks/SystemConfiguration.framework
;
sourceTree
=
SDKROOT
;
};
DD11422A251DE390005610EC
/* CCVodSDK.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
CCVodSDK.framework
;
sourceTree
=
"<group>"
;
};
DD11422B251DE390005610EC
/* HDBaseUtils.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
HDBaseUtils.framework
;
sourceTree
=
"<group>"
;
};
DD21E562253EBCE900A6E3FA
/* CCVodSDK.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
CCVodSDK.framework
;
sourceTree
=
"<group>"
;
};
DD21E563253EBCE900A6E3FA
/* HDBaseUtils.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
path
=
HDBaseUtils.framework
;
sourceTree
=
"<group>"
;
};
DD21E568253EBD6C00A6E3FA
/* vrlibraw.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
vrlibraw.bundle
;
path
=
CCVodSDK.framework/vrlibraw.bundle
;
sourceTree
=
"<group>"
;
};
DD21E569253EBD6C00A6E3FA
/* DWResource.bundle */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.plug-in"
;
name
=
DWResource.bundle
;
path
=
CCVodSDK.framework/DWResource.bundle
;
sourceTree
=
"<group>"
;
};
DD25727B24F79DED00D9BB55
/* icon_exercises_close@3x.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
"icon_exercises_close@3x.png"
;
sourceTree
=
"<group>"
;
};
DD25727C24F79DED00D9BB55
/* icon_exercises_close@2x.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
"icon_exercises_close@2x.png"
;
sourceTree
=
"<group>"
;
};
DD542806250B55AA0097614C
/* icon_ad_mute_select@2x.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
"icon_ad_mute_select@2x.png"
;
sourceTree
=
"<group>"
;
};
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>"
;
};
...
...
@@ -994,7 +1002,7 @@
isa
=
PBXFrameworksBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
DD
11422E251DE399005610EC
/* HDBaseUtils.framework in Frameworks */
,
DD
21E566253EBCF100A6E3FA
/* HDBaseUtils.framework in Frameworks */
,
048AD12822CDCE83008C8911
/* libxml2.tbd in Frameworks */
,
043441FF225EF2BB003F7EC1
/* CoreServices.framework in Frameworks */
,
352CBDD91FD6980C00D24715
/* AudioToolbox.framework in Frameworks */
,
...
...
@@ -1002,7 +1010,7 @@
B88562A41DED1AC8008D1763
/* SystemConfiguration.framework in Frameworks */
,
B57CC7C018E2E581001A1696
/* AVFoundation.framework in Frameworks */
,
B57CC7BE18E2E575001A1696
/* CoreLocation.framework in Frameworks */
,
DD
11422C251DE391005610EC
/* CCVodSDK.framework in Frameworks */
,
DD
21E564253EBCEA00A6E3FA
/* CCVodSDK.framework in Frameworks */
,
B57CC7BC18E2E569001A1696
/* CoreMedia.framework in Frameworks */
,
B547EC4C18E033FB00BC980C
/* CoreGraphics.framework in Frameworks */
,
B547EC4E18E033FB00BC980C
/* UIKit.framework in Frameworks */
,
...
...
@@ -1435,6 +1443,8 @@
049FEF82225EEEA200D944C5
/* Images */
=
{
isa
=
PBXGroup
;
children
=
(
DD25727C24F79DED00D9BB55
/* icon_exercises_close@2x.png */
,
DD25727B24F79DED00D9BB55
/* icon_exercises_close@3x.png */
,
DD542806250B55AA0097614C
/* icon_ad_mute_select@2x.png */
,
DD542809250B55AB0097614C
/* icon_ad_mute_select@3x.png */
,
DD542808250B55AB0097614C
/* icon_ad_mute@2x.png */
,
...
...
@@ -1833,7 +1843,7 @@
isa
=
PBXGroup
;
children
=
(
044C66A122D46DAE0032396F
/* Demo.entitlements */
,
DD
114229251DE390005610EC
/* SDK */
,
DD
21E561253EBCE900A6E3FA
/* SDK */
,
0434420D225F0EDD003F7EC1
/* Classes */
,
B547EC5818E033FB00BC980C
/* DWAppDelegate.h */
,
B547EC5918E033FB00BC980C
/* DWAppDelegate.m */
,
...
...
@@ -1860,11 +1870,13 @@
name
=
"Supporting Files"
;
sourceTree
=
"<group>"
;
};
DD
114229251DE390005610EC
/* SDK */
=
{
DD
21E561253EBCE900A6E3FA
/* SDK */
=
{
isa
=
PBXGroup
;
children
=
(
DD11422A251DE390005610EC
/* CCVodSDK.framework */
,
DD11422B251DE390005610EC
/* HDBaseUtils.framework */
,
DD21E569253EBD6C00A6E3FA
/* DWResource.bundle */
,
DD21E568253EBD6C00A6E3FA
/* vrlibraw.bundle */
,
DD21E562253EBCE900A6E3FA
/* CCVodSDK.framework */
,
DD21E563253EBCE900A6E3FA
/* HDBaseUtils.framework */
,
);
path
=
SDK
;
sourceTree
=
"<group>"
;
...
...
@@ -1880,6 +1892,7 @@
B547EC4318E033FB00BC980C
/* Frameworks */
,
B547EC4418E033FB00BC980C
/* Resources */
,
046FF38A2468F48100AB4A98
/* Embed Frameworks */
,
DD21E56C253EBDFA00A6E3FA
/* ShellScript */
,
);
buildRules
=
(
);
...
...
@@ -1967,6 +1980,7 @@
0491DD1E24B5604300DF40C7
/* icon_barrage_color_05_select@3x.png in Resources */
,
0491DCF724B5604300DF40C7
/* icon_barrage_set_close@2x.png in Resources */
,
04B0CBE624EA66BC004222DC
/* icon_setting_inpact_normal@2x.png in Resources */
,
DD25727D24F79DED00D9BB55
/* icon_exercises_close@3x.png in Resources */
,
04EB6605226DC94E00FAB532
/* icon_ad_full_select.png in Resources */
,
04AB4A3022B1F22A00BB9BF9
/* icon_exercises_answer_a_select@2x.png in Resources */
,
0491DD1824B5604300DF40C7
/* icon_barrage_color_08@2x.png in Resources */
,
...
...
@@ -1981,6 +1995,7 @@
04EB65D8226D9B6200FAB532
/* icon_setting_sound_high@2x.png in Resources */
,
04D7188922D45BDC002D41BD
/* icon_screen_horizontal@3x.png in Resources */
,
04FFA9E022647579008C2713
/* icon_play_radio@3x.png in Resources */
,
DD25727E24F79DED00D9BB55
/* icon_exercises_close@2x.png in Resources */
,
04EB65DC226D9B6200FAB532
/* icon_setting_light_low@2x.png in Resources */
,
04EB65DB226D9B6200FAB532
/* icon_setting_light_high@2x.png in Resources */
,
DD54280D250B55AB0097614C
/* icon_ad_mute_select@3x.png in Resources */
,
...
...
@@ -2007,6 +2022,7 @@
0491DCF824B5604300DF40C7
/* icon_barrage_close@3x.png in Resources */
,
0491DD2424B5604300DF40C7
/* icon_barrage_color_01@2x.png in Resources */
,
04FFA9EA22647579008C2713
/* icon_play_full@2x.png in Resources */
,
DD21E56A253EBD6D00A6E3FA
/* vrlibraw.bundle in Resources */
,
DD54280C250B55AB0097614C
/* icon_ad_mute@2x.png in Resources */
,
0491DCF224B5604300DF40C7
/* icon_barrage_set_return@3x.png in Resources */
,
0491DD0F24B5604300DF40C7
/* icon_barrage_color_05@3x.png in Resources */
,
...
...
@@ -2070,6 +2086,7 @@
0414B00623F51AA0002C7F7D
/* icon_pip@2x.png in Resources */
,
04FFA9F822647C84008C2713
/* icon_play_gif_normal@3x.png in Resources */
,
04F0B79F22602D8F0097C3CB
/* icon_return_black@2x.png in Resources */
,
DD21E56B253EBD6D00A6E3FA
/* DWResource.bundle in Resources */
,
043D018722B76F1C008589DA
/* icon_exercises_statistics_error@3x.png in Resources */
,
0491DD0124B5604300DF40C7
/* icon_barrage_set_normal@2x.png in Resources */
,
04FFA9D622647579008C2713
/* icon_play_return@3x.png in Resources */
,
...
...
@@ -2182,6 +2199,26 @@
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
DD21E56C253EBDFA00A6E3FA
/* ShellScript */
=
{
isa
=
PBXShellScriptBuildPhase
;
buildActionMask
=
2147483647
;
files
=
(
);
inputFileListPaths
=
(
);
inputPaths
=
(
);
outputFileListPaths
=
(
);
outputPaths
=
(
);
runOnlyForDeploymentPostprocessing
=
0
;
shellPath
=
/bin/sh
;
shellScript
=
"# This script loops through the frameworks embedded in the application and \n# removes unused architectures. \nAPP_PATH=\"${TARGET_BUILD_DIR}/${WRAPPER_NAME}\"\n\nfind \"$APP_PATH\" -name '*.framework' -type d | while read -r FRAMEWORK \ndo \nFRAMEWORK_EXECUTABLE_NAME=$(defaults read \"$FRAMEWORK/Info.plist\" CFBundleExecutable) \nFRAMEWORK_EXECUTABLE_PATH=\"$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME\" \necho \"Executable is $FRAMEWORK_EXECUTABLE_PATH\" \n \nEXTRACTED_ARCHS=() \n \nfor ARCH in $ARCHS \ndo \necho \"Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME\" \nlipo -extract \"$ARCH\" \"$FRAMEWORK_EXECUTABLE_PATH\" -o \"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\" \nEXTRACTED_ARCHS+=(\"$FRAMEWORK_EXECUTABLE_PATH-$ARCH\") \ndone \n\necho \"Merging extracted architectures: ${ARCHS}\" \nlipo -o \"$FRAMEWORK_EXECUTABLE_PATH-merged\" -create \"${EXTRACTED_ARCHS[@]}\" \nrm \"${EXTRACTED_ARCHS[@]}\" \n \necho \"Replacing original executable with thinned version\" \nrm \"$FRAMEWORK_EXECUTABLE_PATH\" \nmv \"$FRAMEWORK_EXECUTABLE_PATH-merged\" \"$FRAMEWORK_EXECUTABLE_PATH\" \n \ndone\n"
;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
B547EC4218E033FB00BC980C
/* Sources */
=
{
isa
=
PBXSourcesBuildPhase
;
...
...
Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/appa.xcuserdatad/UserInterfaceState.xcuserstate
View file @
bdf2ea22
No preview for this file type
Demo/Demo/Classes/DWMainViewController.m
View file @
bdf2ea22
...
...
@@ -94,7 +94,7 @@
-
(
void
)
reloadLoaclData
{
//请自行替换数据
NSArray
*
videos
=
@[
@""
];
NSArray
*
videos
=
@[];
for
(
int
i
=
0
;
i
<
videos
.
count
;
i
++
)
{
DWVodModel
*
vodModel
=
[[
DWVodModel
alloc
]
init
];
...
...
Demo/Demo/Classes/View/Exercises/DWExercisesAlertView.h
View file @
bdf2ea22
...
...
@@ -13,7 +13,10 @@ NS_ASSUME_NONNULL_BEGIN
@protocol
DWExercisesAlertViewDelegate
<
NSObject
>
-
(
void
)
exercisesAlertViewReturn
;
-
(
void
)
exercisesAlertViewAnswer
;
-
(
void
)
exercisesAlertViewAnswer
:(
DWVideoExercisesModel
*
)
exercisesModel
;
-
(
void
)
exercisesAlertViewJump
:(
DWVideoExercisesModel
*
)
exercisesModel
;
@end
...
...
@@ -24,6 +27,11 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
assign
)
id
<
DWExercisesAlertViewDelegate
>
delegate
;
//0,admin设置 1,允许跳过 2,不需要跳过
@property
(
nonatomic
,
assign
)
NSInteger
jumpExercisesType
;
-
(
instancetype
)
initWithExercisesModel
:(
DWVideoExercisesModel
*
)
exercisesModel
;
-
(
void
)
show
;
-
(
void
)
dismiss
;
...
...
Demo/Demo/Classes/View/Exercises/DWExercisesAlertView.m
View file @
bdf2ea22
...
...
@@ -8,13 +8,19 @@
#import "DWExercisesAlertView.h"
@interface
DWExercisesAlertView
()
@property
(
nonatomic
,
weak
)
DWVideoExercisesModel
*
exercisesModel
;
@end
@implementation
DWExercisesAlertView
-
(
instancetype
)
init
-
(
instancetype
)
init
WithExercisesModel
:(
DWVideoExercisesModel
*
)
exercisesModel
;
{
if
(
self
==
[
super
init
])
{
//
self.
lastTime = 0
;
self
.
exercisesModel
=
exercisesModel
;
self
.
backgroundColor
=
[
UIColor
colorWithWhite
:
0
alpha
:
0
.
7
];
...
...
@@ -28,6 +34,16 @@
make
.
height
.
equalTo
(
@165
);
}];
UIButton
*
closeButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
closeButton
setImage
:[
UIImage
imageNamed
:
@"icon_exercises_close.png"
]
forState
:
UIControlStateNormal
];
[
closeButton
addTarget
:
self
action
:
@selector
(
closeButtonAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
bgView
addSubview
:
closeButton
];
[
closeButton
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
@
(
-
5
));
make
.
width
.
and
.
height
.
equalTo
(
@30
);
make
.
top
.
equalTo
(
@2.5
);
}];
UILabel
*
label
=
[[
UILabel
alloc
]
init
];
label
.
text
=
@"请先完成练习"
;
label
.
font
=
TitleFont
(
15
);
...
...
@@ -90,6 +106,18 @@
[
self
removeFromSuperview
];
}
-
(
void
)
closeButtonAction
{
if
(
self
.
jumpExercisesType
==
2
||
(
self
.
jumpExercisesType
==
0
&&
!
self
.
exercisesModel
.
isJump
))
{
[
@"此课题练习不能跳过"
showAlert
];
return
;
}
if
([
self
.
delegate
respondsToSelector
:
@selector
(
exercisesAlertViewJump
:)])
{
[
self
.
delegate
exercisesAlertViewJump
:
self
.
exercisesModel
];
}
}
-
(
void
)
returnButtonAction
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
exercisesAlertViewReturn
)])
{
...
...
@@ -99,8 +127,8 @@
-
(
void
)
nextButtonAction
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
exercisesAlertViewAnswer
)])
{
[
self
.
delegate
exercisesAlertViewAnswer
];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
exercisesAlertViewAnswer
:
)])
{
[
self
.
delegate
exercisesAlertViewAnswer
:
self
.
exercisesModel
];
}
}
...
...
Demo/Demo/Classes/View/Exercises/DWExercisesQuestionView.h
View file @
bdf2ea22
...
...
@@ -18,12 +18,18 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
exercisesQuestionViewDidSubmit
:(
DWExercisesQuestionView
*
)
questionView
;
//回看
-
(
void
)
exercisesQuestionPlayBack
:(
NSInteger
)
backSecond
;
@end
@interface
DWExercisesQuestionView
:
UIView
@property
(
nonatomic
,
strong
)
UIButton
*
submitButton
;
//记录课堂练习回看时间点
@property
(
nonatomic
,
assign
)
NSInteger
exercisesBackSecond
;
@property
(
nonatomic
,
weak
)
id
<
DWExercisesQuestionViewDelegate
>
delegate
;
-
(
instancetype
)
initWithQuestionModel
:(
DWVideoExercisesQuestionModel
*
)
questionModel
;
...
...
Demo/Demo/Classes/View/Exercises/DWExercisesQuestionView.m
View file @
bdf2ea22
...
...
@@ -28,6 +28,10 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
//解析view
@property
(
nonatomic
,
strong
)
UIView
*
analysisView
;
//回放
@property
(
nonatomic
,
strong
)
UIView
*
playBackView
;
@property
(
nonatomic
,
strong
)
UIButton
*
playBackButton
;
//选择题
@property
(
nonatomic
,
strong
)
UIView
*
headerView
;
//单选题 / 多选题列表
...
...
@@ -49,12 +53,21 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
if
(
self
.
questionModel
.
type
==
0
)
{
self
.
type
=
DWExercisesQuestionTypeSingle
;
[
self
initSingleUI
];
if
(
questionModel
.
isReply
)
{
[
self
initSingleAnalysisView
];
}
}
else
if
(
self
.
questionModel
.
type
==
1
){
self
.
type
=
DWExercisesQuestionTypeMult
;
[
self
initMultUI
];
if
(
questionModel
.
isReply
)
{
[
self
initMultAnalysisView
];
}
}
else
{
self
.
type
=
DWExercisesQuestionTypeFill
;
[
self
initFillUI
];
if
(
questionModel
.
isReply
)
{
[
self
initFillAnalysisView
];
}
}
}
...
...
@@ -63,7 +76,7 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
-
(
void
)
dealloc
{
NSLog
(
@"DWExercisesQuestionView dealloc"
);
//
NSLog(@"DWExercisesQuestionView dealloc");
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
UITextFieldTextDidChangeNotification
object
:
nil
];
}
...
...
@@ -74,9 +87,6 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
if
(
self
.
type
==
DWExercisesQuestionTypeMult
)
{
//多选提交
self
.
chooseTableView
.
allowsSelection
=
NO
;
[
self
.
chooseTableView
reloadData
];
[
self
initMultAnalysisView
];
}
if
(
self
.
type
==
DWExercisesQuestionTypeFill
)
{
...
...
@@ -128,6 +138,28 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
return
height
;
}
-
(
void
)
playBackButtonAction
{
if
(
self
.
questionModel
.
backSecond
!=
-
1
)
{
//回看题目时间
if
([
self
.
delegate
respondsToSelector
:
@selector
(
exercisesQuestionPlayBack
:)])
{
[
self
.
delegate
exercisesQuestionPlayBack
:
self
.
questionModel
.
backSecond
];
}
return
;
}
if
(
self
.
exercisesBackSecond
!=
-
1
)
{
//回看课堂练习时间
if
([
self
.
delegate
respondsToSelector
:
@selector
(
exercisesQuestionPlayBack
:)])
{
[
self
.
delegate
exercisesQuestionPlayBack
:
self
.
exercisesBackSecond
];
}
return
;
}
[
@"暂无回看时间"
showAlert
];
}
#pragma mark - delegate
-
(
NSInteger
)
tableView
:(
UITableView
*
)
tableView
numberOfRowsInSection
:(
NSInteger
)
section
{
...
...
@@ -156,14 +188,12 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
-
(
void
)
tableView
:(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
if
(
self
.
type
==
DWExercisesQuestionTypeSingle
)
{
self
.
chooseTableView
.
allowsSelection
=
NO
;
[
self
.
questionModel
.
answers
enumerateObjectsUsingBlock
:
^
(
DWVideoExercisesQuestionAnswerModel
*
_Nonnull
obj
,
NSUInteger
idx
,
BOOL
*
_Nonnull
stop
)
{
if
(
idx
==
indexPath
.
row
)
{
obj
.
isSelect
=
YES
;
}
}];
[
self
.
chooseTableView
reloadData
];
[
self
initSingleAnalysisView
];
if
([
_delegate
respondsToSelector
:
@selector
(
exercisesQuestionViewDidSubmit
:)])
{
...
...
@@ -360,6 +390,9 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
//答题完毕,创建解析view
-
(
void
)
initSingleAnalysisView
{
self
.
chooseTableView
.
allowsSelection
=
NO
;
[
self
.
chooseTableView
reloadData
];
[
self
addSubview
:
self
.
analysisView
];
UILabel
*
label
=
[[
UILabel
alloc
]
init
];
...
...
@@ -420,13 +453,13 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
analysisLabel
.
attributedText
=
aAttr
;
[
_analysisView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
@
0
);
make
.
bottom
.
equalTo
(
@
(
-
65
)
);
make
.
left
.
and
.
right
.
equalTo
(
@0
);
make
.
height
.
equalTo
(
@
(
15
+
13
+
15
+
13
+
15
+
analysisHeight
+
15
));
}];
[
_chooseTableView
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
@
(
-
(
15
+
13
+
15
+
13
+
15
+
analysisHeight
+
15
)));
make
.
bottom
.
equalTo
(
@
(
-
(
65
+
15
+
13
+
15
+
13
+
15
+
analysisHeight
+
15
)));
}];
[
label
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
...
...
@@ -456,10 +489,16 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
make
.
right
.
equalTo
(
@
(
-
20
));
make
.
height
.
equalTo
(
@
(
analysisHeight
));
}];
[
self
initPlayBackView
];
}
-
(
void
)
initMultAnalysisView
{
self
.
submitButton
.
hidden
=
YES
;
self
.
chooseTableView
.
allowsSelection
=
NO
;
[
self
.
chooseTableView
reloadData
];
[
self
addSubview
:
self
.
analysisView
];
UILabel
*
label
=
[[
UILabel
alloc
]
init
];
...
...
@@ -523,13 +562,13 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
analysisLabel
.
attributedText
=
aAttr
;
[
_analysisView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
@
0
);
make
.
bottom
.
equalTo
(
@
(
-
65
)
);
make
.
left
.
and
.
right
.
equalTo
(
@0
);
make
.
height
.
equalTo
(
@
(
15
+
13
+
15
+
13
+
15
+
analysisHeight
+
15
));
}];
[
_chooseTableView
mas_updateConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
@
(
-
(
15
+
13
+
15
+
13
+
15
+
analysisHeight
+
15
)));
make
.
bottom
.
equalTo
(
@
(
-
(
65
+
15
+
13
+
15
+
13
+
15
+
analysisHeight
+
15
)));
}];
[
label
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
...
...
@@ -559,13 +598,19 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
make
.
right
.
equalTo
(
@
(
-
20
));
make
.
height
.
equalTo
(
@
(
analysisHeight
));
}];
[
self
initPlayBackView
];
}
-
(
void
)
initFillAnalysisView
{
self
.
submitButton
.
hidden
=
YES
;
[
self
endEditing
:
YES
];
self
.
fillTextField
.
enabled
=
NO
;
if
(
self
.
questionModel
.
isCorrect
)
{
self
.
fillTextField
.
textColor
=
[
UIColor
colorWithRed
:
139
/
255
.
0
green
:
192
/
255
.
0
blue
:
75
/
255
.
0
alpha
:
1
.
0
];
self
.
fillTextField
.
text
=
self
.
questionModel
.
answers
.
firstObject
.
answerContent
;
}
else
{
NSMutableAttributedString
*
fillAttr
=
[[
NSMutableAttributedString
alloc
]
initWithString
:
self
.
questionModel
.
answers
.
firstObject
.
answerContent
];
[
fillAttr
addAttribute
:
NSForegroundColorAttributeName
value
:[
UIColor
colorWithRed
:
228
/
255
.
0
green
:
79
/
255
.
0
blue
:
90
/
255
.
0
alpha
:
1
.
0
]
range
:
NSMakeRange
(
0
,
self
.
questionModel
.
answers
.
firstObject
.
answerContent
.
length
)];
...
...
@@ -625,7 +670,7 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
analysisLabel
.
attributedText
=
aAttr
;
[
_analysisView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
@
0
);
make
.
bottom
.
equalTo
(
@
(
-
65
)
);
make
.
left
.
and
.
right
.
equalTo
(
@0
);
make
.
height
.
equalTo
(
@
(
15
+
13
+
15
+
answerHeight
+
15
+
analysisHeight
+
15
));
}];
...
...
@@ -650,6 +695,25 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
make
.
right
.
equalTo
(
@
(
-
20
));
make
.
height
.
equalTo
(
@
(
analysisHeight
));
}];
[
self
initPlayBackView
];
}
-
(
void
)
initPlayBackView
{
[
self
addSubview
:
self
.
playBackView
];
[
_playBackView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
@0
);
make
.
left
.
and
.
right
.
equalTo
(
@0
);
make
.
height
.
equalTo
(
@65
);
}];
[
self
.
playBackView
addSubview
:
self
.
playBackButton
];
[
_playBackButton
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
center
.
equalTo
(
self
.
playBackView
);
make
.
width
.
equalTo
(
@125
);
make
.
height
.
equalTo
(
@35
);
}];
}
#pragma mark - lazyLoad
...
...
@@ -726,6 +790,33 @@ typedef NS_ENUM(NSUInteger, DWExercisesQuestionType) {
return
_analysisView
;
}
-
(
UIView
*
)
playBackView
{
if
(
!
_playBackView
)
{
_playBackView
=
[[
UIView
alloc
]
init
];
_playBackView
.
backgroundColor
=
[
UIColor
whiteColor
];
}
return
_playBackView
;
}
-
(
UIButton
*
)
playBackButton
{
if
(
!
_playBackButton
)
{
_playBackButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
[
_playBackButton
setTitle
:
@"回看"
forState
:
UIControlStateNormal
];
_playBackButton
.
titleLabel
.
font
=
TitleFont
(
15
);
[
_playBackButton
setTitleColor
:[
UIColor
colorWithRed
:
81
/
255
.
0
green
:
168
/
255
.
0
blue
:
242
/
255
.
0
alpha
:
1
.
0
]
forState
:
UIControlStateNormal
];
[
_playBackButton
setBackgroundImage
:[[
UIColor
whiteColor
]
createImage
]
forState
:
UIControlStateNormal
];
_playBackButton
.
layer
.
masksToBounds
=
YES
;
_playBackButton
.
layer
.
cornerRadius
=
35
/
2
.
0
;
_playBackButton
.
layer
.
borderWidth
=
1
;
_playBackButton
.
layer
.
borderColor
=
[
UIColor
whiteColor
].
CGColor
;
_playBackButton
.
layer
.
borderColor
=
[
UIColor
colorWithRed
:
81
/
255
.
0
green
:
168
/
255
.
0
blue
:
242
/
255
.
0
alpha
:
1
.
0
].
CGColor
;
[
_playBackButton
addTarget
:
self
action
:
@selector
(
playBackButtonAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
}
return
_playBackButton
;
}
-
(
NSMutableArray
*
)
cellHeightArray
{
if
(
!
_cellHeightArray
)
{
...
...
Demo/Demo/Classes/View/Exercises/DWExercisesView.h
View file @
bdf2ea22
...
...
@@ -16,9 +16,11 @@ NS_ASSUME_NONNULL_BEGIN
//提交课堂练习回调
-
(
void
)
exercisesViewFinish
:(
DWVideoExercisesModel
*
)
exercisesModel
;
//
查看完成,
继续播放回调
//继续播放回调
-
(
void
)
exercisesViewFinishResumePlay
:(
DWVideoExercisesModel
*
)
exercisesModel
;
//回看回调
-
(
void
)
exercisesViewPlayBack
:(
NSInteger
)
backSecond
;
@end
...
...
@@ -29,6 +31,9 @@ NS_ASSUME_NONNULL_BEGIN
//继续播放记录的时间位置
@property
(
nonatomic
,
assign
)
CGFloat
lastScrubTime
;
//0,admin设置 1,允许跳过 2,不需要跳过
@property
(
nonatomic
,
assign
)
NSInteger
jumpExercisesType
;
-
(
instancetype
)
initWithExercisesModel
:(
DWVideoExercisesModel
*
)
exercisesModel
;
//课堂练习,提交成功调用
...
...
Demo/Demo/Classes/View/Exercises/DWExercisesView.m
View file @
bdf2ea22
...
...
@@ -17,6 +17,8 @@
@property
(
nonatomic
,
assign
)
NSInteger
position
;
//进度条宽度
@property
(
nonatomic
,
assign
)
CGFloat
scheduleWidth
;
//题号
@property
(
nonatomic
,
strong
)
UILabel
*
numLabel
;
@property
(
nonatomic
,
strong
)
UIView
*
bgView
;
...
...
@@ -31,12 +33,16 @@
@implementation
DWExercisesView
//-(void)dealloc
//{
// NSLog(@"DWExercisesView dealloc");
//}
-
(
instancetype
)
initWithExercisesModel
:(
DWVideoExercisesModel
*
)
exercisesModel
;
{
if
(
self
==
[
super
init
])
{
self
.
position
=
0
;
self
.
exercisesModel
=
exercisesModel
;
CGSize
bgSize
=
CGSizeMake
(
MAX
(
ScreenWidth
,
ScreenHeight
)
-
70
,
MIN
(
ScreenWidth
,
ScreenHeight
)
-
40
);
...
...
@@ -61,19 +67,53 @@
make
.
width
.
equalTo
(
@
(
self
.
scheduleWidth
));
}];
UIButton
*
closeButton
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];