mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
Undiverge main branch from projector branch
This commit is contained in:
@@ -9,3 +9,18 @@ export const formatTime = (seconds: number): string => {
|
||||
|
||||
return timeString;
|
||||
};
|
||||
|
||||
export const formatTimeDifference = (seconds: number): string => {
|
||||
let hours = Math.floor(seconds / 3600);
|
||||
let minutes = Math.floor((seconds % 3600) / 60);
|
||||
let secs = Math.floor(seconds % 60);
|
||||
|
||||
let timeString =
|
||||
hours > 0
|
||||
? `${hours < 10 ? "\u00A0" : ""}${hours}h ago`
|
||||
: minutes > 0
|
||||
? `${minutes < 10 ? "\u00A0" : ""}${minutes}m ago`
|
||||
: `<1m ago`;
|
||||
|
||||
return timeString;
|
||||
};
|
||||
|
||||
3
www/app/lib/utils.ts
Normal file
3
www/app/lib/utils.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function isDevelopment() {
|
||||
return process.env.NEXT_PUBLIC_ENV === "development";
|
||||
}
|
||||
@@ -78,11 +78,23 @@ const useAudioDevice = () => {
|
||||
deviceId: string,
|
||||
): Promise<MediaStream | null> => {
|
||||
try {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
const noiseSuppression = urlParams.get("noiseSuppression") === "true";
|
||||
const echoCancellation = urlParams.get("echoCancellation") === "true";
|
||||
|
||||
console.debug(
|
||||
"noiseSuppression",
|
||||
noiseSuppression,
|
||||
"echoCancellation",
|
||||
echoCancellation,
|
||||
);
|
||||
|
||||
const stream = await navigator.mediaDevices.getUserMedia({
|
||||
audio: {
|
||||
deviceId,
|
||||
noiseSuppression: false,
|
||||
echoCancellation: false,
|
||||
noiseSuppression,
|
||||
echoCancellation,
|
||||
},
|
||||
});
|
||||
return stream;
|
||||
|
||||
@@ -17,3 +17,8 @@ export type FinalSummary = {
|
||||
export type Status = {
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type TranslatedTopic = {
|
||||
text: string;
|
||||
translation: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user