Pārlūkot izejas kodu

feature-flags: initial implementation

The welcomePageEnabled and pictureInPictureEnabled props on mobile have been
converted to feature flags.
master
Saúl Ibarra Corretgé 6 gadus atpakaļ
vecāks
revīzija
cf7b10d53d

+ 36
- 20
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetConferenceOptions.java Parādīt failu

54
      */
54
      */
55
     private Bundle colorScheme;
55
     private Bundle colorScheme;
56
 
56
 
57
+    /**
58
+     * Feature flags. See: https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/flags/constants.js
59
+     */
60
+    private Bundle featureFlags;
61
+
57
     /**
62
     /**
58
      * Set to {@code true} to join the conference with audio / video muted or to start in audio
63
      * Set to {@code true} to join the conference with audio / video muted or to start in audio
59
      * only mode respectively.
64
      * only mode respectively.
62
     private Boolean audioOnly;
67
     private Boolean audioOnly;
63
     private Boolean videoMuted;
68
     private Boolean videoMuted;
64
 
69
 
65
-    /**
66
-     * Set to {@code true} to enable the welcome page. Typically SDK users won't need this enabled
67
-     * since the host application decides which meeting to join.
68
-     */
69
-    private Boolean welcomePageEnabled;
70
-
71
     /**
70
     /**
72
      * Class used to build the immutable {@link JitsiMeetConferenceOptions} object.
71
      * Class used to build the immutable {@link JitsiMeetConferenceOptions} object.
73
      */
72
      */
78
         private String token;
77
         private String token;
79
 
78
 
80
         private Bundle colorScheme;
79
         private Bundle colorScheme;
80
+        private Bundle featureFlags;
81
 
81
 
82
         private Boolean audioMuted;
82
         private Boolean audioMuted;
83
         private Boolean audioOnly;
83
         private Boolean audioOnly;
84
         private Boolean videoMuted;
84
         private Boolean videoMuted;
85
 
85
 
86
-        private Boolean welcomePageEnabled;
87
-
88
         public Builder() {
86
         public Builder() {
87
+            featureFlags = new Bundle();
89
         }
88
         }
90
 
89
 
91
         /**\
90
         /**\
186
          * @return - The {@link Builder} object itself so the method calls can be chained.
185
          * @return - The {@link Builder} object itself so the method calls can be chained.
187
          */
186
          */
188
         public Builder setWelcomePageEnabled(boolean enabled) {
187
         public Builder setWelcomePageEnabled(boolean enabled) {
189
-            this.welcomePageEnabled = enabled;
188
+            this.featureFlags.putBoolean("welcomepage.enabled", enabled);
189
+
190
+            return this;
191
+        }
192
+
193
+        public Builder setFeatureFlag(String flag, boolean value) {
194
+            this.featureFlags.putBoolean(flag, value);
195
+
196
+            return this;
197
+        }
198
+
199
+        public Builder setFeatureFlag(String flag, String value) {
200
+            this.featureFlags.putString(flag, value);
201
+
202
+            return this;
203
+        }
204
+
205
+        public Builder setFeatureFlag(String flag, int value) {
206
+            this.featureFlags.putInt(flag, value);
190
 
207
 
191
             return this;
208
             return this;
192
         }
209
         }
204
             options.subject = this.subject;
221
             options.subject = this.subject;
205
             options.token = this.token;
222
             options.token = this.token;
206
             options.colorScheme = this.colorScheme;
223
             options.colorScheme = this.colorScheme;
224
+            options.featureFlags = this.featureFlags;
207
             options.audioMuted = this.audioMuted;
225
             options.audioMuted = this.audioMuted;
208
             options.audioOnly = this.audioOnly;
226
             options.audioOnly = this.audioOnly;
209
             options.videoMuted = this.videoMuted;
227
             options.videoMuted = this.videoMuted;
210
-            options.welcomePageEnabled = this.welcomePageEnabled;
211
 
228
 
212
             return options;
229
             return options;
213
         }
230
         }
221
         subject = in.readString();
238
         subject = in.readString();
222
         token = in.readString();
239
         token = in.readString();
223
         colorScheme = in.readBundle();
240
         colorScheme = in.readBundle();
241
+        featureFlags = in.readBundle();
224
         byte tmpAudioMuted = in.readByte();
242
         byte tmpAudioMuted = in.readByte();
225
         audioMuted = tmpAudioMuted == 0 ? null : tmpAudioMuted == 1;
243
         audioMuted = tmpAudioMuted == 0 ? null : tmpAudioMuted == 1;
226
         byte tmpAudioOnly = in.readByte();
244
         byte tmpAudioOnly = in.readByte();
227
         audioOnly = tmpAudioOnly == 0 ? null : tmpAudioOnly == 1;
245
         audioOnly = tmpAudioOnly == 0 ? null : tmpAudioOnly == 1;
228
         byte tmpVideoMuted = in.readByte();
246
         byte tmpVideoMuted = in.readByte();
229
         videoMuted = tmpVideoMuted == 0 ? null : tmpVideoMuted == 1;
247
         videoMuted = tmpVideoMuted == 0 ? null : tmpVideoMuted == 1;
230
-        byte tmpWelcomePageEnabled = in.readByte();
231
-        welcomePageEnabled = tmpWelcomePageEnabled == 0 ? null : tmpWelcomePageEnabled == 1;
232
     }
248
     }
233
 
249
 
234
     Bundle asProps() {
250
     Bundle asProps() {
235
         Bundle props = new Bundle();
251
         Bundle props = new Bundle();
236
 
252
 
237
-        if (colorScheme != null) {
238
-            props.putBundle("colorScheme", colorScheme);
253
+        // Android always has the PiP flag set by default.
254
+        if (!featureFlags.containsKey("pip.enabled")) {
255
+            featureFlags.putBoolean("pip.enabled", true);
239
         }
256
         }
240
 
257
 
241
-        if (welcomePageEnabled != null) {
242
-            props.putBoolean("welcomePageEnabled", welcomePageEnabled);
243
-        }
258
+        props.putBundle("flags", featureFlags);
244
 
259
 
245
-        // TODO: get rid of this.
246
-        props.putBoolean("pictureInPictureEnabled", true);
260
+        if (colorScheme != null) {
261
+            props.putBundle("colorScheme", colorScheme);
262
+        }
247
 
263
 
248
         Bundle config = new Bundle();
264
         Bundle config = new Bundle();
249
 
265
 
305
         dest.writeString(subject);
321
         dest.writeString(subject);
306
         dest.writeString(token);
322
         dest.writeString(token);
307
         dest.writeBundle(colorScheme);
323
         dest.writeBundle(colorScheme);
324
+        dest.writeBundle(featureFlags);
308
         dest.writeByte((byte) (audioMuted == null ? 0 : audioMuted ? 1 : 2));
325
         dest.writeByte((byte) (audioMuted == null ? 0 : audioMuted ? 1 : 2));
309
         dest.writeByte((byte) (audioOnly == null ? 0 : audioOnly ? 1 : 2));
326
         dest.writeByte((byte) (audioOnly == null ? 0 : audioOnly ? 1 : 2));
310
         dest.writeByte((byte) (videoMuted == null ? 0 : videoMuted ? 1 : 2));
327
         dest.writeByte((byte) (videoMuted == null ? 0 : videoMuted ? 1 : 2));
311
-        dest.writeByte((byte) (welcomePageEnabled == null ? 0 : welcomePageEnabled ? 1 : 2));
312
     }
328
     }
313
 
329
 
314
     @Override
330
     @Override

+ 6
- 0
ios/app/src/ViewController.m Parādīt failu

96
     [self _onJitsiMeetViewDelegateEvent:@"CONFERENCE_WILL_JOIN" withData:data];
96
     [self _onJitsiMeetViewDelegateEvent:@"CONFERENCE_WILL_JOIN" withData:data];
97
 }
97
 }
98
 
98
 
99
+#if 0
100
+- (void)enterPictureInPicture:(NSDictionary *)data {
101
+    [self _onJitsiMeetViewDelegateEvent:@"ENTER_PICTURE_IN_PICTURE" withData:data];
102
+}
103
+#endif
104
+
99
 @end
105
 @end

+ 9
- 0
ios/sdk/src/JitsiMeetConferenceOptions.h Parādīt failu

41
  */
41
  */
42
 @property (nonatomic, copy, nullable) NSDictionary *colorScheme;
42
 @property (nonatomic, copy, nullable) NSDictionary *colorScheme;
43
 
43
 
44
+/**
45
+ * Feature flags. See: https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/flags/constants.js
46
+ */
47
+@property (nonatomic, readonly, nonnull) NSDictionary *featureFlags;
48
+
44
 /**
49
 /**
45
  * Set to YES to join the conference with audio / video muted or to start in audio
50
  * Set to YES to join the conference with audio / video muted or to start in audio
46
  * only mode respectively.
51
  * only mode respectively.
55
  */
60
  */
56
 @property (nonatomic) BOOL welcomePageEnabled;
61
 @property (nonatomic) BOOL welcomePageEnabled;
57
 
62
 
63
+- (void)setFeatureFlag:(NSString *_Nonnull)flag withBoolean:(BOOL)value;
64
+- (void)setFeatureFlag:(NSString *_Nonnull)flag withValue:(id _Nonnull)value;
65
+
58
 @end
66
 @end
59
 
67
 
60
 @interface JitsiMeetConferenceOptions : NSObject
68
 @interface JitsiMeetConferenceOptions : NSObject
66
 @property (nonatomic, copy, nullable, readonly) NSString *token;
74
 @property (nonatomic, copy, nullable, readonly) NSString *token;
67
 
75
 
68
 @property (nonatomic, copy, nullable) NSDictionary *colorScheme;
76
 @property (nonatomic, copy, nullable) NSDictionary *colorScheme;
77
+@property (nonatomic, readonly, nonnull) NSDictionary *featureFlags;
69
 
78
 
70
 @property (nonatomic, readonly) BOOL audioOnly;
79
 @property (nonatomic, readonly) BOOL audioOnly;
71
 @property (nonatomic, readonly) BOOL audioMuted;
80
 @property (nonatomic, readonly) BOOL audioMuted;

+ 28
- 16
ios/sdk/src/JitsiMeetConferenceOptions.m Parādīt failu

18
 
18
 
19
 #import "JitsiMeetConferenceOptions+Private.h"
19
 #import "JitsiMeetConferenceOptions+Private.h"
20
 
20
 
21
+/**
22
+ * Backwards compatibility: turn the boolean property into a feature flag.
23
+ */
24
+static NSString *const WelcomePageEnabledFeatureFlag = @"welcomepage.enabled";
25
+
26
+
21
 @implementation JitsiMeetConferenceOptionsBuilder {
27
 @implementation JitsiMeetConferenceOptionsBuilder {
22
     NSNumber *_audioOnly;
28
     NSNumber *_audioOnly;
23
     NSNumber *_audioMuted;
29
     NSNumber *_audioMuted;
24
     NSNumber *_videoMuted;
30
     NSNumber *_videoMuted;
25
-    NSNumber *_welcomePageEnabled;
31
+    NSMutableDictionary *_featureFlags;
26
 }
32
 }
27
 
33
 
28
 @dynamic audioOnly;
34
 @dynamic audioOnly;
38
         _token = nil;
44
         _token = nil;
39
 
45
 
40
         _colorScheme = nil;
46
         _colorScheme = nil;
47
+        _featureFlags = [[NSMutableDictionary alloc] init];
41
 
48
 
42
         _audioOnly = nil;
49
         _audioOnly = nil;
43
         _audioMuted = nil;
50
         _audioMuted = nil;
44
         _videoMuted = nil;
51
         _videoMuted = nil;
45
-
46
-        _welcomePageEnabled = nil;
47
     }
52
     }
48
     
53
     
49
     return self;
54
     return self;
50
 }
55
 }
51
 
56
 
57
+- (void)setFeatureFlag:(NSString *)flag withBoolean:(BOOL)value {
58
+    [self setFeatureFlag:flag withValue:[NSNumber numberWithBool:value]];
59
+}
60
+
61
+- (void)setFeatureFlag:(NSString *)flag withValue:(id)value {
62
+    _featureFlags[flag] = value;
63
+}
64
+
52
 #pragma mark - Dynamic properties
65
 #pragma mark - Dynamic properties
53
 
66
 
54
 - (void)setAudioOnly:(BOOL)audioOnly {
67
 - (void)setAudioOnly:(BOOL)audioOnly {
76
 }
89
 }
77
 
90
 
78
 - (void)setWelcomePageEnabled:(BOOL)welcomePageEnabled {
91
 - (void)setWelcomePageEnabled:(BOOL)welcomePageEnabled {
79
-    _welcomePageEnabled = [NSNumber numberWithBool:welcomePageEnabled];
92
+    [self setFeatureFlag:WelcomePageEnabledFeatureFlag
93
+               withBoolean:welcomePageEnabled];
80
 }
94
 }
81
 
95
 
82
 - (BOOL)welcomePageEnabled {
96
 - (BOOL)welcomePageEnabled {
83
-    return _welcomePageEnabled && [_welcomePageEnabled boolValue];
97
+    NSNumber *n = _featureFlags[WelcomePageEnabledFeatureFlag];
98
+
99
+    return n != nil ? [n boolValue] : NO;
84
 }
100
 }
85
 
101
 
86
 #pragma mark - Private API
102
 #pragma mark - Private API
97
     return _videoMuted;
113
     return _videoMuted;
98
 }
114
 }
99
 
115
 
100
-- (NSNumber *)getWelcomePageEnabled {
101
-    return _welcomePageEnabled;
102
-}
103
-
104
 @end
116
 @end
105
 
117
 
106
 @implementation JitsiMeetConferenceOptions {
118
 @implementation JitsiMeetConferenceOptions {
107
     NSNumber *_audioOnly;
119
     NSNumber *_audioOnly;
108
     NSNumber *_audioMuted;
120
     NSNumber *_audioMuted;
109
     NSNumber *_videoMuted;
121
     NSNumber *_videoMuted;
110
-    NSNumber *_welcomePageEnabled;
122
+    NSDictionary *_featureFlags;
111
 }
123
 }
112
 
124
 
113
 @dynamic audioOnly;
125
 @dynamic audioOnly;
130
 }
142
 }
131
 
143
 
132
 - (BOOL)welcomePageEnabled {
144
 - (BOOL)welcomePageEnabled {
133
-    return _welcomePageEnabled && [_welcomePageEnabled boolValue];
145
+    NSNumber *n = _featureFlags[WelcomePageEnabledFeatureFlag];
146
+
147
+    return n != nil ? [n boolValue] : NO;
134
 }
148
 }
135
 
149
 
136
 #pragma mark - Internal initializer
150
 #pragma mark - Internal initializer
148
         _audioMuted = [builder getAudioMuted];
162
         _audioMuted = [builder getAudioMuted];
149
         _videoMuted = [builder getVideoMuted];
163
         _videoMuted = [builder getVideoMuted];
150
 
164
 
151
-        _welcomePageEnabled = [builder getWelcomePageEnabled];
165
+        _featureFlags = [NSDictionary dictionaryWithDictionary:builder.featureFlags];
152
     }
166
     }
153
 
167
 
154
     return self;
168
     return self;
167
 - (NSDictionary *)asProps {
181
 - (NSDictionary *)asProps {
168
     NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
182
     NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
169
 
183
 
184
+    props[@"flags"] = [NSMutableDictionary dictionaryWithDictionary:_featureFlags];
185
+
170
     if (_colorScheme != nil) {
186
     if (_colorScheme != nil) {
171
         props[@"colorScheme"] = self.colorScheme;
187
         props[@"colorScheme"] = self.colorScheme;
172
     }
188
     }
173
 
189
 
174
-    if (_welcomePageEnabled != nil) {
175
-        props[@"welcomePageEnabled"] = @(self.welcomePageEnabled);
176
-    }
177
-
178
     NSMutableDictionary *config = [[NSMutableDictionary alloc] init];
190
     NSMutableDictionary *config = [[NSMutableDictionary alloc] init];
179
     if (_audioOnly != nil) {
191
     if (_audioOnly != nil) {
180
         config[@"startAudioOnly"] = @(self.audioOnly);
192
         config[@"startAudioOnly"] = @(self.audioOnly);

+ 14
- 4
ios/sdk/src/JitsiMeetView.m Parādīt failu

24
 #import "RNRootView.h"
24
 #import "RNRootView.h"
25
 
25
 
26
 
26
 
27
+/**
28
+ * Backwards compatibility: turn the boolean prop into a feature flag.
29
+ */
30
+static NSString *const PiPEnabledFeatureFlag = @"pip.enabled";
31
+
32
+
27
 @implementation JitsiMeetView {
33
 @implementation JitsiMeetView {
28
     /**
34
     /**
29
      * The unique identifier of this `JitsiMeetView` within the process for the
35
      * The unique identifier of this `JitsiMeetView` within the process for the
122
 - (void)setProps:(NSDictionary *_Nonnull)newProps {
128
 - (void)setProps:(NSDictionary *_Nonnull)newProps {
123
     NSMutableDictionary *props = mergeProps([[JitsiMeet sharedInstance] getDefaultProps], newProps);
129
     NSMutableDictionary *props = mergeProps([[JitsiMeet sharedInstance] getDefaultProps], newProps);
124
 
130
 
125
-    props[@"externalAPIScope"] = externalAPIScope;
131
+    // Set the PiP flag if it wasn't manually set.
132
+    NSMutableDictionary *featureFlags = props[@"flags"];
133
+    if (featureFlags[PiPEnabledFeatureFlag] == nil) {
134
+        featureFlags[PiPEnabledFeatureFlag]
135
+            = [NSNumber numberWithBool:
136
+               self.delegate && [self.delegate respondsToSelector:@selector(enterPictureInPicture:)]];
137
+    }
126
 
138
 
127
-    // TODO: put this in some 'flags' field
128
-    props[@"pictureInPictureEnabled"]
129
-        = @(self.delegate && [self.delegate respondsToSelector:@selector(enterPictureInPicture:)]);
139
+    props[@"externalAPIScope"] = externalAPIScope;
130
 
140
 
131
     // This method is supposed to be imperative i.e. a second
141
     // This method is supposed to be imperative i.e. a second
132
     // invocation with one and the same URL is expected to join the respective
142
     // invocation with one and the same URL is expected to join the respective

+ 6
- 11
react/features/app/components/App.native.js Parādīt failu

6
 import '../../authentication';
6
 import '../../authentication';
7
 import { setColorScheme } from '../../base/color-scheme';
7
 import { setColorScheme } from '../../base/color-scheme';
8
 import { DialogContainer } from '../../base/dialog';
8
 import { DialogContainer } from '../../base/dialog';
9
+import { updateFlags } from '../../base/flags';
9
 import '../../base/jwt';
10
 import '../../base/jwt';
10
 import { Platform } from '../../base/react';
11
 import { Platform } from '../../base/react';
11
 import {
12
 import {
47
     externalAPIScope: string,
48
     externalAPIScope: string,
48
 
49
 
49
     /**
50
     /**
50
-     * Whether Picture-in-Picture is enabled. If {@code true}, a toolbar button
51
-     * is rendered in the {@link Conference} view to afford entering
52
-     * Picture-in-Picture.
51
+     * An object with the feature flags.
53
      */
52
      */
54
-    pictureInPictureEnabled: boolean,
55
-
56
-    /**
57
-     * Whether the Welcome page is enabled. If {@code true}, the Welcome page is
58
-     * rendered when the {@link App} is not at a location (URL) identifying
59
-     * a Jitsi Meet conference/room.
60
-     */
61
-    welcomePageEnabled: boolean
53
+    flags: Object
62
 };
54
 };
63
 
55
 
64
 /**
56
 /**
99
             // We set the color scheme early enough so then we avoid any
91
             // We set the color scheme early enough so then we avoid any
100
             // unnecessary re-renders.
92
             // unnecessary re-renders.
101
             this.state.store.dispatch(setColorScheme(this.props.colorScheme));
93
             this.state.store.dispatch(setColorScheme(this.props.colorScheme));
94
+
95
+            // Ditto for feature flags.
96
+            this.state.store.dispatch(updateFlags(this.props.flags));
102
         });
97
         });
103
     }
98
     }
104
 
99
 

+ 10
- 0
react/features/base/flags/actionTypes.js Parādīt failu

1
+/**
2
+ * The type of Redux action which updates the feature flags.
3
+ *
4
+ * {
5
+ *     type: UPDATE_FLAGS,
6
+ *     flags: Object
7
+ * }
8
+ *
9
+ */
10
+export const UPDATE_FLAGS = 'UPDATE_FLAGS';

+ 19
- 0
react/features/base/flags/actions.js Parādīt failu

1
+// @flow
2
+
3
+import { UPDATE_FLAGS } from './actionTypes';
4
+
5
+/**
6
+ * Updates the current features flags with the given ones. They will be merged.
7
+ *
8
+ * @param {Object} flags - The new flags object.
9
+ * @returns {{
10
+ *     type: UPDATE_FLAGS,
11
+ *     flags: Object
12
+ * }}
13
+ */
14
+export function updateFlags(flags: Object) {
15
+    return {
16
+        type: UPDATE_FLAGS,
17
+        flags
18
+    };
19
+}

+ 13
- 0
react/features/base/flags/constants.js Parādīt failu

1
+// @flow
2
+
3
+/**
4
+ * Flag indicating if Picture-in-Picture should be enabled.
5
+ * Default: auto-detected.
6
+ */
7
+export const PIP_ENABLED = 'pip.enabled';
8
+
9
+/**
10
+ * Flag indicating if the welcome page should be enabled.
11
+ * Default: disabled (false).
12
+ */
13
+export const WELCOME_PAGE_ENABLED = 'welcomepage.enabled';

+ 32
- 0
react/features/base/flags/functions.js Parādīt failu

1
+// @flow
2
+
3
+import { getAppProp } from '../app';
4
+import { toState } from '../redux';
5
+
6
+/**
7
+ * Gets the value of a specific feature flag.
8
+ *
9
+ * @param {Function|Object} stateful - The redux store or {@code getState}
10
+ * function.
11
+ * @param {string} flag - The name of the React {@code Component} prop of
12
+ * the currently mounted {@code App} to get.
13
+ * @param {*} defaultValue - A default value for the flag, in case it's not defined.
14
+ * @returns {*} The value of the specified React {@code Compoennt} prop of the
15
+ * currently mounted {@code App}.
16
+ */
17
+export function getFeatureFlag(stateful: Function | Object, flag: string, defaultValue: any) {
18
+    const state = toState(stateful)['features/base/flags'];
19
+
20
+    if (state) {
21
+        const value = state[flag];
22
+
23
+        if (typeof value !== 'undefined') {
24
+            return value;
25
+        }
26
+    }
27
+
28
+    // Maybe the value hasn't made it to the redux store yet, check the app props.
29
+    const flags = getAppProp(stateful, 'flags') || {};
30
+
31
+    return flags[flag] || defaultValue;
32
+}

+ 6
- 0
react/features/base/flags/index.js Parādīt failu

1
+export * from './actions';
2
+export * from './actionTypes';
3
+export * from './constants';
4
+export * from './functions';
5
+
6
+import './reducer';

+ 33
- 0
react/features/base/flags/reducer.js Parādīt failu

1
+// @flow
2
+
3
+import _ from 'lodash';
4
+
5
+import { ReducerRegistry } from '../redux';
6
+
7
+import { UPDATE_FLAGS } from './actionTypes';
8
+
9
+/**
10
+ * Default state value for the feature flags.
11
+ */
12
+const DEFAULT_STATE = {};
13
+
14
+/**
15
+ * Reduces redux actions which handle feature flags.
16
+ *
17
+ * @param {State} state - The current redux state.
18
+ * @param {Action} action - The redux action to reduce.
19
+ * @param {string} action.type - The type of the redux action to reduce.
20
+ * @returns {State} The next redux state that is the result of reducing the
21
+ * specified action.
22
+ */
23
+ReducerRegistry.register('features/base/flags', (state = DEFAULT_STATE, action) => {
24
+    switch (action.type) {
25
+    case UPDATE_FLAGS: {
26
+        const newState = _.merge({}, state, action.flags);
27
+
28
+        return _.isEqual(state, newState) ? state : newState;
29
+    }
30
+    }
31
+
32
+    return state;
33
+});

+ 2
- 2
react/features/conference/components/native/Conference.js Parādīt failu

4
 import { BackHandler, NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
4
 import { BackHandler, NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
5
 
5
 
6
 import { appNavigate } from '../../../app';
6
 import { appNavigate } from '../../../app';
7
-import { getAppProp } from '../../../base/app';
7
+import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
8
 import { getParticipantCount } from '../../../base/participants';
8
 import { getParticipantCount } from '../../../base/participants';
9
 import { Container, LoadingIndicator, TintedView } from '../../../base/react';
9
 import { Container, LoadingIndicator, TintedView } from '../../../base/react';
10
 import { connect } from '../../../base/redux';
10
 import { connect } from '../../../base/redux';
452
          * @private
452
          * @private
453
          * @type {boolean}
453
          * @type {boolean}
454
          */
454
          */
455
-        _pictureInPictureEnabled: getAppProp(state, 'pictureInPictureEnabled'),
455
+        _pictureInPictureEnabled: getFeatureFlag(state, PIP_ENABLED),
456
 
456
 
457
         /**
457
         /**
458
          * The indicator which determines whether the UI is reduced (to
458
          * The indicator which determines whether the UI is reduced (to

+ 2
- 2
react/features/mobile/picture-in-picture/actions.js Parādīt failu

3
 import { NativeModules } from 'react-native';
3
 import { NativeModules } from 'react-native';
4
 import type { Dispatch } from 'redux';
4
 import type { Dispatch } from 'redux';
5
 
5
 
6
-import { getAppProp } from '../../base/app';
6
+import { PIP_ENABLED, getFeatureFlag } from '../../base/flags';
7
 import { Platform } from '../../base/react';
7
 import { Platform } from '../../base/react';
8
 
8
 
9
 import { ENTER_PICTURE_IN_PICTURE } from './actionTypes';
9
 import { ENTER_PICTURE_IN_PICTURE } from './actionTypes';
25
         // XXX At the time of this writing this action can only be dispatched by
25
         // XXX At the time of this writing this action can only be dispatched by
26
         // the button which is on the conference view, which means that it's
26
         // the button which is on the conference view, which means that it's
27
         // fine to enter PiP mode.
27
         // fine to enter PiP mode.
28
-        if (getAppProp(getState, 'pictureInPictureEnabled')) {
28
+        if (getFeatureFlag(getState, PIP_ENABLED)) {
29
             const { PictureInPicture } = NativeModules;
29
             const { PictureInPicture } = NativeModules;
30
             const p
30
             const p
31
                 = Platform.OS === 'android'
31
                 = Platform.OS === 'android'

+ 2
- 2
react/features/mobile/picture-in-picture/components/PictureInPictureButton.js Parādīt failu

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { getAppProp } from '../../../base/app';
3
+import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
4
 import { translate } from '../../../base/i18n';
4
 import { translate } from '../../../base/i18n';
5
 import { connect } from '../../../base/redux';
5
 import { connect } from '../../../base/redux';
6
 import { AbstractButton } from '../../../base/toolbox';
6
 import { AbstractButton } from '../../../base/toolbox';
62
  */
62
  */
63
 function _mapStateToProps(state): Object {
63
 function _mapStateToProps(state): Object {
64
     return {
64
     return {
65
-        _enabled: Boolean(getAppProp(state, 'pictureInPictureEnabled'))
65
+        _enabled: Boolean(getFeatureFlag(state, PIP_ENABLED))
66
     };
66
     };
67
 }
67
 }
68
 
68
 

+ 2
- 2
react/features/welcome/functions.js Parādīt failu

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { getAppProp } from '../base/app';
3
+import { WELCOME_PAGE_ENABLED, getFeatureFlag } from '../base/flags';
4
 import { toState } from '../base/redux';
4
 import { toState } from '../base/redux';
5
 
5
 
6
 declare var APP: Object;
6
 declare var APP: Object;
24
         // - Enabling/disabling the Welcome page on Web historically
24
         // - Enabling/disabling the Welcome page on Web historically
25
         // automatically redirects to a random room and that does not make sense
25
         // automatically redirects to a random room and that does not make sense
26
         // on mobile (right now).
26
         // on mobile (right now).
27
-        return Boolean(getAppProp(stateful, 'welcomePageEnabled'));
27
+        return Boolean(getFeatureFlag(stateful, WELCOME_PAGE_ENABLED));
28
     }
28
     }
29
 
29
 
30
     return true;
30
     return true;

Notiek ielāde…
Atcelt
Saglabāt