@api.stream/studio-kit
Version:
Client SDK for building studio experiences with API.stream
36 lines (35 loc) • 1.14 kB
TypeScript
import { SDK } from '../core/namespaces';
/**
* Begin device helpers
*/
type DeviceCallback = (devices: SDK.Devices) => void;
/** Replace tracks on an existing MediaStream. */
export declare const updateMediaStreamTracks: (srcObject: MediaStream, tracks: {
audio?: MediaStreamTrack;
video?: MediaStreamTrack;
}) => void;
/**
* Determine which permissions a user has already agreed to in their browser.
*/
export declare const getDevicePermissions: () => Promise<{
audio: boolean;
video: boolean;
}>;
/**
* Request device permissions, or resolve immediately if they are already available.
*/
export declare const ensureDevicePermissions: () => Promise<{
audio: boolean;
video: boolean;
}>;
/**
Accepts a callback which receives a formatted list of devices anytime
device availability changes.
*/
export declare const watchDevices: (cb: DeviceCallback) => () => void;
/**
* Invoke `navigator.mediaDevices.getUserMedia()` with the args provided.
* Devices are be reported to existing device watchers to ensure equality.
*/
export declare const getUserMedia: MediaDevices['getUserMedia'];
export {};