소스 검색

ios: add initial implementation of join / leave

master
Saúl Ibarra Corretgé 6 년 전
부모
커밋
549b495d16
3개의 변경된 파일35개의 추가작업 그리고 26개의 파일을 삭제
  1. 1
    1
      ios/app/src/ViewController.m
  2. 2
    1
      ios/sdk/src/JitsiMeetView.h
  3. 32
    24
      ios/sdk/src/JitsiMeetView.m

+ 1
- 1
ios/app/src/ViewController.m 파일 보기

@@ -39,7 +39,7 @@
39 39
     // anyway.
40 40
     view.welcomePageEnabled = YES;
41 41
 
42
-    [view loadURL:[[JitsiMeet sharedInstance] getInitialURL]];
42
+    [view join:[[JitsiMeet sharedInstance] getInitialURL]];
43 43
 }
44 44
 
45 45
 // JitsiMeetViewDelegate

+ 2
- 1
ios/sdk/src/JitsiMeetView.h 파일 보기

@@ -34,6 +34,7 @@
34 34
 
35 35
 @property (nonatomic) BOOL welcomePageEnabled;
36 36
 
37
-- (void)loadURL:(NSDictionary * _Nullable)urlObject;
37
+- (void)join:(NSDictionary * _Nullable)url;
38
+- (void)leave;
38 39
 
39 40
 @end

+ 32
- 24
ios/sdk/src/JitsiMeetView.m 파일 보기

@@ -101,6 +101,38 @@ static void initializeViewsMap() {
101 101
 
102 102
 #pragma mark API
103 103
 
104
+- (void)join:(NSDictionary *_Nullable)url {
105
+    [self loadURL:url];
106
+}
107
+
108
+- (void)leave {
109
+    [self loadURL:nil];
110
+}
111
+
112
+#pragma pictureInPictureEnabled getter / setter
113
+
114
+- (void) setPictureInPictureEnabled:(BOOL)pictureInPictureEnabled {
115
+    _pictureInPictureEnabled
116
+        = [NSNumber numberWithBool:pictureInPictureEnabled];
117
+}
118
+
119
+- (BOOL) pictureInPictureEnabled {
120
+    if (_pictureInPictureEnabled) {
121
+        return [_pictureInPictureEnabled boolValue];
122
+    }
123
+
124
+    // The SDK/JitsiMeetView client/consumer did not explicitly enable/disable
125
+    // Picture-in-Picture. However, we may automatically deduce their
126
+    // intentions: we need the support of the client in order to implement
127
+    // Picture-in-Picture on iOS (in contrast to Android) so if the client
128
+    // appears to have provided the support then we can assume that they did it
129
+    // with the intention to have Picture-in-Picture enabled.
130
+    return self.delegate
131
+        && [self.delegate respondsToSelector:@selector(enterPictureInPicture:)];
132
+}
133
+
134
+#pragma mark Private methods
135
+
104 136
 /**
105 137
  * Loads a specific URL which may identify a conference to join. The URL is
106 138
  * specified in the form of an `NSDictionary` of properties which (1)
@@ -160,30 +192,6 @@ static void initializeViewsMap() {
160 192
     }
161 193
 }
162 194
 
163
-#pragma pictureInPictureEnabled getter / setter
164
-
165
-- (void) setPictureInPictureEnabled:(BOOL)pictureInPictureEnabled {
166
-    _pictureInPictureEnabled
167
-        = [NSNumber numberWithBool:pictureInPictureEnabled];
168
-}
169
-
170
-- (BOOL) pictureInPictureEnabled {
171
-    if (_pictureInPictureEnabled) {
172
-        return [_pictureInPictureEnabled boolValue];
173
-    }
174
-
175
-    // The SDK/JitsiMeetView client/consumer did not explicitly enable/disable
176
-    // Picture-in-Picture. However, we may automatically deduce their
177
-    // intentions: we need the support of the client in order to implement
178
-    // Picture-in-Picture on iOS (in contrast to Android) so if the client
179
-    // appears to have provided the support then we can assume that they did it
180
-    // with the intention to have Picture-in-Picture enabled.
181
-    return self.delegate
182
-        && [self.delegate respondsToSelector:@selector(enterPictureInPicture:)];
183
-}
184
-
185
-#pragma mark Private methods
186
-
187 195
 + (BOOL)loadURLInViews:(NSDictionary *)urlObject {
188 196
     BOOL handled = NO;
189 197
 

Loading…
취소
저장