Skip to content

Commit

Permalink
docs: rearrange component docs headings
Browse files Browse the repository at this point in the history
  • Loading branch information
OrbisK committed Dec 2, 2024
1 parent 89a844b commit 4ed3022
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
workflow_dispatch:

jobs:
# Build job
test:
runs-on: ubuntu-latest
steps:
Expand Down
61 changes: 31 additions & 30 deletions docs/components.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
---
outline: deep
---
# Components

# API
## `<UseMediaRecorder />`

## Props
### Props

### `constraints`
#### `constraints`

- Type: `MediaStreamConstraints`
- Required: `true`

The constraints parameter is a MediaStreamConstraints object specifying the types of media to request, along with any
requirements for each type.

### `mediaRecorderOptions`
#### `mediaRecorderOptions`

- Type: `MediaRecorderOptions`
- Default: `{}`

Options to pass to the MediaRecorder constructor. [See MDN](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder#options)

## Events
### Events

```ts
defineEmits<{
Expand All @@ -35,48 +36,48 @@ defineEmits<{

Analog to the MediaRecorder events (`onstart`, `onpause`,...).

### `@start`
#### `@start`

Emitted when the MediaRecorder starts recording.

### `@pause`
#### `@pause`

Emitted when the MediaRecorder pauses recording.

### `@resume`
#### `@resume`

Emitted when the MediaRecorder resumes recording.

### `@stop`
#### `@stop`

Emitted when the MediaRecorder stops recording.

### `@error`
#### `@error`

Emitted when an error occurs.

## Slots
### Slots

### `default`
#### `default`

The default slot is used to render the component's content.

#### slopProps
##### slopProps

##### `data`
###### `data`

- Type: `Ref<Blob[]>`
- Initial value: `ref([])`

An array of Blobs that are created by the MediaRecorder. The Blobs are created when the MediaRecorder is stopped. Or
when the timeslice is set and the timeslice is reached.

##### `stream`
###### `stream`

- Type: `ShallowRef<MediaStream | undefined>`
- Initial value: `shallowRef()`

##### `state`
###### `state`

- Type: `ShallowRef<MediaRecorderState | undefined>`
- Initial value: `shallowRef()`
Expand All @@ -88,7 +89,7 @@ The current state of the MediaRecorder. The state can be one of the following:
- `'recording'` - The MediaRecorder is recording data.
- `'paused'` - The MediaRecorder is paused.

##### `mimeType`
###### `mimeType`

- Type: `ComputedRef<string | undefined>`
- Initial value: `computed(()=>{})`
Expand All @@ -102,72 +103,72 @@ check if the mimeType
is supported via [`isMimeTypeSupported`](#ismimetypesupported).
:::

##### `isMimeTypeSupported`
###### `isMimeTypeSupported`

- Type: `ComputedRef<boolean>`

If you set the mimeType manually, you can check if the mimeType is supported by the browser via this computed ref.

##### `isSupported`
###### `isSupported`

- Type: `ComputedRef<boolean>`

If the MediaRecorder API (and the selected MIME type) is supported by the browser.

##### `mediaRecorder`
###### `mediaRecorder`

- Type: `ComputedRef<MediaRecorder | undefined>`
- Initial value: `computed(()=>{})`

The MediaRecorder instance. The MediaRecorder is created when the stream is available.

##### `start`
###### `start`

- Type: `(timeslice: number | undefined) => Promise<void>`
- MDN: [MediaRecorder.start()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/start)

Creates the stream and the MediaRecorder instance. The stream is created with the constraints object. The MediaRecorder
is created with the stream and the mediaRecorderOptions object.

##### `pause`
###### `pause`

- Type: `() => void`
- MDN: [MediaRecorder.pause()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/pause)

##### `resume`
###### `resume`

- Type: `() => void`
- MDN: [MediaRecorder.resume()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/resume)

##### `stop`
###### `stop`

- Type: `() => void`
- MDN: [MediaRecorder.stop()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/stop)

## Methods
### Methods

`UseMediaRecorder` does expose the following methods:

### `start(timeslice: number | undefined): Promise<void>`
#### `start(timeslice: number | undefined): Promise<void>`

- MDN: [MediaRecorder.start()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/start)

Creates the stream and the MediaRecorder instance. The stream is created with the constraints object. The MediaRecorder
is created with the stream and the mediaRecorderOptions object.

### `pause(): void`
#### `pause(): void`

- MDN: [MediaRecorder.pause()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/pause)

### `resume(): void`
#### `resume(): void`

- MDN: [MediaRecorder.resume()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/resume)

### `stop(): void`
#### `stop(): void`

- MDN: [MediaRecorder.stop()](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/stop)

### Usage
#### Usage

```vue
<script setup>
Expand Down

0 comments on commit 4ed3022

Please sign in to comment.