Move the active-speaker demo from daily-js folder to custom folder

This commit is contained in:
harshithpabbati 2022-01-05 00:27:33 +05:30
parent 76d8319e6b
commit d26a42ab3d
24 changed files with 28 additions and 28 deletions

View File

@ -1,10 +1,8 @@
# Active Speaker # Active Speaker
![Active speaker](./image.png)
### Live example ### Live example
**[See it in action here ➡️](https://dailyjs-active-speaker.vercel.app)** **[See it in action here ➡️](https://custom-active-speaker.vercel.app)**
--- ---
@ -23,7 +21,7 @@ Please note: this demo is not currently mobile optimised
mv env.example .env.local mv env.example .env.local
yarn yarn
yarn workspace @dailyjs/active-speaker dev yarn workspace @custom/active-speaker dev
``` ```
## Deploy your own on Vercel ## Deploy your own on Vercel

View File

@ -1,13 +1,13 @@
import React from 'react'; import React from 'react';
import App from '@dailyjs/basic-call/components/App'; import App from '@custom/basic-call/components/App';
import { Room } from '../Room'; import { Room } from '../Room';
// Extend our basic call app component with our custom Room componenet // Extend our basic call app component with our custom Room componenet
export const AppWithSpeakerViewRoom = () => ( export const AppWithSpeakerViewRoom = () => (
<App <App
customComponentForState={{ customComponentForState={{
room: () => <Room />, room: <Room />,
}} }}
/> />
); );

View File

@ -1,7 +1,7 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Tile } from '@dailyjs/shared/components/Tile'; import Tile from '@custom/shared/components/Tile';
import { DEFAULT_ASPECT_RATIO } from '@dailyjs/shared/constants'; import { DEFAULT_ASPECT_RATIO } from '@custom/shared/constants';
import { useResize } from '@dailyjs/shared/hooks/useResize'; import { useResize } from '@custom/shared/hooks/useResize';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
const MAX_RATIO = DEFAULT_ASPECT_RATIO; const MAX_RATIO = DEFAULT_ASPECT_RATIO;

View File

@ -1,12 +1,13 @@
import React, { useEffect, useMemo, useRef } from 'react'; import React, { useEffect, useMemo, useRef } from 'react';
import RoomContainer from '@dailyjs/basic-call/components/Room/RoomContainer'; import { Container } from '@custom/basic-call/components/Call/Container';
import ParticipantBar from '@dailyjs/shared/components/ParticipantBar/ParticipantBar'; import Header from '@custom/basic-call/components/Call/Header';
import VideoContainer from '@dailyjs/shared/components/VideoContainer/VideoContainer'; import ParticipantBar from '@custom/shared/components/ParticipantBar/ParticipantBar';
import { useCallState } from '@dailyjs/shared/contexts/CallProvider'; import VideoContainer from '@custom/shared/components/VideoContainer/VideoContainer';
import { useParticipants } from '@dailyjs/shared/contexts/ParticipantsProvider'; import { useCallState } from '@custom/shared/contexts/CallProvider';
import { useTracks } from '@dailyjs/shared/contexts/TracksProvider'; import { useParticipants } from '@custom/shared/contexts/ParticipantsProvider';
import { useUIState } from '@dailyjs/shared/contexts/UIStateProvider'; import { useTracks } from '@custom/shared/contexts/TracksProvider';
import { isScreenId } from '@dailyjs/shared/contexts/participantsState'; import { useUIState } from '@custom/shared/contexts/UIStateProvider';
import { isScreenId } from '@custom/shared/contexts/participantsState';
import { SpeakerTile } from './SpeakerTile'; import { SpeakerTile } from './SpeakerTile';
const SIDEBAR_WIDTH = 186; const SIDEBAR_WIDTH = 186;
@ -78,13 +79,14 @@ export const SpeakerView = () => {
return ( return (
<div className="speaker-view"> <div className="speaker-view">
<RoomContainer> <Container>
<Header />
<VideoContainer> <VideoContainer>
<div ref={activeRef} className="active"> <div ref={activeRef} className="active">
<SpeakerTile participant={currentSpeaker} screenRef={activeRef} /> <SpeakerTile participant={currentSpeaker} screenRef={activeRef} />
</div> </div>
</VideoContainer> </VideoContainer>
</RoomContainer> </Container>
{showSidebar && ( {showSidebar && (
<ParticipantBar <ParticipantBar
fixed={fixedItems} fixed={fixedItems}

View File

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -1,7 +1,7 @@
const withPlugins = require('next-compose-plugins'); const withPlugins = require('next-compose-plugins');
const withTM = require('next-transpile-modules')([ const withTM = require('next-transpile-modules')([
'@dailyjs/shared', '@custom/shared',
'@dailyjs/basic-call', '@custom/basic-call',
]); ]);
const packageJson = require('./package.json'); const packageJson = require('./package.json');

View File

@ -1,5 +1,5 @@
{ {
"name": "@dailyjs/active-speaker", "name": "@custom/active-speaker",
"description": "Basic Call + Active Speaker", "description": "Basic Call + Active Speaker",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
@ -10,8 +10,8 @@
"lint": "next lint" "lint": "next lint"
}, },
"dependencies": { "dependencies": {
"@dailyjs/basic-call": "*", "@custom/basic-call": "*",
"@dailyjs/shared": "*", "@custom/shared": "*",
"next": "^11.0.0", "next": "^11.0.0",
"pluralize": "^8.0.0", "pluralize": "^8.0.0",
"react": "^17.0.2", "react": "^17.0.2",

View File

@ -1,5 +1,5 @@
import React from 'react'; import React from 'react';
import App from '@dailyjs/basic-call/pages/_app'; import App from '@custom/basic-call/pages/_app';
import AppWithSpeakerViewRoom from '../components/App'; import AppWithSpeakerViewRoom from '../components/App';
App.customAppComponent = <AppWithSpeakerViewRoom />; App.customAppComponent = <AppWithSpeakerViewRoom />;

View File

@ -1,5 +1,5 @@
import Index from '@dailyjs/basic-call/pages'; import Index from '@custom/basic-call/pages';
import getDemoProps from '@dailyjs/shared/lib/demoProps'; import getDemoProps from '@custom/shared/lib/demoProps';
export async function getStaticProps() { export async function getStaticProps() {
const defaultProps = getDemoProps(); const defaultProps = getDemoProps();

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -5,7 +5,7 @@ import React, {
useRef, useRef,
useState, useState,
} from 'react'; } from 'react';
import { Tile } from '@custom/shared/components/Tile'; import Tile from '@custom/shared/components/Tile';
import { DEFAULT_ASPECT_RATIO } from '@custom/shared/constants'; import { DEFAULT_ASPECT_RATIO } from '@custom/shared/constants';
import { useCallState } from '@custom/shared/contexts/CallProvider'; import { useCallState } from '@custom/shared/contexts/CallProvider';
import { useParticipants } from '@custom/shared/contexts/ParticipantsProvider'; import { useParticipants } from '@custom/shared/contexts/ParticipantsProvider';