feat(playground): add MJPEG live stream for iOS playground#2004
Merged
Conversation
Replace 5-second polling with real-time MJPEG streaming for iOS playground screen preview, providing a much smoother experience similar to Android's scrcpy stream.
Deploying midscene with
|
| Latest commit: |
2f5f56e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6a874161.midscene.pages.dev |
| Branch Preview URL: | https://feat-ios-mjpeg-live-stream.midscene.pages.dev |
- Add wdaMjpegPort option to IOSDeviceOpt (default 9100) - Probe WDA MJPEG server once, cache result to avoid repeated failures - Fall back to polling mode seamlessly when native stream unavailable - Add clear logging to indicate which streaming mode is active
Also configure WDA MJPEG settings (quality, framerate, scaling) during iOS session setup to ensure the MJPEG server is ready when port 9100 is forwarded.
fc4262a to
2f5f56e
Compare
yuyutaotao
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/mjpegendpoint to PlaygroundServer that streams screenshots viamultipart/x-mixed-replace(standard MJPEG protocol), replacing the 5-second polling with real-time screen preview for iOS playground?fps=Nquery parameter (default 10, max 30), with error backoff to handle transient session unavailability during task executionScreenshotViewercomponent with an optionalmjpegUrlprop — when provided, renders a native<img>tag consuming the MJPEG stream and hides polling UI to stay consistent with Android's ScrcpyPlayerTest plan
cd packages/ios && pnpm run playground) and confirm the right panel shows a live screen streamhttp://localhost:5800/mjpegdirectly to verify the raw MJPEG stream works in the browsermjpegUrlpassed)