Repository: tauri-apps/wry (language: rust)

Issue:
Add webview.allowsInlineMediaPlayback feature for support HTML5 videos play inline on iPhone
**Is your feature request related to a problem? Please describe.**
support HTML5 videos play inline on iPhone;
The default value of this property is false for iPhone and true for iPad.

**Describe the solution you'd like**
Add this code in wry/src/wkwebview/mod.rs at line 396
let _: id = msg_send![_preference, setValue:_yes forKey:NSString::new("allowsInlineMediaPlayback")];


**Describe alternatives you've considered**


**Additional context**
Important
Apps created before iOS 10.0 must use the webkit-playsinline attribute.

Add webview.allowsInlineMediaPlayback feature for support HTML5 videos play inline on iPhone
**Is your feature request related to a problem? Please describe.**
support HTML5 videos play inline on iPhone;
The default value of this property is false for iPhone and true for iPad.

**Describe the solution you'd like**
Add this code in wry/src/wkwebview/mod.rs at line 396
let _: id = msg_send![_preference, setValue:_yes forKey:NSString::new("allowsInlineMediaPlayback")];


**Describe alternatives you've considered**


**Additional context**
Important
Apps created before iOS 10.0 must use the webkit-playsinline attribute.



Discussion / hints:

Fix patch:
diff --git a/.changes/ios-allow-media-playsinline.md b/.changes/ios-allow-media-playsinline.md
new file mode 100644
index 000000000..55870c086
--- /dev/null
+++ b/.changes/ios-allow-media-playsinline.md
@@ -0,0 +1,5 @@
+---
+"wry": patch
+---
+
+On iOS, allows media plays inline.
\ No newline at end of file
diff --git a/src/wkwebview/mod.rs b/src/wkwebview/mod.rs
index 049b704c4..b32833635 100644
--- a/src/wkwebview/mod.rs
+++ b/src/wkwebview/mod.rs
@@ -404,6 +404,9 @@ impl InnerWebView {
 
       let _: id = msg_send![_preference, setValue:_yes forKey:NSString::new("allowsPictureInPictureMediaPlayback")];
 
+      #[cfg(target_os = "ios")]
+      let _: id = msg_send![config, setAllowsInlineMediaPlayback: YES];
+
       if attributes.autoplay {
         let _: id = msg_send![config, setMediaTypesRequiringUserActionForPlayback:0];
       }


Test patch: