Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Nov 30, 2024
1 parent 95b0d34 commit 10aa4ac
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/loaders/screen-video-texture.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: ScreenVideoTexture
sourcecode: src/core/ScreenVideoTexture.tsx
---

[![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.pmnd.rs/?path=/story/misc-screenvideotexture) ![](https://img.shields.io/badge/-suspense-brightgreen)

<Intro>Create a video texture from `getUserMedia`</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} />
```
26 changes: 26 additions & 0 deletions docs/loaders/webcam-video-texture copy.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: WebcamVideoTexture
sourcecode: src/core/WebcamVideoTexture.tsx
---

[![](https://img.shields.io/badge/-storybook-%23ff69b4)](https://drei.pmnd.rs/?path=/story/misc-webcamvideotexture) ![](https://img.shields.io/badge/-suspense-brightgreen)

<Intro>Create a video texture from `getUserMedia`</Intro>

```tsx
export type WebcamVideoTextureProps = Omit<VideoTextureProps, 'src'> & {
constraints?: MediaStreamConstraints
}
```
```jsx
<WebcamVideoTexture>
{(texture) => <meshBasicMaterial map={texture} />}
```
or exposed via `ref`:
```jsx
const textureRef = useRef()
<WebcamVideoTexture ref={textureRef} />
```

0 comments on commit 10aa4ac

Please sign in to comment.