@applicaster/zapp-react-native-utils
Version:
Applicaster Zapp React Native utilities package
25 lines (20 loc) • 644 B
text/typescript
import { isApplePlatform } from "../../reactUtils";
import { NativeModules } from "react-native";
const NativePlayerModule = isApplePlatform()
? NativeModules.PlayerModule
: NativeModules.QuickBrickDefaultPlayerModule;
const PlayerNativeCommandTypes = {
pause: "pause",
clearPlayerData: "clearPlayerData",
removeViewByNativeId: "removeViewByNativeId",
};
const PlayerNativeSendCommand = (
command: string,
playerId: string,
userInfo?: Record<string, any>
) => {
if (playerId && command) {
NativePlayerModule?.command?.(command, playerId, userInfo);
}
};
export { PlayerNativeCommandTypes, PlayerNativeSendCommand };