Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
() => {
streamVideo.playing = !streamVideo.playing
},
{ button: ActionButton.POINTER, hoverText: 'Play Stream' }
)
)
engine.addEntity(streamEntity)
const localEntity = new Entity()
localEntity.addComponent(new PlaneShape())
localEntity.addComponent(
new Transform({
position: new Vector3(15, 4.5, 8),
scale: new Vector3(16, 9, 1),
rotation: Quaternion.Euler(0, 270, 0)
})
)
const localVideo = new VideoTexture(new VideoClip('video1.mp4'))
const localMaterial = new BasicMaterial()
localMaterial.texture = localVideo
localEntity.addComponent(localMaterial)
localEntity.addComponent(
new OnPointerDown(
() => {
localVideo.playing = !localVideo.playing
},
{ button: ActionButton.POINTER, hoverText: 'Play/Pause Local Video' }