glodrei
Version:
useful add-ons for react-three-fiber
26 lines (20 loc) • 706 B
text/mdx
title: ScreenVideoTexture
sourcecode: src/web/ScreenVideoTexture.tsx
[](https://drei.pmnd.rs/?path=/story/misc-screenvideotexture) 
<Intro>Create a video texture from [`getDisplayMedia`](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia)</Intro>
```tsx
export type ScreenVideoTextureProps = Omit<VideoTextureProps, 'src'> & {
options?: DisplayMediaStreamOptions
}
```
```jsx
<ScreenVideoTexture>
{(texture) => <meshBasicMaterial map={texture} />}
```
or exposed via `ref`:
```jsx
const textureRef = useRef()
<ScreenVideoTexture ref={textureRef} />
```