ferrazzipietro commited on
Commit
05965cb
·
1 Parent(s): 769f550
seamless_server/.DS_Store CHANGED
Binary files a/seamless_server/.DS_Store and b/seamless_server/.DS_Store differ
 
seamless_server/models/.DS_Store CHANGED
Binary files a/seamless_server/models/.DS_Store and b/seamless_server/models/.DS_Store differ
 
streaming-react-app/src/assets/illy2.svg DELETED
streaming-react-app/src/assets/{illy.svg → seamless.svg} RENAMED
File without changes
streaming-react-app/src/react-xr/ARButton 2.tsx DELETED
@@ -1,89 +0,0 @@
1
- import * as THREE from 'three';
2
- import {Button} from '@mui/material';
3
- import {useCallback, useEffect, useState} from 'react';
4
- import {BufferedSpeechPlayer} from '../createBufferedSpeechPlayer';
5
-
6
- type Props = {
7
- bufferedSpeechPlayer: BufferedSpeechPlayer;
8
- renderer: THREE.WebGLRenderer | null;
9
- onARVisible?: () => void;
10
- onARHidden?: () => void;
11
- };
12
-
13
- export default function ARButton({
14
- bufferedSpeechPlayer,
15
- renderer,
16
- onARVisible,
17
- onARHidden,
18
- }: Props) {
19
- const [session, setSession] = useState<XRSession | null>(null);
20
- const [supported, setSupported] = useState<boolean>(true);
21
-
22
- useEffect(() => {
23
- if (!navigator.xr) {
24
- setSupported(false);
25
- return;
26
- }
27
- navigator.xr.isSessionSupported('immersive-ar').then((supported) => {
28
- setSupported(supported);
29
- });
30
- }, []);
31
-
32
- const resetBuffers = useCallback(
33
- (event: XRSessionEvent) => {
34
- const session = event.target;
35
- if (!(session instanceof XRSession)) {
36
- return;
37
- }
38
- switch (session.visibilityState) {
39
- case 'visible':
40
- console.log('Restarting speech player, device is visible');
41
- bufferedSpeechPlayer.stop();
42
- bufferedSpeechPlayer.start();
43
- onARVisible?.();
44
- break;
45
- case 'hidden':
46
- console.log('Stopping speech player, device is hidden');
47
- bufferedSpeechPlayer.stop();
48
- bufferedSpeechPlayer.start();
49
- onARHidden?.();
50
- break;
51
- }
52
- },
53
- [bufferedSpeechPlayer],
54
- );
55
-
56
- async function onSessionStarted(session: XRSession) {
57
- setSession(session);
58
-
59
- session.onvisibilitychange = resetBuffers;
60
- session.onend = onSessionEnded;
61
-
62
- await renderer.xr.setSession(session);
63
- }
64
-
65
- function onSessionEnded() {
66
- setSession(null);
67
- }
68
-
69
- const onClick = () => {
70
- if (session === null) {
71
- navigator.xr!.requestSession('immersive-ar').then(onSessionStarted);
72
- } else {
73
- session.end();
74
- }
75
- };
76
- return (
77
- <Button
78
- variant="contained"
79
- onClick={onClick}
80
- disabled={!supported || renderer == null}
81
- sx={{mt: 1}}>
82
- {supported
83
- ? renderer != null
84
- ? 'Enter AR'
85
- : 'Initializing AR...'
86
- : 'AR Not Supported'}
87
- </Button>
88
- );
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
streaming-react-app/src/types/RoomState 2.ts DELETED
@@ -1,16 +0,0 @@
1
- export type MemberID = string;
2
-
3
- export type Member = {
4
- client_id: MemberID;
5
- session_id: string;
6
- name: string;
7
- connection_status: 'connected' | 'disconnected';
8
- };
9
-
10
- export type RoomState = {
11
- activeTranscoders: number;
12
- room_id: string;
13
- members: Array<Member>;
14
- listeners: Array<MemberID>;
15
- speakers: Array<MemberID>;
16
- };