W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > October 2019

Re: [mediacapture-main] When is a MediaStream playing? (#615)

From: Andreas Pehrson via GitHub <sysbot+gh@w3.org>
Date: Tue, 15 Oct 2019 14:09:55 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-542231670-1571148594-sysbot+gh@w3.org>
> This is the code used [#628 (comment)](https://github.com/w3c/mediacapture-main/issues/628#issuecomment-541337186).
> Technically, the media stream is still playing even when the specific media element where `srcObject` is set to the `MediaStream` is paused. Consider more than one media element having the same `MediaStream` as source. Simply because one media element is paused does not translate into the `MediaStream` itself not playing.

There is no concept of playing for a MediaStream. There is no concept of playing for a MediaStreamTrack. There is a concept of playing for HTMLMediaElement.

Yes, data is flowing under MediaStreamTracks even when no HTMLMediaElement is playing them. That's because there is no buffering of data (in MediaStreamTrack *or* HTMLMediaElement), and regardless of them playing or not playing in any HTMLMediaElement.

TL;DR Chrome's implementation has a bug they need to fix to become spec compliant.

> (Which would mean Mozilla behaviour is not specification compliant - though interestingn and potentially useful. 

The specs trump your reasoning, and with [bug 1577505](https://bugzilla.mozilla.org/show_bug.cgi?id=1577505) fixed, and this issue resolved so that "playing" is changed to "potentially playing", Firefox is spec compliant wrt currentTime in a HTMLMediaElement playing a MediaStream.

> E.g., also technically a canvas media stream could be considered "paused" when no images are being drawn onto the canvas - which brings into purview the different ways `mute` and `unmute` are dispatched by Chromium and Mozilla. At Chromium when paused is clicked `mute` and `unmute` events can toggle every few seconds. Unfortunately lost some code during recent experiments when the OS became unresponsive - though the linked code used should be modifiable to the degree necessary to test various cases)

No spec says a CanvasCaptureMediaStreamTrack should fire "mute" when nothing is drawn to its canvas. mediacapture-fromelement says to fire "mute" on CanvasCaptureMediaStreamTrack when its canvas' origin-clean flag becomes false. Firefox doesn't implement that, and it sounds like Chrome implements a bit too much.

Further than that I'm not going to comment on or debug your code.

> Another difference between Mozilla Firefox, Nightly and Chromium, Chrome implementations relevant to playback

This issue does not handle differences in playback of MediaStreams in different implementations. It discusses the meaning of "playing" in this spec. Let's keep it at that.

GitHub Notification of comment by Pehrsons
Please view or discuss this issue at https://github.com/w3c/mediacapture-main/issues/615#issuecomment-542231670 using your GitHub account
Received on Tuesday, 15 October 2019 14:09:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:22:29 UTC