import React, { ReactNode } from 'react'; export interface VideoStreamProps { videoConstraints: MediaTrackConstraints; preferredCamera?: string; onReady: () => void; onStreamChanged: (stream: MediaStream) => void; onError: (err: Error) => void; children: ReactNode; } export interface VideoStreamState { orientation: string | number; stream?: MediaStream; } export default class VideoStream extends React.Component { constructor(props: VideoStreamProps); orientationChanged(e: Event): void; setDeviceIdInConstraints(constraints: MediaTrackConstraints): Promise; private readonly orientationchangeCallback; componentDidMount(): Promise; refreshStream(): Promise; stopCurrentStreams(): void; componentWillUnmount(): void; /** * Base class that does not specifically require a render function. * But needs to be implemented to satisfy later versions of React.Component interface. * Ideally would refactor this into ScanbotCameraView, * but it still effectively separates base video player functionality from the UI. */ render(): React.ReactNode; updateTorch(enabled: boolean): Promise; getCapabilities(): MediaTrackCapabilities | undefined; static getMediaTrackCapabilities(track: MediaStreamTrack): MediaTrackCapabilities | undefined; getVideoTrack(): MediaStreamTrack | undefined; }