@teyuto/react-native-player
Version:
React Native teyuto player
61 lines (60 loc) • 1.86 kB
TypeScript
import { Component } from 'react';
import { StyleProp, ViewStyle } from 'react-native';
import { WebView } from 'react-native-webview';
export declare type PlayerProps = {
id: string;
autoplay?: string;
muted?: string;
controls?: string;
playbackRates?: string;
qualitySelector?: string;
seekButtons?: string;
playerColor?: string;
loop?: string;
captions?: string;
lowLatency?: string;
style?: StyleProp<ViewStyle>;
token?: string;
onControlsDisabled?: () => void;
onControlsEnabled?: () => void;
onEnded?: () => void;
onError?: () => void;
onFirstPlay?: () => void;
onFullScreenChange?: () => void;
onPause?: () => void;
onPlay?: () => void;
onPlayerResize?: () => void;
onQualityChange?: (resolution: {
height: number;
width: number;
}) => void;
onRateChange?: () => void;
onReady?: () => void;
onResize?: () => void;
onSeeking?: () => void;
onTimeUpdate?: (currentTime: number) => void;
onUserActive?: () => void;
onUserInactive?: () => void;
onVolumeChange?: (volume: number) => void;
};
export default class TeyutoPlayerSdk extends Component<PlayerProps, {}> {
webref?: WebView;
playerUrl: string;
token: string;
play(): void;
pause(): void;
requestFullscreen(): void;
mute(): void;
unmute(): void;
seek(time: number): void;
setCurrentTime(time: number): void;
setLoop(loop: boolean): void;
setPlaybackRate(rate: number): void;
setVolume(volume: number): void;
constructor(props: PlayerProps);
private onMessage;
buildQueryParameters(originalProps: any): string;
buildEmbedUrl(props: PlayerProps): string;
buildToken(props: PlayerProps): string;
render(): JSX.Element;
}