Skip to content

Commit 28529dc

Browse files
committed
修改文件
1 parent d5f51b2 commit 28529dc

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

AR-iOS-Video-Base/AR-iOS-Video-Base/Info.plist

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
<string>1</string>
2121
<key>LSRequiresIPhoneOS</key>
2222
<true/>
23+
<key>NSAppTransportSecurity</key>
24+
<dict>
25+
<key>NSAllowsArbitraryLoads</key>
26+
<true/>
27+
</dict>
28+
<key>NSCameraUsageDescription</key>
29+
<string>Camera for a call</string>
30+
<key>NSMicrophoneUsageDescription</key>
31+
<string>Microphone for a call</string>
2332
<key>UIApplicationSupportsIndirectInputEvents</key>
2433
<true/>
2534
<key>UILaunchStoryboardName</key>
@@ -32,20 +41,9 @@
3241
</array>
3342
<key>UIStatusBarStyle</key>
3443
<string>UIStatusBarStyleLightContent</string>
35-
<key>NSAppTransportSecurity</key>
36-
<dict>
37-
<key>NSAllowsArbitraryLoads</key>
38-
<true/>
39-
</dict>
40-
<key>NSCameraUsageDescription</key>
41-
<string>Camera for a call</string>
42-
<key>NSMicrophoneUsageDescription</key>
43-
<string>Microphone for a call</string>
4444
<key>UISupportedInterfaceOrientations</key>
4545
<array>
4646
<string>UIInterfaceOrientationPortrait</string>
47-
<string>UIInterfaceOrientationLandscapeLeft</string>
48-
<string>UIInterfaceOrientationLandscapeRight</string>
4947
</array>
5048
<key>UISupportedInterfaceOrientations~ipad</key>
5149
<array>

AR-iOS-Video-Base/AR-iOS-Video-Base/Main/HomeViewController.m

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,21 @@ - (void)viewDidLoad {
2929

3030
- (IBAction)JoinChannelAction:(id)sender {
3131
[self.view endEditing:YES];
32-
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
33-
RoomViewController *vc = [sb instantiateViewControllerWithIdentifier:@"RoomViewController"];
34-
vc.userId = _uid;
35-
vc.channelId = self.channelTF.text;
36-
[self.navigationController pushViewController:vc animated:YES];
32+
33+
if ([self.channelTF.text isEqualToString:@""]) {
34+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"频道id不能为空" preferredStyle:UIAlertControllerStyleAlert];
35+
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
36+
37+
}];
38+
[alert addAction:sureAction];
39+
[self presentViewController:alert animated:YES completion:nil];
40+
} else {
41+
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
42+
RoomViewController *vc = [sb instantiateViewControllerWithIdentifier:@"RoomViewController"];
43+
vc.userId = _uid;
44+
vc.channelId = self.channelTF.text;
45+
[self.navigationController pushViewController:vc animated:YES];
46+
}
3747
}
3848

3949

AR-iOS-Video-Base/AR-iOS-Video-Base/Main/RoomViewController.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by anyRTC on 2021/1/26.
66
//
77

8-
#define APPID @"177e21c0d1641291c34e46e1198bd49a"
8+
#define APPID @""
99

1010
#import "RoomViewController.h"
1111
#import "VideoShowCell.h"
@@ -36,9 +36,14 @@ - (void)viewDidLoad {
3636
// [self.engineKit setEnableSpeakerphone:YES];
3737
}
3838

39+
-(void)viewDidDisappear:(BOOL)animated{
40+
[super viewDidDisappear:animated];
41+
[self.engineKit leaveChannel:nil];
42+
self.engineKit.delegate = nil;
43+
self.engineKit = nil;
44+
}
3945

4046
- (void)initUI {
41-
4247
[self.collection registerNib:[UINib nibWithNibName:NSStringFromClass([VideoShowCell class]) bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:NSStringFromClass([VideoShowCell class])];
4348

4449
[self.micBtn setImage:IMG(@"img_audio_open") forState:UIControlStateNormal];

0 commit comments

Comments
 (0)