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

Update example app #64

Merged
merged 20 commits into from
Jun 10, 2024
Merged

Update example app #64

merged 20 commits into from
Jun 10, 2024

Conversation

bohdanprog
Copy link
Collaborator

Description

Describe your changes in detail.

  • Remove context from the example app.
  • Update README.md.
  • Add new parameters for Preview and Room screens.
  • Create a custom hook for joining the room when you are navigated from the Preview screen.
  • Pass the username from the ConnectWithRoomManagerScreen component.
  • Create custom hooks for toggle camera and microphone.

Motivation and Context

Update the example application we want to make it easier to understand.

How has this been tested?

Tested that on Samsung Galaxy Z Fold 5, and iPhone 15 simulator.

@bohdanprog bohdanprog marked this pull request as ready for review June 5, 2024 13:19
@mironiasty mironiasty changed the title Feat/update example Update example app Jun 6, 2024
const toggleSwitchCamera = () => {
setCurrentCamera(
availableCameras.current.find(
(dev) => dev.isFrontFacing !== currentCamera?.isFrontFacing,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev -> device

@@ -0,0 +1,10 @@
import * as Device from 'expo-device';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import {isDevice} from 'expo-device';

Comment on lines 2 to 3
USE_ROOM_MANAGER_TAB: 'use_room_manager_tab',
USE_TOKEN_TAB: 'use_token_tab',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
USE_ROOM_MANAGER_TAB: 'use_room_manager_tab',
USE_TOKEN_TAB: 'use_token_tab',
ROOM_MANAGER_TAB: 'room_manager_tab',
TOKEN_TAB: 'token_tab',

This sounds more natural.

@@ -120,7 +129,7 @@ const RoomScreen = ({ navigation }: Props) => {
accessibilityLabel={SWITCH_CAMERA_BUTTON}
/>
<InCallButton
iconName={isScreencastOn ? 'share-off' : 'share'}
iconName={isScreencastOn ? 'share' : 'share-off'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that for screensharing icons should be swapped. If screencast is off we suggest to share, if it is on we suggest to stop sharing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk. I've tested how it looks on other tools, probably we might need to use different icon set for sharing (instead of justo on/off). I would leave is as is for now, and improve it when we decide to visually update app.

@@ -91,10 +97,13 @@ const RoomScreen = ({ navigation }: Props) => {

return (
<SafeAreaView style={styles.container}>
{tracks.length > 0 ? (
{tracks.length > 0 && !isIosSimulator ? (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{tracks.length > 0 && !isIosSimulator ? (
{tracks.length > 0 ? (

For video grid simulator condition is not necessary. It will display other peers video track.

import { NoCameraView } from '../../components/NoCameraView';
import { SoundOutputDevicesBottomSheet } from '../../components/SoundOutputDevicesBottomSheet';
import VideoPreview from '../../components/VideoPreview';
import { usePreventBackButton } from '../../hooks/usePreventBackButton';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe lets add path so import would look like:
import { usePreventBackButton } from '@hooks/usePreventBackButton';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

50/50 for adding additional project config to have 'nicer' imports. But we can improve directory structure to have separate folder with JS source (example/src/...)

@mironiasty mironiasty requested a review from karkakol June 10, 2024 10:54
@mironiasty mironiasty merged commit edb6a06 into main Jun 10, 2024
3 checks passed
@mironiasty mironiasty deleted the feat/update-example branch June 10, 2024 14:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants