Skip to content

Commit

Permalink
fix(ios): set allowsInlineMediaPlayback to YES, closes #1209 (#1210)
Browse files Browse the repository at this point in the history
  • Loading branch information
pewsheen authored Apr 2, 2024
1 parent 26b58c6 commit ed9fa9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/ios-allow-media-playsinline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": patch
---

On iOS, allows media plays inline.
3 changes: 3 additions & 0 deletions src/wkwebview/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit ed9fa9b

Please sign in to comment.