### Project Setup and Running Locally Source: https://github.com/100mslive/100ms-docs/blob/main/README.md Steps to clone the 100ms-docs repository, install dependencies using Yarn or npm, and start the local development server. ```shell git clone https://github.com/100mslive/100ms-docs.git yarn yarn dev ``` ```shell git clone https://github.com/100mslive/100ms-docs.git npm install npm run dev ``` -------------------------------- ### Install 100ms React SDK using npm or yarn Source: https://github.com/100mslive/100ms-docs/blob/main/docs/javascript/v2/quickstart/react-quickstart.mdx Installs the latest version of the 100ms React SDK. This is the initial step before integrating the SDK into your React application. ```bash ## npm npm install --save @100mslive/react-sdk@latest ## yarn yarn add @100mslive/react-sdk@latest ``` -------------------------------- ### Install 100ms SDK and ParcelJS using NPM Source: https://github.com/100mslive/100ms-docs/blob/main/docs/javascript/v2/quickstart/javascript-quickstart.mdx Installs the ParcelJS development dependency and the 100ms video store SDK using the NPM package manager. ```bash npm install --save-dev parcel npm install @100mslive/hms-video-store ``` -------------------------------- ### Install 100ms SDK and ParcelJS using Yarn Source: https://github.com/100mslive/100ms-docs/blob/main/docs/javascript/v2/quickstart/javascript-quickstart.mdx Installs the ParcelJS development dependency and the 100ms video store SDK using the Yarn package manager. ```bash yarn add --dev parcel yarn add @100mslive/hms-video-store ``` -------------------------------- ### App Component Setup (React/JSX) Source: https://github.com/100mslive/100ms-docs/blob/main/docs/javascript/v2/quickstart/react-quickstart.mdx This React component, `App`, serves as the main entry point for the application. It imports and renders the `JoinForm` component, allowing users to initiate the process of joining a room. Basic styling is also applied via importing './styles.css'. ```jsx import "./styles.css"; import JoinForm from "./JoinForm"; export default function App() { return (
); } ``` -------------------------------- ### Install Dependencies for 100ms React Native Example App (Bash) Source: https://github.com/100mslive/100ms-docs/blob/main/public/api-reference/react-native/v2/index.html These commands outline the steps to install project dependencies for the 100ms React Native example application. It includes installing root dependencies and then navigating into the example folder to install its specific dependencies. ```bash npm install ``` ```bash cd example npm install ``` -------------------------------- ### Install Pods and Run iOS App Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/quickstart.mdx Installs necessary dependencies for iOS development using CocoaPods and then builds and runs the React Native application on an iPhone simulator. Ensure you are in the 'ios' directory before running 'pod install'. ```bash cd ios && pod install && cd ../ ``` ```bash npx react-native run-ios --simulator="iPhone 14" ``` -------------------------------- ### Install 100ms React Native SDK and Permissions Package Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/quickstart.mdx Installs the necessary 100ms React Native SDK package and the react-native-permissions package to handle camera and microphone permissions. This command uses npm for package management. ```bash npm install --save @100mslive/react-native-hms react-native-permissions ``` -------------------------------- ### Install 100ms React Native SDK Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/expo-quickstart.mdx Installs the 100ms React Native SDK package into the Expo project. This SDK provides the necessary tools for integrating video conferencing features. ```bash npx expo install @100mslive/react-native-hms ``` -------------------------------- ### Complete App.js Example Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/expo-prebuilt.mdx A full example of the App.js file for a React Native application using the 100ms SDK. It includes font loading, permission requests for camera and microphone, and conditionally renders the HMSPrebuilt component or a start button. ```javascript import 'react-native-gesture-handler'; import React, { useEffect, useState } from 'react'; import { StatusBar } from 'expo-status-bar'; import { StyleSheet, Button, View } from 'react-native'; import { HMSPrebuilt } from '@100mslive/react-native-room-kit'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { useFonts } from 'expo-font'; import { requestCameraPermissionsAsync, requestMicrophonePermissionsAsync } from 'expo-camera'; const App = () => { // LOAD REQUIRED FONTS const [fontsLoaded, fontError] = useFonts({ 'Inter-Bold': require("./assets/fonts/Inter-Bold.ttf"), 'Inter-Medium': require("./assets/fonts/Inter-Medium.ttf"), 'Inter-Regular': require("./assets/fonts/Inter-Regular.ttf"), 'Inter-SemiBold': require("./assets/fonts/Inter-SemiBold.ttf"), }); const [showHMSPrebuilt, setShowHMSPrebuilt] = useState(false); // Asking Camera & Microphone permissions from user useEffect(() => { Promise.allSettled([ requestCameraPermissionsAsync(), requestMicrophonePermissionsAsync(), ]) .then((results) => { console.log('Permissions Result: ', results); }) .catch((error) => { console.log('Permissions Error: ', error); }); }, []); // If fonts are not loaded then show nothing if (!fontsLoaded && !fontError) { return null; } // If an error occurred while loading fonts, show it if (!!fontError) { return {fontError.message}: {fontError.message} } // Content return ( {showHMSPrebuilt ? ( setShowHMSPrebuilt(false)} /> ) : (

Join Room

Conference

``` -------------------------------- ### Flutter: Handle Chat Messaging - 100ms SDK Source: https://github.com/100mslive/100ms-docs/blob/main/docs/flutter/v2/quickstart/hls-quickstart.mdx Example of how to handle chat messaging within a Flutter application using the 100ms SDK. This snippet focuses on the integration point for chat features. ```dart // Checkout the docs for chat messaging here: https://www.100ms.live/docs/flutter/v2/how--to-guides/set-up-video-conferencing/chat } @override void onReconnected() { // Checkout the docs for reconnection handling here: https://www.100ms.live/docs/flutter/v2/how--to-guides/handle-interruptions/reconnection-handling } @override void onReconnecting() { // Checkout the docs for reconnection handling here: https://www.100ms.live/docs/flutter/v2/how--to-guides/handle-interruptions/reconnection-handling } @override void onRemovedFromRoom({ required HMSPeerRemovedFromPeer hmsPeerRemovedFromPeer, }) { // Checkout the docs for handling the peer removal here: https://www.100ms.live/docs/flutter/v2/how--to-guides/interact-with-room/peer/remove-peer } @override void onRoleChangeRequest({ required HMSRoleChangeRequest roleChangeRequest, }) { // Checkout the docs for handling the role change request here: https://www.100ms.live/docs/flutter/v2/how--to-guides/interact-with-room/peer/change-role#accept-role-change-request } ``` -------------------------------- ### Install expo-camera Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/expo-prebuilt.mdx Installs the expo-camera library, which is essential for requesting camera and microphone permissions from users in an Expo application. ```bash npx expo install expo-camera -- --legacy-peer-deps ``` -------------------------------- ### Install React Native Room Kit Dependencies Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/expo-prebuilt.mdx Installs all necessary peer dependencies for the 'react-native-room-kit' package, ensuring compatibility and proper linking of native modules. ```bash npx expo install @100mslive/react-native-hms \ @100mslive/types-prebuilt \ @react-native-community/blur \ @react-native-masked-view/masked-view \ @shopify/flash-list \ lottie-react-native \ react-native-gesture-handler \ react-native-linear-gradient \ react-native-modal \ react-native-reanimated \ react-native-safe-area-context \ react-native-simple-toast \ react-native-webview \ -- --legacy-peer-deps ``` -------------------------------- ### Install react-native-reanimated Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/prebuilt.mdx Installs the 'react-native-reanimated' package, which is necessary for implementing animated views within the React Native application. Version 2.x.x or higher is supported. ```bash npm install react-native-reanimated@2.17.0 ``` -------------------------------- ### Join Video Call (Java) Source: https://github.com/100mslive/100ms-docs/blob/main/docs/android/v2/quickstart/quickstart.mdx Shows how to join a video call using the HMSSDK in Java. It includes setting up HMSConfig and implementing the HMSUpdateListener. ```java HMSConfig config = new HMSConfig("user display name", authToken); hmsSdk.join(config, new MyHmsUpdateListener()); class MyHmsUpdateListener implements HMSUpdateListener { @Override public void onJoin(@NonNull HMSRoom hmsRoom) {} @Override public void onMessageReceived(@NonNull HMSMessage hmsMessage) {} @Override public void onPeerUpdate(@NonNull HMSPeerUpdate hmsPeerUpdate, @NonNull HMSPeer hmsPeer) {} @Override public void onReconnected() {} @Override public void onReconnecting(@NonNull HMSException e) {} @Override public void onRoleChangeRequest(@NonNull HMSRoleChangeRequest hmsRoleChangeRequest) {} @Override public void onRoomUpdate(@NonNull HMSRoomUpdate hmsRoomUpdate, @NonNull HMSRoom hmsRoom) {} @Override public void onTrackUpdate(@NonNull HMSTrackUpdate hmsTrackUpdate, @NonNull HMSTrack hmsTrack, @NonNull HMSPeer hmsPeer) {} @Override public void onError(@NonNull HMSException e) {} } ``` -------------------------------- ### Xcode Project Setup: Info.plist Entitlements Source: https://github.com/100mslive/100ms-docs/blob/main/docs/ios/v2/quickstart/quickstart.mdx Adds necessary permissions to the Info.plist file for camera, microphone, and network access, which are crucial for video conferencing functionality. ```xml NSCameraUsageDescription Please allow access to Camera to enable video conferencing. NSMicrophoneUsageDescription Please allow access to Microphone to enable video conferencing. ``` -------------------------------- ### Install expo-build-properties Source: https://github.com/100mslive/100ms-docs/blob/main/docs/react-native/v2/quickstart/expo-prebuilt.mdx Installs the expo-build-properties library, which is used to configure minimum deployment targets for Android and iOS platforms within an Expo project. ```bash npx expo install expo-build-properties -- --save-dev --legacy-peer-deps ``` -------------------------------- ### Initialize and Join Room with HMSSDK in Flutter Source: https://github.com/100mslive/100ms-docs/blob/main/docs/flutter/v2/quickstart/hls-quickstart.mdx This Flutter code initializes the HMSSDK, builds it, adds an update listener, and joins a room using provided authentication token and user name. It follows the standard setup process for the 100ms SDK in a Flutter application. ```dart class HLSViewerPage extends StatefulWidget { final String authToken; final String userName; const HLSViewerPage( {super.key, required this.authToken, required this.userName}); @override State createState() => _HLSViewerPageState(); } class _HLSViewerPageState extends State implements HMSUpdateListener { late HMSSDK _hmsSDK; VideoPlayerController? _controller; late Future _initializeVideoPlayerFuture; @override void initState() { super.initState(); initHMSSDK(); } void initHMSSDK() async { _hmsSDK = HMSSDK(); await _hmsSDK.build(); _hmsSDK.addUpdateListener(listener: this); _hmsSDK.join( config: HMSConfig(authToken: widget.authToken, userName: widget.userName)); } @override void dispose() { _controller?.dispose(); _controller = null; super.dispose(); } @override void onJoin({required HMSRoom room}) { if (room.hmshlsStreamingState?.running ?? false) { if (room.hmshlsStreamingState?.variants[0]?.hlsStreamUrl != null) { _controller = VideoPlayerController.network( ``` -------------------------------- ### Install and Run Vale Linter Source: https://github.com/100mslive/100ms-docs/blob/main/README.md Commands to install Vale using Homebrew, synchronize styles, and run linting on documentation files. Vale is a linter that checks for writing style and grammar. ```bash brew install vale vale sync vale docs/* ```