Commit f15f3b6de2be7504fc92ed27820306b88d4a5f34

Authored by 朱林
1 parent 8b402f34

推流核心类添加退出并销毁方法

CNLivePlayerSDKTest/CNLivePlayerSDK.framework/CNLivePlayerSDK
No preview for this file type
CNLivePlayerSDKTest/CNLivePlayerSDK.framework/Headers/CNLiveGPUStreamerKit.h
... ... @@ -248,6 +248,12 @@ FOUNDATION_EXPORT NSString *const CNLiveStreamStateDidChangeNotification NS_AVAI
248 248 */
249 249 - (void) appBecomeActive;
250 250  
  251 +/**
  252 + @abstract 销毁推流核心类
  253 + @discussion 退出页面时调用此方法以销毁推流推流对象
  254 + */
  255 +- (void)cleanKit;
  256 +
251 257 #pragma mark - mirror & rotate
252 258  
253 259 /**
... ... @@ -290,4 +296,5 @@ FOUNDATION_EXPORT NSString *const CNLiveStreamStateDidChangeNotification NS_AVAI
290 296 */
291 297 @property (nonatomic, assign) CGFloat pinchZoomFactor;
292 298  
  299 +
293 300 @end
... ...
CNLivePlayerSDKTest/CNLivePlayerSDK.framework/Info.plist
No preview for this file type
CNLivePlayerSDKTest/CNLivePlayerSDKTest.xcodeproj/project.pbxproj
... ... @@ -25,8 +25,8 @@
25 25 8139160B1E7006B800C55553 /* FilterFunctionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 813916081E7006B800C55553 /* FilterFunctionView.m */; };
26 26 8139160C1E7006B800C55553 /* SliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8139160A1E7006B800C55553 /* SliderView.m */; };
27 27 813916191E70085A00C55553 /* KSYGPUResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 813916181E70085A00C55553 /* KSYGPUResource.bundle */; };
28   - 814FC95E1E7F843800944D7D /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 814FC95D1E7F843800944D7D /* CNLivePlayerSDK.framework */; };
29   - 814FC9601E7F843F00944D7D /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 814FC95D1E7F843800944D7D /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
  28 + 81A1B99D1E8239880079FF5F /* CNLivePlayerSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 81A1B99B1E8239020079FF5F /* CNLivePlayerSDK.framework */; };
  29 + 81A1B99E1E8239880079FF5F /* CNLivePlayerSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 81A1B99B1E8239020079FF5F /* CNLivePlayerSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
30 30 /* End PBXBuildFile section */
31 31  
32 32 /* Begin PBXCopyFilesBuildPhase section */
... ... @@ -37,7 +37,7 @@
37 37 dstSubfolderSpec = 10;
38 38 files = (
39 39 811A0B0A1E7B8C9D00B56CC9 /* CNLiveMsgTools.framework in Embed Frameworks */,
40   - 814FC9601E7F843F00944D7D /* CNLivePlayerSDK.framework in Embed Frameworks */,
  40 + 81A1B99E1E8239880079FF5F /* CNLivePlayerSDK.framework in Embed Frameworks */,
41 41 );
42 42 name = "Embed Frameworks";
43 43 runOnlyForDeploymentPostprocessing = 0;
... ... @@ -75,7 +75,7 @@
75 75 813916091E7006B800C55553 /* SliderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SliderView.h; sourceTree = "<group>"; };
76 76 8139160A1E7006B800C55553 /* SliderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SliderView.m; sourceTree = "<group>"; };
77 77 813916181E70085A00C55553 /* KSYGPUResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = KSYGPUResource.bundle; sourceTree = "<group>"; };
78   - 814FC95D1E7F843800944D7D /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; };
  78 + 81A1B99B1E8239020079FF5F /* CNLivePlayerSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CNLivePlayerSDK.framework; sourceTree = "<group>"; };
79 79 /* End PBXFileReference section */
80 80  
81 81 /* Begin PBXFrameworksBuildPhase section */
... ... @@ -84,7 +84,7 @@
84 84 buildActionMask = 2147483647;
85 85 files = (
86 86 811A0B071E7B8C9400B56CC9 /* CNLiveMsgTools.framework in Frameworks */,
87   - 814FC95E1E7F843800944D7D /* CNLivePlayerSDK.framework in Frameworks */,
  87 + 81A1B99D1E8239880079FF5F /* CNLivePlayerSDK.framework in Frameworks */,
88 88 );
89 89 runOnlyForDeploymentPostprocessing = 0;
90 90 };
... ... @@ -94,7 +94,7 @@
94 94 32E6CA1D1D5B0AF400B58EBC = {
95 95 isa = PBXGroup;
96 96 children = (
97   - 814FC95D1E7F843800944D7D /* CNLivePlayerSDK.framework */,
  97 + 81A1B99B1E8239020079FF5F /* CNLivePlayerSDK.framework */,
98 98 811A0B051E7B8C9400B56CC9 /* CNLiveMsgTools.framework */,
99 99 813916181E70085A00C55553 /* KSYGPUResource.bundle */,
100 100 32E6CA281D5B0AF400B58EBC /* CNLivePlayerSDKTest */,
... ...
CNLivePlayerSDKTest/CNLivePlayerSDKTest/AppDelegate.m
... ... @@ -7,6 +7,10 @@
7 7 //
8 8  
9 9 #import "AppDelegate.h"
  10 +#import <CNLivePlayerSDK/CNLiveWebcastManager.h>
  11 +
  12 +#define KAppId @"60_irn9edco29"
  13 +#define KAppKey @"69fe70bda67e059286ad509d9f5377f815955645b52f94"
10 14  
11 15 @interface AppDelegate ()
12 16  
... ... @@ -16,7 +20,10 @@
16 20  
17 21  
18 22 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19   - // Override point for customization after application launch.
  23 +
  24 + //初始化直播SDK
  25 + [[CNLiveWebcastManager manager] initWithAppId:KAppId appKey:KAppKey];
  26 +
20 27 return YES;
21 28 }
22 29  
... ...
CNLivePlayerSDKTest/CNLivePlayerSDKTest/Player/CNLiveViewController.m
... ... @@ -44,9 +44,6 @@
44 44 //添加播放器通知
45 45 [self installMovieNotificationObservers];
46 46  
47   -
48   - [[CNLiveWebcastManager manager] initWithAppId:KAppId appKey:KAppKey];
49   -
50 47 if (_type == PlayerTypeLiving) {
51 48  
52 49 //直播播放
... ...
CNLivePlayerSDKTest/CNLivePlayerSDKTest/Streamer/StreamerDetailViewController.m
... ... @@ -13,10 +13,6 @@
13 13 #define Width [UIScreen mainScreen].bounds.size.width
14 14 #define Height [UIScreen mainScreen].bounds.size.height
15 15  
16   -#define KAppId @"60_irn9edco29"
17   -#define KAppKey @"69fe70bda67e059286ad509d9f5377f815955645b52f94"
18   -#define KBundleId @"com.cnlive.video"
19   -
20 16 @interface StreamerDetailViewController ()<UIGestureRecognizerDelegate>
21 17 {
22 18 UIButton *_startLiveBtn;
... ... @@ -67,8 +63,6 @@
67 63 if (_isAuthLive) {
68 64  
69 65 NSString *activityId = [NSString stringWithFormat:@"%d%d%d%d%d",arc4random()%9,arc4random()%9,arc4random()%9,arc4random()%9,arc4random()%9];
70   -
71   - [[CNLiveWebcastManager manager] initWithAppId:KAppId appKey:KAppKey];
72 66  
73 67 _kitCN = [[CNLiveGPUStreamerKit alloc] initWithDefaultConfigWithActivityId:activityId channelId:@"iOStest" isHorizontalScreen:@"0"];
74 68  
... ... @@ -561,6 +555,7 @@
561 555  
562 556 [[NSNotificationCenter defaultCenter] removeObserver:self name:CNLiveCaptureStateDidChangeNotification object:nil];
563 557  
  558 + [_kitCN cleanKit];
564 559 self.kitCN = nil;
565 560 }
566 561  
... ...
发布版SDK/CNLivePlayerSDK.framework/CNLivePlayerSDK
No preview for this file type
发布版SDK/CNLivePlayerSDK.framework/Headers/CNLiveGPUStreamerKit.h
... ... @@ -248,6 +248,12 @@ FOUNDATION_EXPORT NSString *const CNLiveStreamStateDidChangeNotification NS_AVAI
248 248 */
249 249 - (void) appBecomeActive;
250 250  
  251 +/**
  252 + @abstract 销毁推流核心类
  253 + @discussion 退出页面时调用此方法以销毁推流推流对象
  254 + */
  255 +- (void)cleanKit;
  256 +
251 257 #pragma mark - mirror & rotate
252 258  
253 259 /**
... ... @@ -290,4 +296,5 @@ FOUNDATION_EXPORT NSString *const CNLiveStreamStateDidChangeNotification NS_AVAI
290 296 */
291 297 @property (nonatomic, assign) CGFloat pinchZoomFactor;
292 298  
  299 +
293 300 @end
... ...
发布版SDK/CNLivePlayerSDK.framework/Info.plist
No preview for this file type