import * as React from "react"; import {CNode, RoomConsumer, Room, PlayerConsumer, Player, PluginProps, Plugin, PluginInstance} from "white-web-sdk"; import "./index.less"; import {PluginContext} from "./Plugins"; import WhiteAudioPluginRoom from "./room"; import WhiteAudioPluginReplay from "./replay"; export type WhiteAudioPluginAttributes = { play: boolean; seek: number; volume: number, mute: boolean, currentTime: number; seekTime?: number; }; export type WhiteAudioPluginProps = PluginProps; class WhiteAudioPlugin extends React.Component { public constructor(props: WhiteAudioPluginProps) { super(props); } public render(): React.ReactNode { return ( {(room: Room | undefined) => { if (room) { return } else { return null; } }} {(player: Player | undefined) => { if (player) { return ; } else { return null; } }} ); } } export const audioPlugin: Plugin = Object.freeze({ kind: "audio", render: WhiteAudioPlugin, defaultAttributes: { play: false, seek: 0, mute: false, volume: 1, currentTime: 0, }, hitTest: (plugin: PluginInstance): boolean => { const memberState = (plugin as any).component.context.getMemberState(); return !(memberState && memberState.currentApplianceName === "eraser"); }, });