[Webkit-unassigned] [Bug 252465] In PWA, HTML Video Element may be unable to play stream from 'getUserMedia()'

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 15 11:44:11 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=252465

--- Comment #35 from Chris <chrissyg at protonmail.com> ---
(In reply to rooke from comment #34)
> Just to add to the information available, and provide a detection method,
> you can subscribe to the HTMLMediaElement's events (e.g. <video muted="true"
> />). In a normal situation, the events follow this order:
> 
> play 
> waiting 
> loadstart 
> progress 
> suspend 
> durationchange 
> loadedmetadata 
> loadeddata 
> canplay 
> playing 
> canplaythrough
> timeupdate (repeatedly for every frame)
> 
> When the PWA camera issue rears its head, the events are cut off at
> 'suspend', i.e.:
> 
> play 
> waiting 
> loadstart 
> progress 
> suspend 
> <then nothing>
> 
> This is the method to detect when you're in that situation. Just timeout on
> any of the missing 'expected' events, e.g. canplay:
> 
> let timeoutId: NodeJS.Timeout;
> 
> // set timeout of 3 seconds to wait for oncanplay
> timeoutId = setTimeout(() => {
>   // The video didn't get to 'canplay'
> }, yourPreferredTimeoutInMillis);
> 
> videoElement.oncanplay = () => {
>   // clear the timeout because oncanplay was called
>   clearTimeout(timeoutId);
> };



This is really helpful, thank you

I’d been doing something similar already with a chained function call that executes after a timer is set to say the camera couldn’t be loaded. If the function succeeds and it progresses past “suspend” then the timer is cleared and the camera is displayed.

Being able to detect the problem was half the battle but obviously having an actual fix for this is the dream! In the meantime a work around to detect the issue and then get the camera working again without user input would be great, too…

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230615/124bd256/attachment.htm>


More information about the webkit-unassigned mailing list