diff --git a/examples/mobile-client/blur-example/.env.example b/examples/mobile-client/blur-example/.env.example deleted file mode 100644 index 8a2d8c02b..000000000 --- a/examples/mobile-client/blur-example/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -EXPO_PUBLIC_FISHJAM_ID= -EXPO_PUBLIC_FISHJAM_URL= \ No newline at end of file diff --git a/examples/mobile-client/blur-example/.eslintrc.js b/examples/mobile-client/blur-example/.eslintrc.js deleted file mode 100644 index 62156b89c..000000000 --- a/examples/mobile-client/blur-example/.eslintrc.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - extends: ['expo', '../../../.eslintrc.js'], - ignorePatterns: [ - 'dist/*', - 'node_modules/*', - 'coverage/*', - 'build/*', - 'ios/*', - 'android/*', - '.eslintrc.js', - 'prettier.config.js', - 'global.d.ts', - ], - rules: { - 'import/no-unresolved': 'off', - }, -}; diff --git a/examples/mobile-client/blur-example/.gitignore b/examples/mobile-client/blur-example/.gitignore deleted file mode 100644 index ce2ef3cb9..000000000 --- a/examples/mobile-client/blur-example/.gitignore +++ /dev/null @@ -1,39 +0,0 @@ -# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files - -# dependencies -node_modules/ - -# Expo -.expo/ -dist/ -web-build/ - -# Native -*.orig.* -*.jks -*.p8 -*.p12 -*.key -*.mobileprovision - -# Metro -.metro-health-check* - -# debug -npm-debug.* -yarn-debug.* -yarn-error.* - -# macOS -.DS_Store -*.pem - -# local env files -.env*.local - -# typescript -*.tsbuildinfo -android/* -ios/* -.env -.cursor/ \ No newline at end of file diff --git a/examples/mobile-client/blur-example/App.tsx b/examples/mobile-client/blur-example/App.tsx deleted file mode 100644 index 2d244d1aa..000000000 --- a/examples/mobile-client/blur-example/App.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { FishjamProvider } from '@fishjam-cloud/react-native-client'; -import { NavigationContainer } from '@react-navigation/native'; -import * as React from 'react'; -import { SafeAreaProvider } from 'react-native-safe-area-context'; - -import RootNavigation from './navigation/RootNavigation'; - -const App = () => { - return ( - - - - - - - - ); -}; - -export default App; diff --git a/examples/mobile-client/blur-example/README.md b/examples/mobile-client/blur-example/README.md deleted file mode 100644 index 47abfd27d..000000000 --- a/examples/mobile-client/blur-example/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# Background Blur Example - -A mobile video chat demo showcasing **real-time camera background blur** using the [`@fishjam-cloud/react-native-webrtc-background-blur`](https://www.npmjs.com/package/@fishjam-cloud/react-native-webrtc-background-blur) package. Built with [Fishjam Cloud](https://fishjam.io/), [Expo](https://expo.dev/), and [React Native](https://reactnative.dev/). - -## Features - -- **Background blur toggle** — blur your camera background on/off during a video call using a camera track middleware -- Join a video room with a custom room name and user name -- Real-time video grid with local and remote participants -- Automatic camera and microphone permission handling - -## Getting Started - -### Prerequisites - -- [Node.js](https://nodejs.org/) (v18 or newer recommended) -- [Yarn](https://yarnpkg.com/) or [npm](https://www.npmjs.com/) -- [Expo](https://docs.expo.dev/get-started/installation/): You do **not** need to install Expo CLI globally. Use `npx expo` to run Expo commands. - -### Installation - -1. **Clone the repository:** - ```sh - git clone https://github.com/fishjam-cloud/web-client-sdk.git - cd web-client-sdk - ``` -2. **Install dependencies and build project:** - ```sh - yarn - yarn build - ``` -3. **Set up environment variables:** - - - Create a `.env` file in the `examples/mobile-client/blur-example` directory: - ```sh - cp .env.example .env - ``` - - Fill in your Fishjam ID. _You can find the value for this variable by creating an account on [fishjam.io](https://fishjam.io) and copying it from the sandbox dashboard._ - - There also exists this additional environment variable, which is used for internal testing purposes: - - - `EXPO_PUBLIC_FISHJAM_URL` - Sandbox URL for custom Fishjam environment - -4. **Prebuild native files:** - ```sh - cd examples/mobile-client/blur-example - npx expo prebuild --clean - ``` - > [!NOTE] - > Be sure to run `npx expo prebuild` and not `yarn prebuild` as there's an issue with path generation for the `ios/.xcode.env.local` file - -### Running the App - -- **Run on Android:** - ```sh - yarn android - ``` -- **Run on iOS:** - ```sh - yarn ios - ``` - -## Usage - -1. Enter a room name and your user name on the Home screen. -2. Tap **Connect** to join the video room. -3. See yourself and other participants in a responsive video grid. -4. Tap **Enable Blur** to apply background blur to your camera feed, or **Disable Blur** to turn it off. -5. Leaving the room or closing the app will disconnect you from the session. - -## Architecture Overview - -- **React Native + Expo**: Cross-platform mobile app framework. -- **Fishjam Cloud SDK**: Handles all real-time video, audio, and peer management. -- **`@fishjam-cloud/react-native-webrtc-background-blur`**: Provides a `useBackgroundBlur` hook that returns a camera track middleware. The middleware is applied via `setCameraTrackMiddleware` from the Fishjam `useCamera()` hook. -- **TypeScript**: Provides type safety and better developer experience. - -## Troubleshooting & FAQ - -- **App fails to connect to a room:** - - Ensure your `.env` file is present and `EXPO_PUBLIC_FISHJAM_ID` is set correctly. - - Check your network connection. - - Review logs in the Metro/Expo console for errors. -- **Camera or microphone not working:** - - Make sure you have granted the necessary permissions on your device. - -## License - -This example is provided under the Apache License 2.0. See [LICENSE](../../../LICENSE) for details. - ---- - -_This project is maintained by the Fishjam team. For questions or support, visit [fishjam.io](https://fishjam.io/) or open an issue on GitHub._ diff --git a/examples/mobile-client/blur-example/app.json b/examples/mobile-client/blur-example/app.json deleted file mode 100644 index b3935ef28..000000000 --- a/examples/mobile-client/blur-example/app.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "expo": { - "name": "blur-example", - "slug": "blur-example", - "version": "1.0.0", - "orientation": "portrait", - "icon": "./assets/icon.png", - "userInterfaceStyle": "light", - "newArchEnabled": true, - "splash": { - "image": "./assets/splash-icon.png", - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "ios": { - "supportsTablet": true, - "bundleIdentifier": "io.fishjam.mobile.example.blurexample", - "infoPlist": { - "NSCameraUsageDescription": "Allow $(PRODUCT_NAME) to access your camera.", - "NSMicrophoneUsageDescription": "Allow $(PRODUCT_NAME) to access your microphone." - } - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/adaptive-icon.png", - "backgroundColor": "#ffffff" - }, - "edgeToEdgeEnabled": true, - "package": "io.fishjam.mobile.example.blurexample", - "permissions": [ - "android.permission.CAMERA", - "android.permission.RECORD_AUDIO", - "android.permission.MODIFY_AUDIO_SETTINGS", - "android.permission.ACCESS_NETWORK_STATE", - "android.permission.ACCESS_WIFI_STATE" - ] - }, - "web": { - "favicon": "./assets/favicon.png" - }, - "plugins": [["@fishjam-cloud/react-native-client"]] - } -} diff --git a/examples/mobile-client/blur-example/assets/adaptive-icon.png b/examples/mobile-client/blur-example/assets/adaptive-icon.png deleted file mode 100644 index 03d6f6b6c..000000000 Binary files a/examples/mobile-client/blur-example/assets/adaptive-icon.png and /dev/null differ diff --git a/examples/mobile-client/blur-example/assets/favicon.png b/examples/mobile-client/blur-example/assets/favicon.png deleted file mode 100644 index e75f697b1..000000000 Binary files a/examples/mobile-client/blur-example/assets/favicon.png and /dev/null differ diff --git a/examples/mobile-client/blur-example/assets/icon.png b/examples/mobile-client/blur-example/assets/icon.png deleted file mode 100644 index a0b1526fc..000000000 Binary files a/examples/mobile-client/blur-example/assets/icon.png and /dev/null differ diff --git a/examples/mobile-client/blur-example/assets/splash-icon.png b/examples/mobile-client/blur-example/assets/splash-icon.png deleted file mode 100644 index 03d6f6b6c..000000000 Binary files a/examples/mobile-client/blur-example/assets/splash-icon.png and /dev/null differ diff --git a/examples/mobile-client/blur-example/components/VideosGridItem.tsx b/examples/mobile-client/blur-example/components/VideosGridItem.tsx deleted file mode 100644 index 8f84474ee..000000000 --- a/examples/mobile-client/blur-example/components/VideosGridItem.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { RTCView } from "@fishjam-cloud/react-native-client"; -import React from "react"; -import { StyleSheet, Text, View } from "react-native"; - -import type { GridTrack } from "../types"; - -export const VideosGridItem = ({ peer }: { peer: GridTrack }) => { - const mediaStream = peer.track?.stream ? peer.track.stream : null; - - return ( - - - {mediaStream ? ( - - ) : ( - - No video - - )} - - - ); -}; - -const styles = StyleSheet.create({ - container: { - flex: 0.5, - }, - video: { - flex: 1, - aspectRatio: 1, - borderRadius: 8, - overflow: "hidden", - borderColor: "#001A72", - borderWidth: 1, - }, - videoContent: { - flex: 1, - alignItems: "center", - justifyContent: "center", - }, -}); diff --git a/examples/mobile-client/blur-example/hooks/useConnectFishjam.ts b/examples/mobile-client/blur-example/hooks/useConnectFishjam.ts deleted file mode 100644 index 5274f535d..000000000 --- a/examples/mobile-client/blur-example/hooks/useConnectFishjam.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { - useConnection, - useInitializeDevices, - useSandbox, -} from '@fishjam-cloud/react-native-client'; -import type { NavigationProp } from '@react-navigation/native'; -import { useNavigation } from '@react-navigation/native'; -import { useEffect, useState } from 'react'; - -import type { RootStackParamList } from '../navigation/RootNavigation'; - -export const useConnectFishjam = () => { - const navigation = useNavigation>(); - - const { leaveRoom, joinRoom } = useConnection(); - const { getSandboxPeerToken } = useSandbox({ - configOverride: { - sandboxApiUrl: process.env.EXPO_PUBLIC_FISHJAM_URL, - }, - }); - const { initializeDevices } = useInitializeDevices(); - - const [isLoading, setIsLoading] = useState(false); - - const connect = async (roomName: string, userName: string) => { - try { - setIsLoading(true); - - const peerToken = await getSandboxPeerToken(roomName, userName); - - await initializeDevices({ enableVideo: true, enableAudio: true }); - - await joinRoom({ - peerToken, - peerMetadata: { - displayName: userName, - }, - }); - navigation.navigate('Room', { - userName, - }); - } catch (e) { - console.error('Error connecting to Fishjam', e); - } finally { - setIsLoading(false); - } - }; - - useEffect(() => { - return () => { - leaveRoom(); - }; - }, [leaveRoom]); - - return { - connect, - isLoading, - }; -}; diff --git a/examples/mobile-client/blur-example/index.ts b/examples/mobile-client/blur-example/index.ts deleted file mode 100644 index 1d6e981ef..000000000 --- a/examples/mobile-client/blur-example/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { registerRootComponent } from 'expo'; - -import App from './App'; - -// registerRootComponent calls AppRegistry.registerComponent('main', () => App); -// It also ensures that whether you load the app in Expo Go or in a native build, -// the environment is set up appropriately -registerRootComponent(App); diff --git a/examples/mobile-client/blur-example/navigation/RootNavigation.tsx b/examples/mobile-client/blur-example/navigation/RootNavigation.tsx deleted file mode 100644 index 8d46d059e..000000000 --- a/examples/mobile-client/blur-example/navigation/RootNavigation.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import type { NativeStackScreenProps } from '@react-navigation/native-stack'; -import { createNativeStackNavigator } from '@react-navigation/native-stack'; - -import HomeScreen from '../screens/home'; -import RoomScreen from '../screens/room'; - -export type RootStackParamList = { - Home: undefined; - Room: { - userName: string; - }; -}; - -export type RootScreenProps = - NativeStackScreenProps; - -const RootStack = createNativeStackNavigator(); - -const RootNavigation = () => { - return ( - - - - - ); -}; - -export default RootNavigation; diff --git a/examples/mobile-client/blur-example/package.json b/examples/mobile-client/blur-example/package.json deleted file mode 100644 index 3a709661a..000000000 --- a/examples/mobile-client/blur-example/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "blur-example", - "version": "1.0.0", - "main": "index.ts", - "scripts": { - "start": "expo start", - "android": "expo run:android", - "ios": "expo run:ios", - "web": "expo start --web", - "lint": "eslint ." - }, - "dependencies": { - "@fishjam-cloud/react-native-client": "workspace:*", - "@fishjam-cloud/react-native-webrtc-background-blur": "^0.1.2", - "@react-navigation/elements": "^2.5.2", - "@react-navigation/native": "^7.1.14", - "@react-navigation/native-stack": "^7.3.21", - "expo": "~54.0.25", - "expo-status-bar": "~3.0.8", - "react": "19.1.0", - "react-native": "0.81.5", - "react-native-safe-area-context": "~5.6.0", - "react-native-screens": "~4.14.0" - }, - "devDependencies": { - "@babel/core": "^7.28.0", - "@types/react": "~19.1.0", - "eslint-config-expo": "~8.0.1", - "prettier": "^3.6.2", - "typescript": "~5.9.2" - }, - "private": true -} diff --git a/examples/mobile-client/blur-example/prettier.config.js b/examples/mobile-client/blur-example/prettier.config.js deleted file mode 100644 index f05c06ee1..000000000 --- a/examples/mobile-client/blur-example/prettier.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../common/prettier.config'); diff --git a/examples/mobile-client/blur-example/screens/home/index.tsx b/examples/mobile-client/blur-example/screens/home/index.tsx deleted file mode 100644 index f4845de06..000000000 --- a/examples/mobile-client/blur-example/screens/home/index.tsx +++ /dev/null @@ -1,60 +0,0 @@ -import React, { useState } from 'react'; -import { Button, StyleSheet, TextInput } from 'react-native'; -import { SafeAreaView } from 'react-native-safe-area-context'; - -import { useConnectFishjam } from '../../hooks/useConnectFishjam'; -import type { RootScreenProps } from '../../navigation/RootNavigation'; - -export type HomeScreenProps = RootScreenProps<'Home'>; - -const HomeScreen = () => { - const [roomName, setRoomName] = useState(''); - const [userName, setUserName] = useState(''); - const { connect, isLoading } = useConnectFishjam(); - - return ( - - - - - - ); -}; diff --git a/examples/react-client/audio-only/src/MicrophoneSettings.tsx b/examples/react-client/audio-only/src/MicrophoneSettings.tsx deleted file mode 100644 index 6364156c3..000000000 --- a/examples/react-client/audio-only/src/MicrophoneSettings.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { useMicrophone } from "@fishjam-cloud/react-client"; - -export const MicrophoneSettings = () => { - const { - isMicrophoneMuted, - toggleMicrophoneMute, - microphoneDevices, - selectMicrophone, - } = useMicrophone(); - - return ( -
-
- - - -
- - -
- ); -}; diff --git a/examples/react-client/audio-only/src/PeerList.tsx b/examples/react-client/audio-only/src/PeerList.tsx deleted file mode 100644 index 9b4ba40cc..000000000 --- a/examples/react-client/audio-only/src/PeerList.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { usePeers, useVAD } from "@fishjam-cloud/react-client"; -import { AudioPlayer } from "./AudioPlayer"; - -export const PeerList = () => { - const { remotePeers } = usePeers(); - const peersSpeaking = useVAD({ peerIds: remotePeers.map((p) => p.id) }); - - if (!remotePeers.length) { - return

You're alone in the room.

; - } - - return ( -
    - {remotePeers.map((peer) => ( -
    -

    - {`${peer.metadata?.server?.username}`}{" "} - {peersSpeaking[peer.id] && ( - Speaking now - )} -

    - - -
    - ))} -
- ); -}; diff --git a/examples/react-client/audio-only/src/RoomInfo.tsx b/examples/react-client/audio-only/src/RoomInfo.tsx deleted file mode 100644 index b82a95ce7..000000000 --- a/examples/react-client/audio-only/src/RoomInfo.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { useConnection } from "@fishjam-cloud/react-client"; -import { JoinRoomForm, type RoomManagerParams } from "./JoinRoomForm"; -import { useState } from "react"; - -export const RoomInfo = () => { - const [currentParams, setCurrentParams] = useState( - null, - ); - const { leaveRoom, peerStatus } = useConnection(); - - const onDisconnect = () => { - setCurrentParams(null); - leaveRoom(); - }; - - if (peerStatus === "error") { - return

Failed to join the room

; - } - - if (peerStatus === "connecting") { - return

Connecting

; - } - - if (peerStatus === "idle") { - return ; - } - - return ( -
- Connected to "{currentParams?.roomName}" as "{currentParams?.peerName}". - -
- ); -}; diff --git a/examples/react-client/audio-only/src/main.tsx b/examples/react-client/audio-only/src/main.tsx deleted file mode 100644 index 1943102d6..000000000 --- a/examples/react-client/audio-only/src/main.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import { StrictMode } from "react"; -import { createRoot } from "react-dom/client"; -import App from "./App.tsx"; -import { FishjamProvider } from "@fishjam-cloud/react-client"; - -createRoot(document.getElementById("root")!).render( - - - - - , -); diff --git a/examples/react-client/audio-only/src/vite-env.d.ts b/examples/react-client/audio-only/src/vite-env.d.ts deleted file mode 100644 index 11f02fe2a..000000000 --- a/examples/react-client/audio-only/src/vite-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/examples/react-client/audio-only/tsconfig.app.json b/examples/react-client/audio-only/tsconfig.app.json deleted file mode 100644 index 358ca9ba9..000000000 --- a/examples/react-client/audio-only/tsconfig.app.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - "jsx": "react-jsx", - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true - }, - "include": ["src"] -} diff --git a/examples/react-client/audio-only/tsconfig.json b/examples/react-client/audio-only/tsconfig.json deleted file mode 100644 index 1ffef600d..000000000 --- a/examples/react-client/audio-only/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "files": [], - "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } - ] -} diff --git a/examples/react-client/audio-only/tsconfig.node.json b/examples/react-client/audio-only/tsconfig.node.json deleted file mode 100644 index db0becc8b..000000000 --- a/examples/react-client/audio-only/tsconfig.node.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", - "target": "ES2022", - "lib": ["ES2023"], - "module": "ESNext", - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "isolatedModules": true, - "moduleDetection": "force", - "noEmit": true, - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "noUncheckedSideEffectImports": true - }, - "include": ["vite.config.ts"] -} diff --git a/examples/react-client/audio-only/vite.config.ts b/examples/react-client/audio-only/vite.config.ts deleted file mode 100644 index 0e43ae8de..000000000 --- a/examples/react-client/audio-only/vite.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { defineConfig } from "vite"; -import react from "@vitejs/plugin-react"; - -// https://vite.dev/config/ -export default defineConfig({ - plugins: [react()], -}); diff --git a/examples/react-client/fishjam-chat/.eslintignore b/examples/react-client/fishjam-chat/.eslintignore deleted file mode 100644 index f06235c46..000000000 --- a/examples/react-client/fishjam-chat/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -dist diff --git a/examples/react-client/fishjam-chat/.eslintrc.cjs b/examples/react-client/fishjam-chat/.eslintrc.cjs deleted file mode 100644 index b765fa44b..000000000 --- a/examples/react-client/fishjam-chat/.eslintrc.cjs +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - env: { browser: true, es2020: true }, - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:react-hooks/recommended", - ], - ignorePatterns: ["dist", ".eslintrc.cjs"], - parser: "@typescript-eslint/parser", - plugins: ["react-refresh"], - rules: { - "react-refresh/only-export-components": [ - "error", - { allowConstantExport: true }, - ], - }, -}; diff --git a/examples/react-client/fishjam-chat/.gitignore b/examples/react-client/fishjam-chat/.gitignore deleted file mode 100644 index a547bf36d..000000000 --- a/examples/react-client/fishjam-chat/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/examples/react-client/fishjam-chat/.prettierrc b/examples/react-client/fishjam-chat/.prettierrc deleted file mode 100644 index 5120230c2..000000000 --- a/examples/react-client/fishjam-chat/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "printWidth": 80, - "plugins": ["prettier-plugin-tailwindcss"] -} diff --git a/examples/react-client/fishjam-chat/README.md b/examples/react-client/fishjam-chat/README.md deleted file mode 100644 index 79270cf18..000000000 --- a/examples/react-client/fishjam-chat/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Fishjam Chat - -This is an example app demonstrating how to build a simple conferencing react app using Fishjam. - -Install dependencies with `yarn`, run with `yarn dev`. diff --git a/examples/react-client/fishjam-chat/components.json b/examples/react-client/fishjam-chat/components.json deleted file mode 100644 index 16aa538d5..000000000 --- a/examples/react-client/fishjam-chat/components.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.cjs", - "css": "src/index.css", - "baseColor": "stone", - "cssVariables": false, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - } -} diff --git a/examples/react-client/fishjam-chat/index.html b/examples/react-client/fishjam-chat/index.html deleted file mode 100644 index b03a90b65..000000000 --- a/examples/react-client/fishjam-chat/index.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - FishjamChat - - - - - -
- - - diff --git a/examples/react-client/fishjam-chat/package.json b/examples/react-client/fishjam-chat/package.json deleted file mode 100644 index 0e45f5427..000000000 --- a/examples/react-client/fishjam-chat/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "@fishjam-example/fishjam-chat", - "private": true, - "version": "0.10.2", - "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc -b && vite build", - "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix", - "lint:check": "eslint . --ext .ts,.tsx", - "format": "prettier --write . --ignore-path ./.eslintignore", - "format:check": "prettier --check . --ignore-path ./.eslintignore", - "preview": "vite preview" - }, - "dependencies": { - "@fishjam-cloud/react-client": "workspace:*", - "@mediapipe/tasks-vision": "^0.10.21", - "@radix-ui/react-accordion": "^1.2.3", - "@radix-ui/react-aspect-ratio": "^1.1.1", - "@radix-ui/react-dialog": "^1.1.5", - "@radix-ui/react-icons": "^1.3.2", - "@radix-ui/react-label": "^2.1.2", - "@radix-ui/react-select": "^2.1.6", - "@radix-ui/react-separator": "^1.1.2", - "@radix-ui/react-slot": "^1.1.1", - "@radix-ui/react-switch": "^1.1.3", - "axios": "^1.8.4", - "class-variance-authority": "^0.7.0", - "clsx": "^2.1.1", - "lucide-react": "^0.482.0", - "next-themes": "^0.4.6", - "react": "19.1.0", - "react-dom": "19.1.0", - "react-hook-form": "^7.55.0", - "sonner": "^2.0.1", - "tailwind-merge": "^2.5.5", - "tailwindcss-animate": "^1.0.7" - }, - "devDependencies": { - "@types/node": "^22.14.0", - "@types/react": "19.1.0", - "@types/react-dom": "19.1.0", - "@vitejs/plugin-react-swc": "^3.8.1", - "autoprefixer": "^10.4.21", - "eslint": "^8.57.1", - "postcss": "^8.5.3", - "prettier": "^3.5.3", - "tailwindcss": "^3.4.17", - "typescript": "^5.8.3", - "vite": "^6.2.6" - }, - "lint-staged": { - "*": [ - "yarn format" - ], - "*.(js|ts|tsx)": [ - "yarn lint" - ] - } -} diff --git a/examples/react-client/fishjam-chat/postcss.config.cjs b/examples/react-client/fishjam-chat/postcss.config.cjs deleted file mode 100644 index 12a703d90..000000000 --- a/examples/react-client/fishjam-chat/postcss.config.cjs +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -}; diff --git a/examples/react-client/fishjam-chat/public/shaders/blur/fragment.glsl b/examples/react-client/fishjam-chat/public/shaders/blur/fragment.glsl deleted file mode 100644 index 3bfed2699..000000000 --- a/examples/react-client/fishjam-chat/public/shaders/blur/fragment.glsl +++ /dev/null @@ -1,53 +0,0 @@ -precision mediump float; -varying vec2 v_pos; - -uniform sampler2D texture; -uniform sampler2D resizedTexture; -uniform sampler2D confidenceTexture; -uniform vec2 u_size; - -const float gamma=1.8; - -const int CONV_SIDE=5; -const float BLUR_RADIUS=float(CONV_SIDE); - -vec4 blur(sampler2D texture, sampler2D confidence, vec2 size, vec2 un) { - float n = 0.0; - vec3 res = vec3(0); - vec2 delta = 1.0 /size; - vec2 confidence_delta = 1.0 / size * 2.; - - for(int x = -CONV_SIDE; x <= CONV_SIDE; x++){ - for(int y = -CONV_SIDE; y <= CONV_SIDE; y++){ - vec2 u_ = un + delta * vec2(x,y); - vec2 cu_=un + confidence_delta * vec2(x,y); - float c = 1.0 - texture2D(confidence, cu_).x; - - if (distance(u_, un) <= BLUR_RADIUS) { - res += texture2D(texture, u_).rgb * c; - n += c; - } - } - } - - if (n > 1.0) { - res /= n; - } - - return vec4(res, 1.0); -} - -void main() { - vec4 blurredValue = blur(resizedTexture, confidenceTexture, vec2(1280, 720) / 4., v_pos); - vec4 sharpValue = texture2D(texture, v_pos); - - vec4 filtered_confidence = smoothstep(0.1, 0.8, texture2D(confidenceTexture, v_pos)); - - if (filtered_confidence.x < 0.5) { - gl_FragColor = blurredValue; - } else { - gl_FragColor = mix(blurredValue, sharpValue, filtered_confidence.x); - } -} - - diff --git a/examples/react-client/fishjam-chat/public/shaders/blur/vertex.glsl b/examples/react-client/fishjam-chat/public/shaders/blur/vertex.glsl deleted file mode 100644 index 7b68eaf0b..000000000 --- a/examples/react-client/fishjam-chat/public/shaders/blur/vertex.glsl +++ /dev/null @@ -1,7 +0,0 @@ -attribute vec4 a_Position; -varying vec2 v_pos; - -void main() { - gl_Position = a_Position; - v_pos = (a_Position.xy + 1.0) / 2.0; -} \ No newline at end of file diff --git a/examples/react-client/fishjam-chat/src/App.tsx b/examples/react-client/fishjam-chat/src/App.tsx deleted file mode 100644 index 5da4c099d..000000000 --- a/examples/react-client/fishjam-chat/src/App.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import { FishjamProvider } from "@fishjam-cloud/react-client"; -import { useState } from "react"; - -import { BlurProvider } from "./components/BlurToggle"; -import { DEFAULT_FISHJAM_ID } from "./lib/consts"; -import Router from "./Router"; - -function App() { - const [fishjamId, setFishjamId] = useState(DEFAULT_FISHJAM_ID); - - return ( - - - - - - ); -} - -export default App; diff --git a/examples/react-client/fishjam-chat/src/Router.tsx b/examples/react-client/fishjam-chat/src/Router.tsx deleted file mode 100644 index 560096f91..000000000 --- a/examples/react-client/fishjam-chat/src/Router.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { useConnection } from "@fishjam-cloud/react-client"; - -import { JoinRoomCard } from "./components/JoinRoomCard"; -import { RoomView } from "./components/RoomView"; - -type Props = { - onFishjamIdChange: (fishjamId: string) => void; -}; - -function Router({ onFishjamIdChange }: Props) { - const { peerStatus } = useConnection(); - const isConnected = peerStatus === "connected"; - - return ( -
- {isConnected ? ( - - ) : ( - - )} -
- ); -} - -export default Router; diff --git a/examples/react-client/fishjam-chat/src/components/AudioPlayer.tsx b/examples/react-client/fishjam-chat/src/components/AudioPlayer.tsx deleted file mode 100644 index 868c42869..000000000 --- a/examples/react-client/fishjam-chat/src/components/AudioPlayer.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import type { FC } from "react"; -import { useEffect, useRef } from "react"; - -interface AudioPlayerProps { - stream?: MediaStream | null; -} - -const AudioPlayer: FC = ({ stream }) => { - const audioRef = useRef(null); - - useEffect(() => { - if (!audioRef.current) return; - audioRef.current.srcObject = stream ?? null; - }, [stream]); - - return