Skip to main content
The outcome: a clean stream that loads fast on cellular, responds to touch, doesn’t bake the device, and survives the iOS Safari quirks that break naive integrations. Streampixel works on mobile via the device browser — Safari on iOS and Chrome on Android. There is no native mobile SDK; everything is the same Web SDK with a different config profile.

Step 1 — Detect mobile, don’t guess

User-agent sniffing is fragile, but for switching between desktop and phone config it’s good enough:
Use this to feed different values into the SDK — not to gate features. A user on a Pixel Tablet wants the desktop experience; a user on an iPhone Mini wants tighter bitrate caps. Detect, then choose. The SDK does its own detection for touch input, for the start size on phones and tablets, and for the background rule below, so your page needs a test only for the values it picks itself, such as bitrate. An iPad reports a Mac user agent by default, so this test treats it like a desktop.

Step 2 — Mobile-tuned SDK init

What each option buys you:
  • input.touch — translate browser touch events into Pixel Streaming touch input so Unreal sees taps as taps, not as mouse clicks at (0, 0). It follows the project’s dashboard setting (on by default) unless your code sets it.
  • resolution.mobileStart: '480p (854x480)' — phones stream at 480p, which starts fast and uses little data. The size does not grow by itself: adaptive bitrate changes only the bitrate within this picture. In dynamic or crop mode it is the box the stream is fitted into, so a phone held upright gets about 280x480. Pick '720p (1280x720)' if that is too soft, or raise it later with stream.setResolution(), up to the project’s maximum stream quality (pass resolution.max on a project that has none). Tablets use tabletStart.
  • codec.primary: 'H264' — every mobile decoder has H264 silicon. VP9 software-decodes on most phones and burns CPU.
  • bitrate.max — cap the stream so an over-eager adaptive controller doesn’t try to push 12 Mbps over LTE. The value is in kilobits per second. The cap is held for the whole session, reconnects included; it is the lower of your value and the application’s own maximum.
  • No relay option — the SDK takes a direct path when the network allows one and falls back to the TURN relay by itself, so carrier NATs need no setting.
This page uses the script-tag build, which draws only the video: the overlay (“Loading…”, “Tap to start”, “Tap for sound”) and the end message are the page’s own. When the session ends, for example after a minute in the background, the overlay shows the reason, and a tap reloads the page, which starts a new session. With npm, @streampixel/ui draws these screens for you.

Step 3 — Touch UI in Unreal

The browser-side input.touch option delivers touch events to Unreal. Whether your Unreal project does anything useful with them depends on what touch UI is built into the project itself. For projects packaged with on-screen joysticks, on-screen buttons, or other touch HUD, see Hide / unhide touch controls for runtime control of those overlays. Show them on touch devices and hide them on desktop: the SDK tells your app which it is with the isTouchDevice message.

Step 4 — Bandwidth budget

Plan for the network the user actually has, not the network you wish they had: bitrate.max is in kilobits per second. The 4 Mbps cap above is 4_000. A max under 500 (it looks like megabits) or a value above 200,000 (it looks like bits per second) is not applied and logs a console warning. Adaptive bitrate will scale down further on bad networks.
If your user base skews toward mobile data plans with hard caps, default to 2–3 Mbps and let users opt into higher quality from a settings menu. The bandwidth saved over a 30-minute session adds up.

Step 5 — Battery and thermals

A long mobile streaming session is a sustained workload: GPU decode, screen at full brightness, radio active. Phones throttle when they get hot, and a throttled phone produces a worse stream. Things you can do from your application:
  • Set a short idle time. Pass afk: { timeoutSec: 30 } (it can only be shorter than the project’s setting). When the user puts the phone down, 30 seconds without input start a 10-second countdown (the afkWarning event); then the session ends and the worker is freed. A touch on the stream during the countdown cancels it. After the end they start a new session when they pick the phone back up. See Idle viewers and background tabs.
  • Drop FPS targets if your UE project supports it. A console command via stream.consoleCommand('t.MaxFPS 30') halves render work and saves battery on long-form, low-motion content (configurators, tours).
  • Honour prefers-reduced-motion for any spinner / loader animations on your page.
There’s nothing the streaming side can do about a phone’s thermal envelope. Cap session length where appropriate or design for short bursts.

Step 6 — iOS Safari quirks

iOS has the most edge cases. The big ones:

Audio requires a user gesture

iOS will not start playing audio until a tap, click, or other input event. The overlay in the example above asks for that tap once the stream is playing. Without it, the stream connects, video plays muted, and audio never starts.
The SDK keeps the viewer’s sound choice when it reconnects. If the browser then refuses sound without a new tap, the stream plays on muted, and stream.muted turns true a moment after the video starts. That is why the example above looks again a second later, and shows “Tap for sound” again.

Autoplay policies

Even muted autoplay can fail in some Safari configurations, especially with PiP enabled. The Web SDK starts the video muted; when the browser still refuses to play it, the state becomes awaitingPlay, and a tap that calls stream.play() starts it, as in the example above.

Tab background

iOS pauses all media playback when the tab backgrounds. Streampixel disconnects after 60 seconds of background, on phones and tablets, iOS and Android alike; if the user returns sooner, the stream resumes. Beyond 60 seconds the session has ended: a Web SDK page gets the ended event with endKind: 'afk', at the latest the moment the user returns (see Troubleshooting — mobile disconnects). The SDK does not reconnect after an end, so the page starts a new session: reload, or call Streampixel.create() again, as the example above does on a tap. advanced: { flags: { backgroundDisconnect: false } } turns the rule off.

Viewport units

100vh does not behave the same on iOS Safari as it does in desktop browsers — the URL bar takes a slice and 100vh doesn’t account for it. Use 100dvh (dynamic viewport height) for full-screen layouts:

Step 7 — Orientation

Most streamed UE projects are designed for landscape. Lock orientation if your project depends on it:
That hint is non-binding. To force-rotate, listen for the orientation change and show a “Please rotate your device” overlay in portrait:
The Screen Orientation API’s lock() method works on Android Chrome but is not supported on iOS Safari, which is why a visual hint is the portable solution.

Gotchas

Without the viewport meta tag pinning user-scalable=no and CSS touch-action: none on the stream container, browser pinch-zoom and double-tap-to-zoom intercept touches before they reach Unreal. The example above sets both.
Streams launched from a saved-to-home-screen PWA on iOS run in a stripped-down WebView with stricter autoplay, no PiP, and quirky media handling. Test there explicitly if you support that install path.
Scrolling on Android Chrome shrinks/expands the URL bar, which resizes the viewport and can trigger video reflow. Using 100dvh and avoiding scroll on the stream page (overscroll-behavior: none) prevents this.
Some carriers and corporate cellular gateways block UDP entirely, which kills direct WebRTC media. The SDK then relays the stream over TCP or TLS through TURN by itself, at lower quality, and fires the relayFallback event. A network that blocks the relay as well ends the session with code 4100: about 8 seconds after the application’s offer when the network refuses the connection, and after 30 seconds when it drops the packets without an answer.
If your stream UI includes a text input (chat, login), opening the soft keyboard reflows the page and can shift the video. Use position: fixed on the stream container and let the keyboard overlay it instead of resizing.

Next steps

Hide / unhide touch controls

Toggle the UE-side touch HUD from your web page.

Performance tuning

Bitrate and codec recipes for every device class.

Resolution settings

Set per-device opening resolution defaults.

Troubleshooting

Mobile disconnects, audio gating, and other common issues.