Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
New update from dolbyio-samples/comms-react-examples main
Browse files Browse the repository at this point in the history
  • Loading branch information
dolbyio-gh-bot committed Jul 12, 2023
1 parent 68d116e commit 679efd3
Show file tree
Hide file tree
Showing 28 changed files with 240 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dist-ssr

.env
# Local Netlify folder
.netlify
.netlify
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# comms-app-react-videocall

## 1.10.2

### Patch Changes

- 5cb17c87: Enable Live recording so that we can record conferences
- Updated dependencies [5ac6e7a2]
- Updated dependencies [5cb17c87]
- Updated dependencies [bb70d96d]
- @dolbyio/comms-uikit-react@1.2.0

## 1.10.1

### Patch Changes

- 5cb17c87: Enable Live recording so that we can record conferences
- Updated dependencies [5cb17c87]
- @dolbyio/comms-uikit-react@1.1.1

## 1.10.0

### Minor Changes

- 6ed11ae1: Add 15 minutes limit
- 9616f186: Upgraded Voxeet-Web-SDK to 3.10 and enabled RTMP by default for video call app
- 04c6893d: Videocall is not template-set for deploying on netlify
- 83882344: Updated SDK to 3.10.0 and Added multi-screen-share support for 2 hosts

### Patch Changes

- 05503b00: Changed RTMP endpoints
- 029f01c2: Add in tooltips
- 253ec2f9: Added a brand new exit screen
- 52268866: Add in component name tracking
- 6431b247: Fix layut for multi-screen share
- Updated dependencies [05503b00]
- Updated dependencies [e04db747]
- Updated dependencies [ec90eec7]
- Updated dependencies [27237560]
- Updated dependencies [c5338020]
- Updated dependencies [27c15032]
- Updated dependencies [9616f186]
- Updated dependencies [11775255]
- Updated dependencies [f2f3a860]
- Updated dependencies [b424d0c3]
- Updated dependencies [83882344]
- Updated dependencies [4a39e616]
- Updated dependencies [f4afd837]
- Updated dependencies [6431b247]
- Updated dependencies [a51111c4]
- Updated dependencies [1c3cb640]
- Updated dependencies [c422c01f]
- Updated dependencies [238185f6]
- Updated dependencies [00a51d4d]
- @dolbyio/comms-uikit-react@1.1.0

## 1.9.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/pubnub": "^7.2.1",
"concurrently": "^7.6.0",
"nodemon": "^2.0.20",
"typescript": "4.9.5",
"typescript": "^5.1.5",
"wait-on": "^6.0.1"
}
}
Binary file added documentation/Events-built.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/app_keys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/apps-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/assets/Dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/assets/app_keys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/assets/apps-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/assets/banner.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/assets/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/assets/dashboard-events.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/assets/open-beta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/banner.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/client_access_token.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/create-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/dashboard-events.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions documentation/open-beta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
{
"name": "comms-app-react-videocall",
"version": "1.9.2",
"version": "1.10.2",
"private": true,
"scripts": {
"dev": "yarn netlify dev --offline",
"dev-proxy": "concurrently --kill-others \"cd ../backend && yarn dev\" \"yarn dev\"",
"build": "cross-env ENV=web && vite build"
"dev:deprecated": "cross-env ENV=web && vite",
"dev-proxy": "concurrently --kill-others \"cd ../api-proxy && yarn dev\" \"yarn dev\"",
"dev-proxy-host": "concurrently --kill-others \"cd api && yarn dev\" \"yarn dev --host --https\"",
"build": "cross-env ENV=web && vite build",
"preview": "cross-env ENV=web && vite preview",
"license-checker": "license-checker --json --out third-party-licenses.json --relativeLicensePath"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/dolbyio-samples/comms-app-react-videocall"
},
"dependencies": {
"@dolbyio/comms-uikit-react": "<2.0.0",
"@dolbyio/comms-uikit-react": "1.2.0",
"@emotion/react": "^11.9.0",
"@voxeet/voxeet-web-sdk": "^3.10.0",
"axios": "^0.26.1",
Expand All @@ -35,7 +39,7 @@
"@types/color": "3.0.3",
"@types/react": "^18.0.6",
"@types/react-dom": "^18.0.6",
"@vitejs/plugin-react": "^1.0.7",
"@vitejs/plugin-react": "^4.0.0",
"concurrently": "^7.6.0",
"cross-env": "^7.0.3",
"license-checker": "^25.0.1",
Expand All @@ -44,4 +48,4 @@
"workspaces": [
"backend"
]
}
}
12 changes: 10 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ import React, { useEffect } from 'react';
import { createRoot } from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';

import styles from './App.module.scss';
import PhoneLandscapeCurtain from './components/PhoneLandscapeCurtain';
import TranslationProvider from './components/TranslationProvider';
import './App.module.scss';
import { ConferenceCreateProvider } from './context/ConferenceCreateContext';
import useToken from './hooks/useToken';
import { Navigator } from './routes/Navigator';

const App = () => {
const { YOUR_TOKEN, getToken, error } = useToken();

// Register the component name so that we can estimate the app's usage
useEffect(() => {
VoxeetSDK.registerComponentVersion(import.meta.env.VITE_APP_NAME, import.meta.env.VITE_APP_VERSION);
}, []);

const { YOUR_TOKEN, getToken } = useToken();
if (error) {
return (
<ThemeProvider>
<div className={styles.fallbackContainer}>Error : {error}</div>;
</ThemeProvider>
);
}

if (!YOUR_TOKEN) {
return null;
Expand Down
34 changes: 20 additions & 14 deletions src/hooks/useToken.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
import getProxyUrl from '@src/utils/getProxyUrl';
import { useMemo, useState, useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import { useState, useEffect, useCallback } from 'react';

import fetch from '../utils/fetch';

const useToken = () => {
const location = useLocation();
const [error, setError] = useState<string | undefined>();

const accessToken = useMemo(() => {
return encodeURIComponent(
new URLSearchParams(window.location.search).get('token') || import.meta.env.VITE_CLIENT_ACCESS_TOKEN || '',
);
}, [location]);
const accessToken = import.meta.env.VITE_CLIENT_ACCESS_TOKEN || '';

const [YOUR_TOKEN, setToken] = useState<string | null>(null);

const getToken = async () => {
const getToken = useCallback(async () => {
if (accessToken && accessToken.length) {
return accessToken;
}
const res = await fetch(`${getProxyUrl()}/client-access-token`, { method: 'GET' });
return res.data.access_token;
};
try {
const res = await fetch(`${getProxyUrl()}/client-access-token`);

if (!res.data.access_token) {
setError(`Invalid Dolby.io token, please refer to Readme to set it correctly`);
} else {
setError(undefined);
}
return res.data.access_token;
} catch (e) {
setError(`Invalid Dolby.io token, please refer to Readme to set it correctly`);
return null;
}
}, [accessToken]);

useEffect(() => {
(async () => {
setToken(await getToken());
})();
}, []);
}, [getToken]);

return { YOUR_TOKEN, getToken };
return { YOUR_TOKEN, getToken, error };
};

export default useToken;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
import ToggleMicrophoneButton from '@src/routes/ConferenceCreate/DeviceSetup/ToggleMicrophoneButton';
import ToggleVideoButton from '@src/routes/ConferenceCreate/DeviceSetup/ToggleVideoButton';
import { splitMeetingAlias } from '@src/utils/misc';

import React, { useMemo } from 'react';

import styles from './MobileContent.module.scss';
Expand Down
3 changes: 2 additions & 1 deletion src/utils/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ const defaults = {
VITE_RTMP_STREAMING: 'true',
VITE_MUSIC_MODE: 'true',
VITE_BLUR_OPTION: 'true',
VITE_CONFERENCE_RECORDING: 'false',
VITE_CONFERENCE_RECORDING: 'true',
VITE_VIDEO_FORWARDING_OPTION: 'true',
} satisfies Record<string, string | undefined>;
// The type above allows us to define the value type while still being strongly typed
// For example, the type for defaults.VITE_ENABLE_UNGATED_FEATURES is undefined rather
Expand Down
Loading

0 comments on commit 679efd3

Please sign in to comment.