From 6b6b7f4ed0593497bd58410584dfcc8ba0362d1e Mon Sep 17 00:00:00 2001 From: Jason Beetham Date: Fri, 6 Mar 2026 11:54:59 -0700 Subject: [PATCH 1/2] Add setting to disable element-call's disabling of picture in picture --- ...nable_picture_in_picture_in_element_call.md | 5 +++++ src/app/features/call/CallView.tsx | 18 ++++++++++++++++++ .../features/settings/cosmetics/Cosmetics.tsx | 18 ++++++++++++++++++ src/app/state/settings.ts | 2 ++ 4 files changed, 43 insertions(+) create mode 100644 .changeset/add_setting_to_enable_picture_in_picture_in_element_call.md diff --git a/.changeset/add_setting_to_enable_picture_in_picture_in_element_call.md b/.changeset/add_setting_to_enable_picture_in_picture_in_element_call.md new file mode 100644 index 00000000..46bb9966 --- /dev/null +++ b/.changeset/add_setting_to_enable_picture_in_picture_in_element_call.md @@ -0,0 +1,5 @@ +--- +sable: patch +--- + +# Add setting to enable picture-in-picture in element-call diff --git a/src/app/features/call/CallView.tsx b/src/app/features/call/CallView.tsx index 485cd331..c845e80c 100644 --- a/src/app/features/call/CallView.tsx +++ b/src/app/features/call/CallView.tsx @@ -26,6 +26,8 @@ import { usePowerLevelsContext } from '$hooks/usePowerLevels'; import { useRoomName } from '$hooks/useRoomMeta'; import { useAtomValue } from 'jotai'; import { nicknamesAtom } from '$state/nicknames'; +import { settingsAtom } from '$state/settings'; +import { useSetting } from '$state/hooks/settings'; import * as css from './CallView.css'; import { CallViewUser } from './CallViewUser'; @@ -138,10 +140,25 @@ export function CallView({ room }: { room: Room }) { wait: 50, immediate: false, }); + + const [allowPipVideos] = useSetting(settingsAtom, 'allowPipVideos'); + useEffect(() => { const iframeElement = activeIframeDisplayRef?.current; const hostElement = iframeHostRef?.current; + if (allowPipVideos) { + const removeDisablePictureInPicture = (mutated: any) => { + mutated.forEach((event: any) => { + Array.from(event.target.getElementsByTagName('video')).forEach((video: any) => { + video.removeAttribute('disablepictureinpicture'); + }); + }); + }; + const pipObserver = new MutationObserver(removeDisablePictureInPicture); + pipObserver.observe(iframeElement?.contentDocument!, { subtree: true, childList: true }); + } + if (room.isCallRoom() || (callIsCurrentAndReady && iframeElement && hostElement)) { applyFixedPositioningToIframe(); @@ -172,6 +189,7 @@ export function CallView({ room }: { room: Room }) { debouncedApplyFixedPositioning, callIsCurrentAndReady, room, + allowPipVideos, ]); const handleJoinVCClick: MouseEventHandler = (evt) => { diff --git a/src/app/features/settings/cosmetics/Cosmetics.tsx b/src/app/features/settings/cosmetics/Cosmetics.tsx index d39d3a2a..0e2f555e 100644 --- a/src/app/features/settings/cosmetics/Cosmetics.tsx +++ b/src/app/features/settings/cosmetics/Cosmetics.tsx @@ -240,6 +240,23 @@ function IdentityCosmetics() { ); } +function VideoCosmetics() { + const [allowPipVideos, setPipVideos] = useSetting(settingsAtom, 'allowPipVideos'); + + return ( + + Video + + } + /> + + + ); +} + type CosmeticsProps = { requestClose: () => void; }; @@ -269,6 +286,7 @@ export function Cosmetics({ requestClose }: CosmeticsProps) { + diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts index f845afa1..318485b0 100644 --- a/src/app/state/settings.ts +++ b/src/app/state/settings.ts @@ -43,6 +43,7 @@ export interface Settings { encUrlPreview: boolean; showHiddenEvents: boolean; legacyUsernameColor: boolean; + allowPipVideos: boolean; usePushNotifications: boolean; useInAppNotifications: boolean; @@ -105,6 +106,7 @@ const defaultSettings: Settings = { encUrlPreview: false, showHiddenEvents: false, legacyUsernameColor: false, + allowPipVideos: false, // Push notifications (SW/Sygnal): default on for mobile, opt-in on desktop. // In-app pill banner: default on for mobile (primary foreground alert), opt-in on desktop. From bc23dab6928df77d18674913f93ee247363c1700 Mon Sep 17 00:00:00 2001 From: 7w1 Date: Fri, 6 Mar 2026 16:45:03 -0600 Subject: [PATCH 2/2] Change sable version from patch to minor --- .../add_setting_to_enable_picture_in_picture_in_element_call.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/add_setting_to_enable_picture_in_picture_in_element_call.md b/.changeset/add_setting_to_enable_picture_in_picture_in_element_call.md index 46bb9966..521791c6 100644 --- a/.changeset/add_setting_to_enable_picture_in_picture_in_element_call.md +++ b/.changeset/add_setting_to_enable_picture_in_picture_in_element_call.md @@ -1,5 +1,5 @@ --- -sable: patch +sable: minor --- # Add setting to enable picture-in-picture in element-call