Browse Source

Merge pull request #93 from SurpassRabbit/master

add allowsInlineMediaPlayback prop && update size properly on iOS
iou90 5 years ago
parent
commit
f807885e85
No account linked to committer's email address
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      autoHeightWebView/index.ios.js

+ 6
- 3
autoHeightWebView/index.ios.js View File

43
     onLoadStart: PropTypes.func,
43
     onLoadStart: PropTypes.func,
44
     onLoadEnd: PropTypes.func,
44
     onLoadEnd: PropTypes.func,
45
     onShouldStartLoadWithRequest: PropTypes.func,
45
     onShouldStartLoadWithRequest: PropTypes.func,
46
+    allowsInlineMediaPlayback: PropTypes.bool,
46
     // 'web/' by default
47
     // 'web/' by default
47
     baseUrl: PropTypes.string,
48
     baseUrl: PropTypes.string,
48
     // add baseUrl/files... to project root
49
     // add baseUrl/files... to project root
83
     const width = props.style ? props.style.width : null;
84
     const width = props.style ? props.style.width : null;
84
     if (isSizeChanged(height, oldHeight, width, oldWidth)) {
85
     if (isSizeChanged(height, oldHeight, width, oldWidth)) {
85
       return {
86
       return {
86
-        height,
87
-        width,
87
+        height: height || oldHeight,
88
+        width: width || oldWidth,
88
         isSizeChanged: true
89
         isSizeChanged: true
89
       };
90
       };
90
     }
91
     }
148
       enableAnimation,
149
       enableAnimation,
149
       heightOffset,
150
       heightOffset,
150
       style,
151
       style,
151
-      scrollEnabled
152
+      scrollEnabled,
153
+      allowsInlineMediaPlayback
152
     } = this.props;
154
     } = this.props;
153
     const { source, script } = this.getUpdatedState(this.props, getBaseScript, getIframeBaseScript);
155
     const { source, script } = this.getUpdatedState(this.props, getBaseScript, getIframeBaseScript);
154
     return (
156
     return (
178
           injectedJavaScript={script}
180
           injectedJavaScript={script}
179
           source={source}
181
           source={source}
180
           onNavigationStateChange={this.handleNavigationStateChange}
182
           onNavigationStateChange={this.handleNavigationStateChange}
183
+          allowsInlineMediaPlayback={allowsInlineMediaPlayback}
181
         />
184
         />
182
       </Animated.View>
185
       </Animated.View>
183
     );
186
     );