Automatically adjust the ElementCall PiP when changing orientations

This commit is contained in:
Stefan Ceriu
2026-06-03 14:56:50 +03:00
parent 92086d66c3
commit ee82ed976e
2 changed files with 34 additions and 1 deletions
@@ -57,6 +57,9 @@ enum CallScreenJavaScriptMessageName: String, CaseIterable {
case onOutputDeviceSelect
/// Used to handle the webview back button
case onBackButtonPressed
/// Used to handle PiP orientation changes
case onPipMediaOrientationUpdate
/// Forward logs to the native side for debugging purposes.
case forwardLogs
@@ -96,6 +99,12 @@ enum CallScreenJavaScriptMessageName: String, CaseIterable {
window.webkit.messageHandlers.\(rawValue).postMessage("");
}
"""
case .onPipMediaOrientationUpdate:
"""
window.controls.\(rawValue) = (orientation) => {
window.webkit.messageHandlers.\(rawValue).postMessage(orientation);
}
"""
case .forwardLogs:
"""
(function() {