Web - TypeScript/React
Last updated
{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...."
}npx create-react-app my-app --template typescript import { SyncSdk, PlayerDecorator } from '@sscale/syncsdk';<video width="960" height="540" id='player'></video>const syncInstance = new SyncSDK() syncInstance.createGroup(JWT_ACCESS_TOKEN, clientName)
.then(() => {})
.catch(e => {});class HtmlVideoClient extends PlayerDecorator {
public isSeekable(): boolean;
public play(): void;
public pause(): void;
public mute(): void;
public unmute(): void;
public isPlaying(): boolean;
public getCurrentPosition(): number;
public getPlaybackRate(): number;
public changePlaybackRate(rate: number): void;
public fastSeekToPosition(position: number): void;
public setVolume(volume: number): void;
}const video = document.getElementById('player');
const client = new HtmlVideoClient(video);
syncInstance.addPlayerClient(client);syncInstance.startSynchronize()
.then(() => {})
.catch(e => {});syncInstance.stopSynchronize()