From 9c1af043bcdeb999f6957dc4382306204a65c565 Mon Sep 17 00:00:00 2001 From: Pholawat Tangsatit Date: Mon, 12 Dec 2022 19:08:23 +0700 Subject: [PATCH] add await to this.surface.play() --- src/camera/core-impl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/camera/core-impl.ts b/src/camera/core-impl.ts index 16b36dc..eea2bf3 100644 --- a/src/camera/core-impl.ts +++ b/src/camera/core-impl.ts @@ -186,7 +186,7 @@ class RenderedCameraImpl implements RenderedCamera { this.surface.addEventListener("playing", onVideoStart); this.surface.srcObject = this.mediaStream; - this.surface.play(); + return this.surface.play(); } static async create( @@ -205,7 +205,7 @@ class RenderedCameraImpl implements RenderedCamera { aspectRatioConstraint); } - renderedCamera.setupSurface(); + await renderedCamera.setupSurface(); return renderedCamera; }