StaticcreateAttach immersive playback to a player and a scene.
Must be called before the player loads its first source: the integration
hands the player its own video element, and setVideoElement only takes
effect ahead of load.
Resolves once the scene has loaded, so callers never have to work around A-Frame's asynchronous setup themselves.
The scene's active camera is taken once, here. To use another camera, destroy the integration and create a new one. The canvas follows the size of its box, so fullscreen the scene's container directly; nothing needs a manual resize.
A source's poster shows until the first frame: inline, in the player's
own poster layer; in an immersive session, on a panel in the scene.
An existing player, configured by the application.
The <a-scene> to render into.
Any section left out takes its DEFAULT_* value.
The player this integration was attached to.
The video element the player renders into, and the scene textures from.
Whether the surfaces are showing a frame of the current source.
False from a load() until the first frame of what was loaded decodes, and
for as long as nothing arrives — a source whose manifest resolves but whose
segments never do leaves this false indefinitely, with no timeout. An
application drawing its own indicator over the gap wants this and
WebXREvent.FrameStateChanged rather than the video element's own events, which
are the integration's business and may change.
It says nothing about why there is no frame. A load that fails after its manifest parses looks identical from here, so an application that has to stop waiting needs the player's own error events as well.
False after destroy: the surfaces are gone.
Whether the scene is showing the current source's poster: in an immersive session, from the image loading until the first frame. An indicator drawn over the gap can leave the poster undimmed while this is true. False after destroy.
The projection in effect, after clamping: the last one given to
setProjection or to create(), with every field filled in.
A copy. Changing it changes nothing; reshape the surface through setProjection. Cheap enough to read every frame, which is how an indicator of where the video's front lies can follow a reshape without being told.
Where a world-space direction lands in the video, for an effect drawn from the frame the viewer sees — a blurred copy behind a translucent panel, say.
Null while there is no frame to sample: before the first one decodes,
across a load(), before A-Frame has made the surface's texture, and
after destroy, which disposes that texture. A
snapshot, like getProjection: read it again after a reshape or a
stereo switch. Cheap enough to read every frame.
Reshape the projection surface.
Merges onto the current projection, so a field left out keeps its value, each orientation axis included. The result is clamped as getProjection reports it.
The stereo configuration in effect, as a copy.
Switch stereo layout, or return to monoscopic playback.
Merges onto the current configuration rather than the defaults, so
changing the layout does not silently reset the desktop eye, and
{ desktopEye } alone switches the eye the desktop camera renders.
Turn input models on or off, or hand them back to detection with "auto".
Merges onto the current configuration, so switching one model does not reset the rest.
The input configuration in effect, every field filled in. Distinct from
getInputState, which says what "auto" resolved to.
A copy: changing it changes nothing. Reconfigure through setInput.
Which input models are live right now, after resolving "auto".
Detection can change its mind while the page runs — on entering a session, on the first pinch of one, or on a setInput — so an application mirroring this in its own UI should also listen for WebXREvent.InputChanged. A copy.
The view clamp configuration in effect, as a copy.
Turn the view clamp on or off, or change how far inside the arc it stops.
Merges onto the current configuration, so switching it on does not reset an inset that was configured with it.
The orientation smoothing configuration in effect, as a copy.
Turn orientation smoothing on or off, or change its delay.
Merges onto the current configuration, as setViewClamp does.
Ask the browser for access to the device's orientation sensors, so tilting the device looks around ("magic window").
Call this from a click handler, on every platform. WebKit prompts
only from a user gesture, and rejects the call without one on an origin
that has not answered — reported as "needs-gesture", meaning nothing was
asked rather than that the viewer refused. pointerdown does not count as
that gesture (verified on iPadOS 18), so wiring this to a drag raises no
prompt.
An origin already granted resolves without prompting, so calling this on
every load shows the dialog only on the first visit. Chrome (151 and
later) has the same call: under its default sensor setting it answers
"granted" without prompting, and "denied" where the viewer blocked
motion sensors. It plans to make asking the default, after which it needs
the gesture as WebKit does. A browser without the call answers
"unsupported", which needs no handling.
The integration never asks on its own — A-Frame's own attempt, at scene
setup and outside any gesture, is what this replaces. To keep A-Frame's
flow instead, call
scene.setAttribute("device-orientation-permission-ui", "enabled", true)
before create(). The same attribute in the markup does not work: A-Frame
1.8 clears it during startup.
What the platform answered. "granted" also switches A-Frame's
magic-window tracking on, whether the camera has set up yet or not.
The background in effect, as a copy.
Replace what fills the area the projection does not cover. Unlike the
other setters this does not merge: each mode takes its own fields. A
missing or unknown mode keeps the current background.
The caption configuration in effect, after clamping, as a copy.
Reconfigure the caption panel.
Merges onto the current configuration, so moving the panel does not reset
how it is drawn. Which track is on stays the application's decision, made
through player.subtitles — the panel renders whatever cues result.
Point the viewer in a direction now, regardless of where they were looking. Head tracking and drag-to-look take over again immediately. An axis left out keeps where the viewer looks now.
Where the viewer looks now, in degrees, in the convention setViewingDirection takes. Includes a head pose or a device's tilt, not only a drag.
Call handler with the event's payload each time the integration emits
event. Adding the same handler for the same event twice has no effect.
destroy removes every handler added here.
Call handler with the event's payload each time the integration emits
event. Adding the same handler for the same event twice has no effect.
destroy removes every handler added here.
Call handler with the event's payload each time the integration emits
event. Adding the same handler for the same event twice has no effect.
destroy removes every handler added here.
Remove a handler added with on.
Remove a handler added with on.
Remove a handler added with on.
Remove everything the integration added to the scene.
The player is left alone: the application created it and owns its lifetime.
Note that it is still bound to the video element removed here, because
setVideoElement is only defined before a source is loaded and there is no
supported way to hand the player back its original element afterwards. A
player is therefore not reusable across integrations: destroy it alongside
this instance, or keep this instance for as long as the player lives.
Immersive playback of a Bitmovin Player's video inside an A-Frame scene.
Created through BitmovinWebXR.create, which attaches the integration to a player and a scene. The instance owns the entities it adds — the video element, the projection surface, the stereo pair, the sky, the caption panel, the poster panel and pointer input — and the setters below reconfigure them for as long as it lives.
After destroy, the
set…methods, on and requestDeviceOrientation throw. Theget…,has…andis…methods and off do not; getVideoSampling returns null.