This commit is contained in:
sim1222 2025-04-17 13:25:03 +09:00
parent 7d61d20c8e
commit 8784fa402d
Signed by: sim1222
GPG Key ID: D1AE30E316E44E5D
2 changed files with 61 additions and 28 deletions

View File

@ -1,6 +1,7 @@
/*! For license information please see src_components_faceRecognition_FaceRecognition_tsx-src_components_shared_organisms_Player_Ove-59cc90.a810eba2a0194c5f16e6.js.LICENSE.txt */
/*! @ohtomi-preamble version: 8.1.0, name:src_components_faceRecognition_FaceRecognition_tsx-src_components_shared_organisms_Player_Ove-59cc90 */
import type React from "react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { jsx, jsxs } from "react/jsx-runtime";
@ -14,7 +15,7 @@ try {
? globalThis
: "undefined" !== typeof self
? self
: {};
: ({} as typeof globalThis);
const t = new e.Error().stack;
t &&
((e._sentryDebugIds = e._sentryDebugIds || {}),
@ -38,11 +39,13 @@ try {
{
98024: (e, t, n) => {
n.d(t, { B: () => o });
const a = n(96540);
function o({ disabled: e = !1, storedDevice: t } = {}) {
const [n, o] = useState(null);
const [error, setError] = useState(null);
const [inputDevices, setInputDevices] = useState<MediaDeviceInfo[]>([]);
const [s, c] = useState();
const [mediaDeviceInfo, setMediaDeviceInfo] =
useState<MediaDeviceInfo>();
const l = useCallback(async () => {
try {
await navigator.mediaDevices
@ -55,7 +58,8 @@ try {
await navigator.mediaDevices
.enumerateDevices()
.then((MediaDevices) => {
o(null);
setError(null);
const videoInputDevices = MediaDevices.filter(
(mediaDevice) =>
mediaDevice.kind === "videoinput" &&
@ -63,9 +67,12 @@ try {
);
if (
(setInputDevices(videoInputDevices),
!s ||
!mediaDeviceInfo ||
!videoInputDevices.some(
(e) => e.deviceId === s.deviceId || e.label === s.label,
(videoInputDevice) =>
videoInputDevice.deviceId ===
mediaDeviceInfo.deviceId ||
videoInputDevice.label === mediaDeviceInfo.label,
))
) {
let a;
@ -87,28 +94,39 @@ try {
: videoInputDevices[0];
if (null == e)
throw new Error("利用可能なカメラデバイスが存在しません");
c(e);
setMediaDeviceInfo(e);
}
});
} catch (e) {
o(e);
setError(e);
}
}, [s, null == t ? void 0 : t.deviceId, null == t ? void 0 : t.label]);
}, [
mediaDeviceInfo,
null == t ? void 0 : t.deviceId,
null == t ? void 0 : t.label,
]);
const d = useCallback(
(e) => {
c(
setMediaDeviceInfo(
null == inputDevices
? void 0
: inputDevices.find((t) => t.deviceId === e),
: inputDevices.find(
(inputDevice) => inputDevice.deviceId === e,
),
);
},
[inputDevices],
);
return (
useEffect(
() =>
e
? (o(null), setInputDevices([]), c(void 0), () => {})
? (setError(null),
setInputDevices([]),
setMediaDeviceInfo(void 0),
() => {})
: (l(),
navigator.mediaDevices.addEventListener("devicechange", l),
() =>
@ -119,9 +137,9 @@ try {
[e, l],
),
{
error: n,
error: error,
availableDevices: inputDevices,
currentDevice: s,
currentDevice: mediaDeviceInfo,
select: d,
}
);
@ -129,7 +147,6 @@ try {
},
81801: (e, t, n) => {
n.d(t, { y: () => i });
const a = n(96540);
const o = n(78685);
const r = "camera-device";
function i() {
@ -144,7 +161,6 @@ try {
},
77177: (e, t, n) => {
n.d(t, { j: () => C });
const a = n(96540);
const o = n(98024);
const r = n(81801);
const i = Math.floor(25.5);
@ -252,17 +268,11 @@ try {
children: [
"failed" !== e &&
jsxs(u.Fragment, {
children: [
jsx(v, {}),
jsx(f, { children: "認証中" }),
],
children: [jsx(v, {}), jsx(f, { children: "認証中" })],
}),
"failed" === e &&
jsxs(u.Fragment, {
children: [
jsx(g, {}),
jsx(f, { children: "認証不可" }),
],
children: [jsx(g, {}), jsx(f, { children: "認証不可" })],
}),
],
});
@ -443,7 +453,7 @@ try {
n.d(t, { b: () => p });
const a = n(63998);
const o = n(35830);
const r = n(96540);
const r: typeof React = n(96540);
const i = n(74848);
const s = ({ rate: e, currentRate: t, onClick: n }) => {
const a = useCallback(() => {
@ -574,7 +584,7 @@ try {
},
41233: (e, t, n) => {
n.d(t, { y: () => o });
const a = n(96540);
const a: typeof React = n(96540);
function o({ changePlaybackRate: e }) {
const [t, n] = useState(!1);
const [o, r] = useState(!1);
@ -636,7 +646,7 @@ try {
},
49474: (e, t, n) => {
n.d(t, { J: () => o });
const a = n(96540);
const a: typeof React = n(96540);
function o(e) {
const [t, n] = useState("prompt");
return (

23
src/types/global.d.ts vendored Normal file
View File

@ -0,0 +1,23 @@
declare global {
interface Window {
SENTRY_ENVIRONMENT?: string;
SENTRY_DSN?: string;
SENTRY_RELEASE?: {
id?: string;
};
SENTRY_SDK_SOURCE?: SdkSource;
/**
* Debug IDs are indirectly injected by Sentry CLI or bundler plugins to directly reference a particular source map
* for resolving of a source file. The injected code will place an entry into the record for each loaded bundle/JS
* file.
*/
_sentryDebugIds?: Record<string, string>;
/**
* Raw module metadata that is injected by bundler plugins.
*
* Keys are `error.stack` strings, values are the metadata.
*/
_sentryModuleMetadata?: Record<string, any>;
_sentryEsmLoaderHookRegistered?: boolean;
}
}