Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Issue 1570263002: MediaRecorder: make EventListener and stop if receiving on{add,remove}track from WebMediaStream (Closed)

Created:
4 years, 11 months ago by mcasas
Modified:
4 years, 11 months ago
CC:
chromium-reviews, blink-reviews, tommyw+watchlist_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MediaRecorder: make EventListener and stop if receiving on{add,remove}track from WebMediaStream MediaRecorder is supposed to stop if the amount of tracks of the associated MediaStream varies. This CL adds an EventListener to MR to listen to Blink MediaStream.{add,remove}track and simply signals an error to MR in that case. Added a LayoutTest as well. Note that MediaStream did _not_ send an {add,remove}track if the added/removed track was local, it did only for remote, so this CL changes that (yes, needs review from MS folks), from the spec [1]: > onaddtrack of type EventHandler, > This event handler, of type addtrack, is executed when a MediaStreamTrack is added to the MediaStream. [...] > onremovetrack of type EventHandler, > This event handler, of type removetrack, is executed when a MediaStreamTrack is removed from the MediaStream. BUG=545156 [1] http://www.w3.org/TR/mediacapture-streams/#attributes

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -6 lines) Patch
A third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-MediaStream-modifications-events.html View 1 chunk +63 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/mediastream/MediaStream-add-remove-tracks.html View 2 chunks +2 lines, -6 lines 1 comment Download
M third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.h View 2 chunks +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp View 2 chunks +32 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/mediastream/MediaStream.cpp View 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (6 generated)
mcasas
tommi@ PTAL (or send to perkj@)
4 years, 11 months ago (2016-01-09 04:24:51 UTC) #6
perkj_chrome
Hej- I am afraid this is against the spec. From the spec: http://www.w3.org/TR/mediacapture-streams/#event-mediastream-addtrack A new ...
4 years, 11 months ago (2016-01-11 08:21:20 UTC) #8
mcasas
On 2016/01/11 08:21:20, perkj_chrome wrote: > Hej- I am afraid this is against the spec. ...
4 years, 11 months ago (2016-01-11 15:31:34 UTC) #9
mcasas
4 years, 11 months ago (2016-01-11 22:07:43 UTC) #10
On 2016/01/11 15:31:34, mcasas wrote:
> On 2016/01/11 08:21:20, perkj_chrome wrote:
> > Hej- I am afraid this is against the spec.
> > 
> > From the spec:
> > http://www.w3.org/TR/mediacapture-streams/#event-mediastream-addtrack 
> > 
> > A new MediaStreamTrack has been added to this stream. Note that this event
is
> > not fired when the script directly modifies the tracks of a MediaStream.
> > 
> >
>
https://codereview.chromium.org/1570263002/diff/40001/third_party/WebKit/Layo...
> > File
> >
>
third_party/WebKit/LayoutTests/fast/mediastream/MediaStream-add-remove-tracks.html
> > (right):
> > 
> >
>
https://codereview.chromium.org/1570263002/diff/40001/third_party/WebKit/Layo...
> >
>
third_party/WebKit/LayoutTests/fast/mediastream/MediaStream-add-remove-tracks.html:78:
> > stream1.onaddtrack = function() {};
> > This does not seem right according to spec. (it was correct from the
> beginning)
> > http://www.w3.org/TR/mediacapture-streams/#event-mediastream-addtrack
> 
> Per, the Section you're quoting is non-normative and. IMHO,
> it makes sense that onaddtrack is removed after any addtrack,
> regardless of the nature of the track being added. Filed a bug
> against the Spec for this inconsistency:
> https://github.com/w3c/mediacapture-main/issues/302
> 
> IMHO, any {add,remove}track should fire and event named
> on{add,remove}track, so please comment in the bug why it
> shouldn't be like that (or rename the event).

After talking to hta@ offline, and seeing that the consensus 
is that on{add,remove}track is only fired when calling 
{add,remove}track _with remote tracks_, I guess I'll close this
CL and try a third time :P
Thanks perkj@ for your time!

Powered by Google App Engine
This is Rietveld 408576698