mediacapture-image icon indicating copy to clipboard operation
mediacapture-image copied to clipboard

grabFrame and muted streams

Open dsanders11 opened this issue 5 years ago • 0 comments

The current Chromium implementation will reject grabFrame for a muted stream, here's the relevant line. The spec currently says nothing about rejecting on a muted stream.

This behavior is problematic as a stream created from a canvas will constantly toggle mute and unmute as new content is drawn. This means to use grabFrame effectively on a stream from a canvas, you'd need to call it inside the onunmute handler for the track, which overly complicates the code. There's ongoing discussion in #212 regarding whether grabFrame should be for the 'current frame' or the 'next frame', and I think this is another example of a sharp edge created by that behavior being 'next frame'. If grabFrame was clarified in the spec to grab the current frame, then the spec could enforce that a muted track should not cause a rejection of grabFrame.

dsanders11 avatar Jul 18 '19 09:07 dsanders11