Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The XRMediaBinding()
constructor creates and returns a new XRMediaBinding
object.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The XRMediaBinding()
constructor creates and returns a new XRMediaBinding
object.
js
new XRMediaBinding(session)
A newly-created XRMediaBinding
.
InvalidStateError
DOMException
Thrown if the new XRMediaBinding
could not be created due to one of a number of possible state errors:
XRSession
specified by session
has already been stopped.session
is not immersive.XRMediaBinding
The following example creates a new media binding for a session to create an XRQuadLayer
to display a video layer in the scene.
js
const xrMediaBinding = new XRMediaBinding(xrSession);
const video = document.createElement("video");
video.src = "just-fascination.mp4";
const layer = xrMediaBinding.createQuadLayer(video);
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
XRMediaBinding |
No | No | No | No | No | No | No | No | No | No | No | No |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRMediaBinding/XRMediaBinding