|
@@ -23,10 +23,11 @@ export interface AudioOptions extends UIPluginOptions {
|
|
|
interface AudioState {
|
|
|
audioReady: boolean
|
|
|
recordingLengthSeconds: number
|
|
|
+ recordedAudio: string | null | undefined
|
|
|
hasAudio: boolean
|
|
|
cameraError: null
|
|
|
audioSources: MediaDeviceInfo[]
|
|
|
- currentDeviceId?: null | string | MediaStreamTrack
|
|
|
+ currentDeviceId: string | MediaStreamTrack | null | undefined
|
|
|
isRecording: boolean
|
|
|
showAudioSourceDropdown: boolean
|
|
|
[id: string]: unknown
|
|
@@ -130,7 +131,7 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
|
|
|
.then((stream) => {
|
|
|
this.#stream = stream
|
|
|
|
|
|
- let currentDeviceId = null
|
|
|
+ let currentDeviceId: AudioState['currentDeviceId'] = null
|
|
|
const tracks = stream.getAudioTracks()
|
|
|
|
|
|
if (!options?.deviceId) {
|
|
@@ -368,9 +369,6 @@ export default class Audio<M extends Meta, B extends Body> extends UIPlugin<
|
|
|
<RecordingScreen
|
|
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
|
{...audioState}
|
|
|
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
|
- // @ts-ignore TODO: remove unused
|
|
|
- audioActive={this.#audioActive}
|
|
|
onChangeSource={this.#changeSource}
|
|
|
onStartRecording={this.#startRecording}
|
|
|
onStopRecording={this.#stopRecording}
|