Устранение гонки запуска live-камеры
This commit is contained in:
@@ -470,8 +470,6 @@ export function MseFmp4WebSocketPlayer({
|
||||
: "Подключение к локальному видеопотоку");
|
||||
const mediaSource = new MediaSource();
|
||||
objectUrl = URL.createObjectURL(mediaSource);
|
||||
video.src = objectUrl;
|
||||
startupWatchdog?.armFirstMedia();
|
||||
|
||||
const onSourceOpen = () => {
|
||||
if (!transportIsCurrent() || failed) return;
|
||||
@@ -562,7 +560,12 @@ export function MseFmp4WebSocketPlayer({
|
||||
});
|
||||
};
|
||||
|
||||
// Register before assigning the object URL. `video.src` is the action that
|
||||
// lets the browser open this MediaSource; a fast sequential MSE lease must
|
||||
// not fire `sourceopen` in the gap before its only listener exists.
|
||||
mediaSource.addEventListener("sourceopen", onSourceOpen, { once: true });
|
||||
startupWatchdog?.armFirstMedia();
|
||||
video.src = objectUrl;
|
||||
|
||||
const disposeTransport = () => {
|
||||
if (disposed) return;
|
||||
|
||||
Reference in New Issue
Block a user