Commit 77e3573fd82789ed883d4ed3647de740df3def15
1 parent
258bb9fe
播放SDK新增静音,旋转,循环播放等方法;v2.1.6
Showing
10 changed files
with
94 additions
and
14 deletions
CNLivePlayerSDKTest/CNLivePlayerSDKTest.xcodeproj/project.pbxproj
| ... | ... | @@ -25,12 +25,12 @@ |
| 25 | 25 | 816D7B1D1F0E15DE007C1436 /* libksygpulive.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 816D7B1B1F0E15DE007C1436 /* libksygpulive.framework */; }; |
| 26 | 26 | 816D7B231F0E15FC007C1436 /* GPUImage.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 816D7B1A1F0E15DE007C1436 /* GPUImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
| 27 | 27 | 816D7B251F0E15FC007C1436 /* libksygpulive.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 816D7B1B1F0E15DE007C1436 /* libksygpulive.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; |
| 28 | + 8188FACB1F27275B006C34B2 /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8188FACA1F27275B006C34B2 /* CNLivePlayerSDK.framework */; }; | |
| 29 | + 8188FACC1F272762006C34B2 /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8188FACA1F27275B006C34B2 /* CNLivePlayerSDK.framework */; }; | |
| 30 | + 8188FACD1F272762006C34B2 /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8188FACA1F27275B006C34B2 /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; | |
| 28 | 31 | 819135E81EDFB4EE00C28F12 /* AudioStreamingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 819135E31EDFB4EE00C28F12 /* AudioStreamingViewController.m */; }; |
| 29 | 32 | 819135E91EDFB4EE00C28F12 /* StreamerDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 819135E51EDFB4EE00C28F12 /* StreamerDetailViewController.m */; }; |
| 30 | 33 | 819135EA1EDFB4EE00C28F12 /* StreamerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 819135E71EDFB4EE00C28F12 /* StreamerViewController.m */; }; |
| 31 | - 819EEC071F1F5676004F8CDF /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 819EEC061F1F5676004F8CDF /* CNLivePlayerSDK.framework */; }; | |
| 32 | - 819EEC081F1F57BC004F8CDF /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 819EEC061F1F5676004F8CDF /* CNLivePlayerSDK.framework */; }; | |
| 33 | - 819EEC091F1F57BC004F8CDF /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 819EEC061F1F5676004F8CDF /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; | |
| 34 | 34 | 819EEC0B1F1F58DA004F8CDF /* KSYGPUResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 819EEC0A1F1F58DA004F8CDF /* KSYGPUResource.bundle */; }; |
| 35 | 35 | 81A672051EB1E3D800BC4343 /* See You Again .mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 81A672011EB1E3D800BC4343 /* See You Again .mp3 */; }; |
| 36 | 36 | 81A672061EB1E3D800BC4343 /* Idina Menzel - Let It Go.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 81A672021EB1E3D800BC4343 /* Idina Menzel - Let It Go.mp3 */; }; |
| ... | ... | @@ -50,8 +50,8 @@ |
| 50 | 50 | dstSubfolderSpec = 10; |
| 51 | 51 | files = ( |
| 52 | 52 | 816D7B251F0E15FC007C1436 /* libksygpulive.framework in Embed Frameworks */, |
| 53 | + 8188FACD1F272762006C34B2 /* CNLivePlayerSDK.framework in Embed Frameworks */, | |
| 53 | 54 | 812245E21F21F649008C2B64 /* CNLiveMsgTools.framework in Embed Frameworks */, |
| 54 | - 819EEC091F1F57BC004F8CDF /* CNLivePlayerSDK.framework in Embed Frameworks */, | |
| 55 | 55 | 816D7B231F0E15FC007C1436 /* GPUImage.framework in Embed Frameworks */, |
| 56 | 56 | ); |
| 57 | 57 | name = "Embed Frameworks"; |
| ... | ... | @@ -83,13 +83,13 @@ |
| 83 | 83 | 8156819D1ED7DEE100635393 /* CNLiveViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CNLiveViewController.m; sourceTree = "<group>"; }; |
| 84 | 84 | 816D7B1A1F0E15DE007C1436 /* GPUImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GPUImage.framework; sourceTree = "<group>"; }; |
| 85 | 85 | 816D7B1B1F0E15DE007C1436 /* libksygpulive.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = libksygpulive.framework; sourceTree = "<group>"; }; |
| 86 | + 8188FACA1F27275B006C34B2 /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; }; | |
| 86 | 87 | 819135E21EDFB4EE00C28F12 /* AudioStreamingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioStreamingViewController.h; sourceTree = "<group>"; }; |
| 87 | 88 | 819135E31EDFB4EE00C28F12 /* AudioStreamingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AudioStreamingViewController.m; sourceTree = "<group>"; }; |
| 88 | 89 | 819135E41EDFB4EE00C28F12 /* StreamerDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamerDetailViewController.h; sourceTree = "<group>"; }; |
| 89 | 90 | 819135E51EDFB4EE00C28F12 /* StreamerDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StreamerDetailViewController.m; sourceTree = "<group>"; }; |
| 90 | 91 | 819135E61EDFB4EE00C28F12 /* StreamerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamerViewController.h; sourceTree = "<group>"; }; |
| 91 | 92 | 819135E71EDFB4EE00C28F12 /* StreamerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StreamerViewController.m; sourceTree = "<group>"; }; |
| 92 | - 819EEC061F1F5676004F8CDF /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; }; | |
| 93 | 93 | 819EEC0A1F1F58DA004F8CDF /* KSYGPUResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = KSYGPUResource.bundle; sourceTree = "<group>"; }; |
| 94 | 94 | 81A672011EB1E3D800BC4343 /* See You Again .mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = " See You Again .mp3"; sourceTree = "<group>"; }; |
| 95 | 95 | 81A672021EB1E3D800BC4343 /* Idina Menzel - Let It Go.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "Idina Menzel - Let It Go.mp3"; sourceTree = "<group>"; }; |
| ... | ... | @@ -110,12 +110,12 @@ |
| 110 | 110 | isa = PBXFrameworksBuildPhase; |
| 111 | 111 | buildActionMask = 2147483647; |
| 112 | 112 | files = ( |
| 113 | - 819EEC071F1F5676004F8CDF /* CNLivePlayerSDK.framework in Frameworks */, | |
| 114 | 113 | 812245E01F21F63A008C2B64 /* CNLiveMsgTools.framework in Frameworks */, |
| 115 | 114 | 816D7B1D1F0E15DE007C1436 /* libksygpulive.framework in Frameworks */, |
| 116 | 115 | 816D7B1C1F0E15DE007C1436 /* GPUImage.framework in Frameworks */, |
| 117 | - 819EEC081F1F57BC004F8CDF /* CNLivePlayerSDK.framework in Frameworks */, | |
| 116 | + 8188FACC1F272762006C34B2 /* CNLivePlayerSDK.framework in Frameworks */, | |
| 118 | 117 | 812245E11F21F649008C2B64 /* CNLiveMsgTools.framework in Frameworks */, |
| 118 | + 8188FACB1F27275B006C34B2 /* CNLivePlayerSDK.framework in Frameworks */, | |
| 119 | 119 | ); |
| 120 | 120 | runOnlyForDeploymentPostprocessing = 0; |
| 121 | 121 | }; |
| ... | ... | @@ -215,9 +215,9 @@ |
| 215 | 215 | 816D7B131F0E158F007C1436 /* CNLiveSDKs */ = { |
| 216 | 216 | isa = PBXGroup; |
| 217 | 217 | children = ( |
| 218 | + 8188FACA1F27275B006C34B2 /* CNLivePlayerSDK.framework */, | |
| 218 | 219 | 812245DF1F21F63A008C2B64 /* CNLiveMsgTools.framework */, |
| 219 | 220 | 819EEC0A1F1F58DA004F8CDF /* KSYGPUResource.bundle */, |
| 220 | - 819EEC061F1F5676004F8CDF /* CNLivePlayerSDK.framework */, | |
| 221 | 221 | 816D7B1A1F0E15DE007C1436 /* GPUImage.framework */, |
| 222 | 222 | 816D7B1B1F0E15DE007C1436 /* libksygpulive.framework */, |
| 223 | 223 | ); | ... | ... |
CNLivePlayerSDKTest/CNLiveSDKs/CNLivePlayerSDK.framework/CNLivePlayerSDK
No preview for this file type
CNLivePlayerSDKTest/CNLiveSDKs/CNLivePlayerSDK.framework/Headers/CNLiveMoviePlayerController.h
| ... | ... | @@ -117,7 +117,7 @@ FOUNDATION_EXPORT NSString *const CNLiveAnchorStatusChangedNotification NS_AVAIL |
| 117 | 117 | */ |
| 118 | 118 | - (instancetype)initWithContentURL:(NSURL *)url; |
| 119 | 119 | |
| 120 | -/* 解码方式(硬解/软解/自动) | |
| 120 | +/* 解码方式(硬解/软解/自动/使用系统接口进行解码和渲染) | |
| 121 | 121 | * |
| 122 | 122 | * 建议系统版本高于8.0 选择硬解,或者自动选择解码方式,8.0以上的系统优先选择硬解 |
| 123 | 123 | * 只在[prepareToPlay]调用前设置生效 |
| ... | ... | @@ -125,6 +125,36 @@ FOUNDATION_EXPORT NSString *const CNLiveAnchorStatusChangedNotification NS_AVAIL |
| 125 | 125 | */ |
| 126 | 126 | @property(nonatomic) CNLiveMovieVideoDecoderMode videoDecoderMode; |
| 127 | 127 | |
| 128 | +/** | |
| 129 | + @abstract 是否静音 | |
| 130 | + @discussion | |
| 131 | + * 默认不静音 | |
| 132 | + * [prepareToPlay]方法前设置即生效,也可以在播放过程中动态切换 | |
| 133 | + */ | |
| 134 | +@property(nonatomic) BOOL shouldMute; | |
| 135 | + | |
| 136 | +/** | |
| 137 | + @abstract 是否循环播放 | |
| 138 | + @discussion 默认不循环 | |
| 139 | + * 只在[prepareToPlay]调用前设置生效; | |
| 140 | + * 只有点播生效,直播场景请勿设置 | |
| 141 | + */ | |
| 142 | +@property(nonatomic) BOOL shouldLoop; | |
| 143 | + | |
| 144 | +/** | |
| 145 | + @abstract 指定逆时针旋转角度,只能是0/90/180/270, 不符合上述值不进行旋转 | |
| 146 | + */ | |
| 147 | +@property (nonatomic, assign) int rotateDegress; | |
| 148 | + | |
| 149 | +/** | |
| 150 | + @abstract 是否打断其他后台的音乐播放 | |
| 151 | + @discussion 也可以理解为是否允许和其他音频同时播放 | |
| 152 | + @discussion YES:开始播放时,会打断其他的后台播放音频,也会被其他音频播放打断 | |
| 153 | + @discussion NO: 可以与其他后台播放共存,相互之间不会被打断 | |
| 154 | + @discussion 默认为YES | |
| 155 | + */ | |
| 156 | +@property(nonatomic) BOOL bInterruptOtherAudio; | |
| 157 | + | |
| 128 | 158 | /* 重新启动拉流 |
| 129 | 159 | * |
| 130 | 160 | * url 视频播放地址,该地址可以是本地地址或者服务器地址.如果为nil,则使用前一次播放地址 |
| ... | ... | @@ -209,12 +239,20 @@ MP_EXTERN NSString *const MPMediaPlaybackIsPreparedToPlayDidChangeNotification N |
| 209 | 239 | */ |
| 210 | 240 | @property(nonatomic) NSTimeInterval currentPlaybackTime; |
| 211 | 241 | |
| 242 | +/** | |
| 243 | + @abstract 跳转到指定位置播放 | |
| 244 | + @param pos 跳转到的位置,单位秒 | |
| 245 | + @param isAccurate 是否精确跳转,NO时等同于currentPlaybackTime, YES时为精确跳转 | |
| 246 | + @discussion 媒体文件总时长较小且关键帧间隔较大时,需要使用精确跳转, 总时长较大或者不需要精确定位时可以使用currentPlaybackTime或者将isAccurate设置为NO进行跳转 | |
| 247 | + */ | |
| 248 | +- (void)seekTo:(double)pos accurate:(BOOL)isAccurate; | |
| 249 | + | |
| 212 | 250 | /* |
| 213 | - * 当前视频总时长(只读) | |
| 251 | + * 当前视频总时长(只读),单位是秒 | |
| 214 | 252 | */ |
| 215 | 253 | @property (nonatomic, readonly) NSTimeInterval duration; |
| 216 | 254 | |
| 217 | -/* 当前视频可播放长度(只读) | |
| 255 | +/* 当前视频可播放长度(只读),单位是秒 | |
| 218 | 256 | * |
| 219 | 257 | * currentPlaybackTime 标记的是播放器当前已播放的时长。 |
| 220 | 258 | * playableDuration 标记的是播放器缓冲的时间,会稍大于currentPlaybackTime,与currentPlaybackTime的差值则是缓冲长度。 | ... | ... |
CNLivePlayerSDKTest/CNLiveSDKs/CNLivePlayerSDK.framework/Headers/CNLiveTypeDef.h
| ... | ... | @@ -223,6 +223,8 @@ typedef NS_ENUM(NSUInteger, CNLiveMovieVideoDecoderMode) { |
| 223 | 223 | CNLiveMovieVideoDecoderMode_Hardware, |
| 224 | 224 | ///自动选择解码方式,8.0以上的系统优先选择硬解 |
| 225 | 225 | CNLiveMovieVideoDecoderMode_AUTO, |
| 226 | + ///使用系统接口进行解码和渲染,只适用于8.0及以上系统,低于8.0的系统自动使用软解 | |
| 227 | + CNLiveMovieVideoDecoderMode_DisplayLayer, | |
| 226 | 228 | }; |
| 227 | 229 | |
| 228 | 230 | /** | ... | ... |
CNLivePlayerSDKTest/CNLiveSDKs/CNLivePlayerSDK.framework/Info.plist
No preview for this file type
北京中投视讯播放SDK说明文档.pdf
No preview for this file type
发布版SDK/CNLivePlayerSDK.framework/CNLivePlayerSDK
No preview for this file type
发布版SDK/CNLivePlayerSDK.framework/Headers/CNLiveMoviePlayerController.h
| ... | ... | @@ -117,7 +117,7 @@ FOUNDATION_EXPORT NSString *const CNLiveAnchorStatusChangedNotification NS_AVAIL |
| 117 | 117 | */ |
| 118 | 118 | - (instancetype)initWithContentURL:(NSURL *)url; |
| 119 | 119 | |
| 120 | -/* 解码方式(硬解/软解/自动) | |
| 120 | +/* 解码方式(硬解/软解/自动/使用系统接口进行解码和渲染) | |
| 121 | 121 | * |
| 122 | 122 | * 建议系统版本高于8.0 选择硬解,或者自动选择解码方式,8.0以上的系统优先选择硬解 |
| 123 | 123 | * 只在[prepareToPlay]调用前设置生效 |
| ... | ... | @@ -125,6 +125,36 @@ FOUNDATION_EXPORT NSString *const CNLiveAnchorStatusChangedNotification NS_AVAIL |
| 125 | 125 | */ |
| 126 | 126 | @property(nonatomic) CNLiveMovieVideoDecoderMode videoDecoderMode; |
| 127 | 127 | |
| 128 | +/** | |
| 129 | + @abstract 是否静音 | |
| 130 | + @discussion | |
| 131 | + * 默认不静音 | |
| 132 | + * [prepareToPlay]方法前设置即生效,也可以在播放过程中动态切换 | |
| 133 | + */ | |
| 134 | +@property(nonatomic) BOOL shouldMute; | |
| 135 | + | |
| 136 | +/** | |
| 137 | + @abstract 是否循环播放 | |
| 138 | + @discussion 默认不循环 | |
| 139 | + * 只在[prepareToPlay]调用前设置生效; | |
| 140 | + * 只有点播生效,直播场景请勿设置 | |
| 141 | + */ | |
| 142 | +@property(nonatomic) BOOL shouldLoop; | |
| 143 | + | |
| 144 | +/** | |
| 145 | + @abstract 指定逆时针旋转角度,只能是0/90/180/270, 不符合上述值不进行旋转 | |
| 146 | + */ | |
| 147 | +@property (nonatomic, assign) int rotateDegress; | |
| 148 | + | |
| 149 | +/** | |
| 150 | + @abstract 是否打断其他后台的音乐播放 | |
| 151 | + @discussion 也可以理解为是否允许和其他音频同时播放 | |
| 152 | + @discussion YES:开始播放时,会打断其他的后台播放音频,也会被其他音频播放打断 | |
| 153 | + @discussion NO: 可以与其他后台播放共存,相互之间不会被打断 | |
| 154 | + @discussion 默认为YES | |
| 155 | + */ | |
| 156 | +@property(nonatomic) BOOL bInterruptOtherAudio; | |
| 157 | + | |
| 128 | 158 | /* 重新启动拉流 |
| 129 | 159 | * |
| 130 | 160 | * url 视频播放地址,该地址可以是本地地址或者服务器地址.如果为nil,则使用前一次播放地址 |
| ... | ... | @@ -209,12 +239,20 @@ MP_EXTERN NSString *const MPMediaPlaybackIsPreparedToPlayDidChangeNotification N |
| 209 | 239 | */ |
| 210 | 240 | @property(nonatomic) NSTimeInterval currentPlaybackTime; |
| 211 | 241 | |
| 242 | +/** | |
| 243 | + @abstract 跳转到指定位置播放 | |
| 244 | + @param pos 跳转到的位置,单位秒 | |
| 245 | + @param isAccurate 是否精确跳转,NO时等同于currentPlaybackTime, YES时为精确跳转 | |
| 246 | + @discussion 媒体文件总时长较小且关键帧间隔较大时,需要使用精确跳转, 总时长较大或者不需要精确定位时可以使用currentPlaybackTime或者将isAccurate设置为NO进行跳转 | |
| 247 | + */ | |
| 248 | +- (void)seekTo:(double)pos accurate:(BOOL)isAccurate; | |
| 249 | + | |
| 212 | 250 | /* |
| 213 | - * 当前视频总时长(只读) | |
| 251 | + * 当前视频总时长(只读),单位是秒 | |
| 214 | 252 | */ |
| 215 | 253 | @property (nonatomic, readonly) NSTimeInterval duration; |
| 216 | 254 | |
| 217 | -/* 当前视频可播放长度(只读) | |
| 255 | +/* 当前视频可播放长度(只读),单位是秒 | |
| 218 | 256 | * |
| 219 | 257 | * currentPlaybackTime 标记的是播放器当前已播放的时长。 |
| 220 | 258 | * playableDuration 标记的是播放器缓冲的时间,会稍大于currentPlaybackTime,与currentPlaybackTime的差值则是缓冲长度。 | ... | ... |
发布版SDK/CNLivePlayerSDK.framework/Headers/CNLiveTypeDef.h
| ... | ... | @@ -223,6 +223,8 @@ typedef NS_ENUM(NSUInteger, CNLiveMovieVideoDecoderMode) { |
| 223 | 223 | CNLiveMovieVideoDecoderMode_Hardware, |
| 224 | 224 | ///自动选择解码方式,8.0以上的系统优先选择硬解 |
| 225 | 225 | CNLiveMovieVideoDecoderMode_AUTO, |
| 226 | + ///使用系统接口进行解码和渲染,只适用于8.0及以上系统,低于8.0的系统自动使用软解 | |
| 227 | + CNLiveMovieVideoDecoderMode_DisplayLayer, | |
| 226 | 228 | }; |
| 227 | 229 | |
| 228 | 230 | /** | ... | ... |
发布版SDK/CNLivePlayerSDK.framework/Info.plist
No preview for this file type