Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,22 @@

#import "PushCDNAudienceViewController.h"

@interface PushCDNAudienceViewController ()<TXLivePlayListener>
@interface PushCDNAudienceViewController ()<V2TXLivePlayerObserver>

@property (weak, nonatomic) IBOutlet UILabel *streamIDLabel;
@property (weak, nonatomic) IBOutlet UITextField *streamIDTextField;
@property (weak, nonatomic) IBOutlet UIView *playerView;
@property (weak, nonatomic) IBOutlet UIButton *startPlayButton;

@property (strong, nonatomic) TXLivePlayer *livePlayer;
@property (strong, nonatomic) V2TXLivePlayer *livePlayer;

@end

@implementation PushCDNAudienceViewController

- (TXLivePlayer *)livePlayer {
- (V2TXLivePlayer *)livePlayer {
if (!_livePlayer) {
_livePlayer = [[TXLivePlayer alloc] init];
_livePlayer = [[V2TXLivePlayer alloc] init];
}
return _livePlayer;
}
Expand All @@ -62,17 +62,17 @@ - (void)setupDefaultUIConfig {

- (void)startPlay {
NSString *streamUrl = [NSString stringWithFormat:@"%@/%@.flv",kCDN_URL,self.streamIDTextField.text];
[self.livePlayer setDelegate:self];
[self.livePlayer setupVideoWidget:CGRectZero containView:self.playerView insertIndex:0];
int ret = [self.livePlayer startPlay:streamUrl type:PLAY_TYPE_LIVE_FLV];
[self.livePlayer setObserver:self];
[self.livePlayer setRenderView:self.playerView];
V2TXLiveCode ret = [self.livePlayer startPlay:streamUrl];
if (ret != 0) {
NSLog(@"play error. code: %d", ret);
NSLog(@"play error. code: %ld", ret);
}
}

- (void)stopPlay {
[self.livePlayer setDelegate:nil];
[self.livePlayer removeVideoWidget];
[self.livePlayer setObserver:nil];
[self.livePlayer setRenderView:nil];
[self.livePlayer stopPlay];
}

Expand All @@ -93,15 +93,16 @@ - (IBAction)onPlayClick:(UIButton *)sender {
}
}

#pragma mark - TXLivePlayListener
- (void)onPlayEvent:(int)EvtID withParam:(NSDictionary *)param {
NSLog(@"event: %d", EvtID);
#pragma mark - V2TXLivePlayerObserver
- (void)onVideoPlaying:(id<V2TXLivePlayer>)player firstPlay:(BOOL)firstPlay extraInfo:(NSDictionary *)extraInfo {
NSLog(@"onVideoPlaying");
}

- (void)onNetStatus:(NSDictionary *)param {

- (void)onError:(id<V2TXLivePlayer>)player code:(V2TXLiveCode)code message:(NSString *)msg extraInfo:(NSDictionary *)extraInfo {
NSLog(@"onError: message: %@",msg);
}


- (void)dealloc {
[self stopPlay];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ - (void)setupTRTCCloud {
encParams.videoBitrate = 550;
encParams.videoFps = 15;

[self.trtcCloud setGSensorMode:TRTCGSensorMode_Disable];
[self.trtcCloud setVideoEncoderParam:encParams];
[self.trtcCloud startLocalAudio:TRTCAudioQualityMusic];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#import "ThirdBeautyBytedViewController.h"
#import <OpenGLES/ES2/gl.h>
//#import "BEEffectManager.h"
//#import "BEEffectResourceHelper.h"
//#import "BEEffectDataManager.h"
Expand Down
2 changes: 1 addition & 1 deletion iOS/TRTC-API-Example-OC/App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1410</string>
<string>1464</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,7 @@ - (void)broadcastFinished:(TXReplayKitExt *)broadcast reason:(TXReplayKitExtReas
}

- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType {
switch (sampleBufferType) {
case RPSampleBufferTypeVideo:
[[TXReplayKitExt sharedInstance] sendVideoSampleBuffer:sampleBuffer];
break;
case RPSampleBufferTypeAudioApp:
// Handle audio sample buffer for app audio
break;
case RPSampleBufferTypeAudioMic:
// Handle audio sample buffer for mic audio
break;

default:
break;
}
[[TXReplayKitExt sharedInstance] sendSampleBuffer:sampleBuffer withType:sampleBufferType];
}
@end

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
0FB5D4D64CEC30830CF8F7AC /* TXLiteAVSDK_TRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C0EEEF96429D2F794B7401C /* TXLiteAVSDK_TRTC.framework */; };
17A5BD8626CBABBC007E91B1 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = 17A5BD8326CBABBC007E91B1 /* README.md */; };
17A5BE0726CBCC21007E91B1 /* TRTC-API-Example-OC-PrefixHeader.pch in Sources */ = {isa = PBXBuildFile; fileRef = 477EC9F12626F77E007AAC4F /* TRTC-API-Example-OC-PrefixHeader.pch */; };
17A5C13F26CCF723007E91B1 /* ThirdBeautyBytedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 17A5C13926CCF722007E91B1 /* ThirdBeautyBytedViewController.m */; };
Expand Down Expand Up @@ -94,7 +93,6 @@
47E073302636A6C80027D05E /* SetBGMViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 47E072F12636A6C80027D05E /* SetBGMViewController.m */; };
47ECB98C2626868400201FCB /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47ECB98B2626868400201FCB /* Accelerate.framework */; };
47ECB98E2626868E00201FCB /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 47ECB98D2626868E00201FCB /* libresolv.tbd */; };
84E684382A035D1ED76108D9 /* TXLiteAVSDK_TRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8C0EEEF96429D2F794B7401C /* TXLiteAVSDK_TRTC.framework */; };
880B3C4A2624411B002683FB /* GenerateTestUserSig.m in Sources */ = {isa = PBXBuildFile; fileRef = 880B3C482624411B002683FB /* GenerateTestUserSig.m */; };
8821F2632626EB1C00F5852F /* VideoCallingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8821F2562626EB1B00F5852F /* VideoCallingViewController.m */; };
8821F2642626EB1C00F5852F /* VideoCallingEnterViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8821F2572626EB1B00F5852F /* VideoCallingEnterViewController.xib */; };
Expand All @@ -117,6 +115,8 @@
889445E8262866DC00193FAD /* ScreenAudienceViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 889445E6262866DC00193FAD /* ScreenAudienceViewController.xib */; };
88A2C846267062FF006FC026 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47ECB98B2626868400201FCB /* Accelerate.framework */; };
88A2C84726706305006FC026 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 47ECB9882626867C00201FCB /* libc++.tbd */; };
A794D913556771781712F8A3 /* TXLiteAVSDK_TRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9C46E5E1BCABD9EA8C0067A /* TXLiteAVSDK_TRTC.framework */; };
DF8003AC9402F5CE54AAFD7F /* TXLiteAVSDK_TRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9C46E5E1BCABD9EA8C0067A /* TXLiteAVSDK_TRTC.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -319,9 +319,9 @@
889445E4262866DC00193FAD /* ScreenAudienceViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScreenAudienceViewController.h; sourceTree = "<group>"; };
889445E5262866DC00193FAD /* ScreenAudienceViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScreenAudienceViewController.m; sourceTree = "<group>"; };
889445E6262866DC00193FAD /* ScreenAudienceViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ScreenAudienceViewController.xib; sourceTree = "<group>"; };
8C0EEEF96429D2F794B7401C /* TXLiteAVSDK_TRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TXLiteAVSDK_TRTC.framework; path = ../SDK/TXLiteAVSDK_TRTC.framework; sourceTree = "<group>"; };
C99BF07371D8A29601F2FC64 /* Pods_TXReplayKit_Screen.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TXReplayKit_Screen.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C9B2CC51BDD884255109D5F7 /* Pods_TRTC_API_Example_OC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TRTC_API_Example_OC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
C9C46E5E1BCABD9EA8C0067A /* TXLiteAVSDK_TRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TXLiteAVSDK_TRTC.framework; path = ../SDK/TXLiteAVSDK_TRTC.framework; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -338,7 +338,7 @@
47ECB98E2626868E00201FCB /* libresolv.tbd in Frameworks */,
4723A7C526315FB10094AC81 /* libc++.tbd in Frameworks */,
4723A7C226315FA30094AC81 /* CoreMedia.framework in Frameworks */,
84E684382A035D1ED76108D9 /* TXLiteAVSDK_TRTC.framework in Frameworks */,
DF8003AC9402F5CE54AAFD7F /* TXLiteAVSDK_TRTC.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -350,7 +350,7 @@
88A2C846267062FF006FC026 /* Accelerate.framework in Frameworks */,
8894458D26282AF800193FAD /* TXLiteAVSDK_ReplayKitExt.framework in Frameworks */,
8894456B26282A3200193FAD /* ReplayKit.framework in Frameworks */,
0FB5D4D64CEC30830CF8F7AC /* TXLiteAVSDK_TRTC.framework in Frameworks */,
A794D913556771781712F8A3 /* TXLiteAVSDK_TRTC.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -468,7 +468,7 @@
isa = PBXGroup;
children = (
889444FD262824EA00193FAD /* TXLiteAVSDK_ReplayKitExt.framework */,
8C0EEEF96429D2F794B7401C /* TXLiteAVSDK_TRTC.framework */,
C9C46E5E1BCABD9EA8C0067A /* TXLiteAVSDK_TRTC.framework */,
);
name = SDK;
path = ../SDK;
Expand Down