mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-12-06 13:34:13 +03:00
add mse codecs to console debug on errors
This commit is contained in:
parent
086330a542
commit
a76c4c180e
@ -82,6 +82,7 @@ function MSEPlayer({
|
||||
[key: string]: (msg: { value: string; type: string }) => void;
|
||||
}>({});
|
||||
const msRef = useRef<MediaSource | null>(null);
|
||||
const mseCodecRef = useRef<string | null>(null);
|
||||
|
||||
const wsURL = useMemo(() => {
|
||||
return `${baseUrl.replace(/^http/, "ws")}live/mse/api/ws?src=${camera}`;
|
||||
@ -93,6 +94,10 @@ function MSEPlayer({
|
||||
console.error(
|
||||
`${camera} - MSE error '${error}': ${description} See the documentation: https://docs.frigate.video/configuration/live/#live-player-error-messages`,
|
||||
);
|
||||
if (mseCodecRef.current) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(`MSE codec in use: ${mseCodecRef.current}`);
|
||||
}
|
||||
onError?.(error);
|
||||
},
|
||||
[camera, onError],
|
||||
@ -299,6 +304,9 @@ function MSEPlayer({
|
||||
onmessageRef.current["mse"] = (msg) => {
|
||||
if (msg.type !== "mse") return;
|
||||
|
||||
// Store the codec value for error logging
|
||||
mseCodecRef.current = msg.value;
|
||||
|
||||
let sb: SourceBuffer | undefined;
|
||||
try {
|
||||
sb = msRef.current?.addSourceBuffer(msg.value);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user