feat: add picture-in-picture pop-out for the live screen share - #1164
ankushdharkar wants to merge 1 commit into
Conversation
Attendees listen to the event audio in a separate app, so the screen share needs to float on top of whatever they switch to. The panel now carries a Pop out button for every role that toggles picture in picture on the screen share video element. * fix the playsinlne typo on the video element, iOS Safari needs playsinline or it forces fullscreen playback and picture in picture never starts * support the standard picture in picture API and the webkit presentation mode used by iOS Safari, with an info toast when the browser has neither * track the enter and leave events so the button can say Pop in while the video is floating * hide the button when the platform has no picture in picture API No microphone or camera permission is involved, the video element stays muted. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 59 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying www-rds with
|
| Latest commit: |
ba17baf
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d8de4649.www-rds.pages.dev |
| Branch Preview URL: | https://feat-live-picture-in-picture.www-rds.pages.dev |
Date: 23-08-26
Developer Name: @ankushdharkar
Issue Ticket Number:-
Description:
Attendees listen to the event audio in a separate app (Twitter Spaces and similar), and the
/livepage carries only the host's screen share, so the video needs to float on top of whatever they switch to. This PR adds a Picture-in-Picture "Pop out" button to the live panel for every role and fixes the attribute typo that blocked inline playback on iOS Safari.app/components/live-panel.hbs: newPop out/Pop inicon button (@id="picture-in-picture"), rendered only when@isPictureInPictureSupportedis true. The icon and title flip with@isPictureInPicture.app/constants/live.js: newBUTTONS_TYPE.PICTURE_IN_PICTUREand aPICTURE_IN_PICTURE_MODEconstant (picture-in-picture/inline) for the webkit presentation mode strings.app/controllers/live.js: newtogglePictureInPictureaction, wired intobuttonClickHandlerfor the new button type.app/services/live.js:isPictureInPictureSupportedgetter (standard API plusdocument.pictureInPictureEnabled, or the webkitwebkitSupportsPresentationModeAPI);togglePictureInPictureaction that exits an active PiP element, otherwise callsrequestPictureInPictureon the standard path, falls back towebkitSetPresentationModefor iOS Safari, and shows an info toast when neither API exists or the video element is not ready; anisPictureInPicturetracked flag kept in sync byenterpictureinpicture,leavepictureinpictureandwebkitpresentationmodechangedlisteners registered throughregisterPictureInPictureListeners/removePictureInPictureListeners. The toggle is called synchronously from the click handler because browsers only allow PiP inside a user gesture.app/modifiers/picture-in-picture-events.js: newember-modifierthat runs a setup callback on insert and a teardown callback on destroy, so the listeners follow the video element's lifecycle.app/components/video-screen.hbs/video-screen.js: fixes the misspelledplaysinlneattribute toplaysinline(iOS Safari forced fullscreen playback without it, so PiP never started) and attaches the new modifier.app/templates/live.hbs: passesisPictureInPictureandisPictureInPictureSupportedfrom the live service intoLivePanel.tests/integration/components/live-panel-test.js, 2 new unit tests in a newtests/unit/controllers/live-test.js, and 8 new unit tests intests/unit/services/live-test.jscovering the standard path, the exit path, both webkit paths, the no-API toast, the not-ready toast, event tracking and platform support detection.No microphone or camera permission is involved; the video element stays muted.
Is Under Feature Flag
Database changes
Breaking changes (If your feature is breaking/missing something please mention pending tickets)
Is Development Tested?
Tested in staging?
Add relevant Screenshot below ( e.g test coverage etc. )
Test run
Automated checks only (no images to attach). Logs from the implementing session under
/tmp/test-results/www-emberjs/.pnpm ember test(log20260823-013836-ember.log, exit 0):All 13 new tests reported
okin that run:pnpm lint(log20260823-013543-lint.log): lint clean,lint:js,lint:hbs,lint:formatandlint:cssall exited 0 (429 files linted by template-lint).No coverage numbers were collected.
Additional Notes
isPictureInPictureSupportedgetter hides the button when neither API exists, and the toast covers a refused request, but the iOS behaviour itself is unverified.playsinlnetypo inapp/components/video-screen.hbs. Whichever of the two lands second needs a trivial rebase on that line.package.jsondeclaresnode >= 25while the local run used Node v22.22.0 with pnpm 11.22.0, which only produced an engine warning; the test and lint runs above completed under that setup.app/services/live.js(the toggle and support detection), thenapp/components/video-screen.hbsand the modifier, then the panel template and tests.