Open Bug 910249 Opened 11 years ago Updated 2 years ago

[meta] Finish implementation of MediaStream.webidl and MediaStreamTrack.webidl


(Core :: WebRTC: Audio/Video, defect, P3)

Other Branch




(Reporter: abr, Unassigned)


(Depends on 2 open bugs, Blocks 1 open bug)


(Keywords: dev-doc-needed, meta)

Currently, our version of MediaStreamTrack.webidl is out of sync with the most recent editors' draft (in particular, it is missing the "MediaSourceStates states ();" method). It also has a preponderance of its events and methods commented out.

I'm filing this as a monolithic bug rather than giving each attribute/method/event its own bug, based on roc's evaluation that this should be a relatively small task. If that ends up not being the case, we may want to split this up into smaller chunks.

One specific point of pain that is coming up from the missing features is that scripts have no way to determine whether the camera selected by a user is front ("user") facing or rear ("environment") facing. Since some scripts choose to mirror a self-view, it is important to to be able to make this distinction.
Blocks: 910215
I'll also note that the absence of clone() -- which should be present on both MediaStream and MediaStreamTrack -- is particularly painful. It would be nice to be able to, say, disable the video track being sent to a remote party while continuing to display a viable self-view. Without cloning, the only way to do this is to ask for the camera twice, which is untenable from a user experience perspective (and might have very surprising results if the user picks two different cameras for the two dialogs).
Summary: Finish implementation of MediaStreamTrack.webidl → Finish implementation of MediaStream.webidl and MediaStreamTrack.webidl
Blocks: 985265
Target Milestone: --- → mozilla33
If we think cloning is critical for applications, we should open a separate bug for that.

Jan-Ivar -- can you estimate the effort for this bug and put a p= in the whiteboard?
Flags: needinfo?(jib)
Target Milestone: mozilla33 → mozilla34
This is a wild guess. Cloning and camera-sharing sounds a bit like an open-ended problem, something best fine-tuned over time perhaps?

If we just want the webidl up and spinning with a small subset of features then that's a p=1.
Flags: needinfo?(jib)
Whiteboard: [p=5, ft:webrtc]
Priority: -- → P2
I agree, I think the ability to effectively clone a track is pretty important for WebRTC media centric apps.  I think the following illustrates an instance where you would go down this route (has been tested as working this way in Chrome):

- Capture MediaStream (Audio + Video)
- Render MediaStream to "local" video display
- Create a new MediaStream, cloning each of the MediaStreamTracks within the originally captured stream.
- Use this new stream (with cloned tracks) to send over remote peer connections.

Using this approach gives you the advantage of being able to toggle the enabled states of the the cloned tracks without affecting the local rendering.  Taking it a step further, as an application developer you might take the approach of creating MediaStreams for each of the peers you wish to communicate with, thus being able to selectively disable tracks for targeted participants.
This bug includes implementing the ConstrainablePattern which must arbitrate camera access between multiple tracks with potentially competing constraints (e.g. users in different tabs and windows), including firing overconstained events on the MediaStreamTracks which constraints can no longer be met due to arbitration or even runtime events like users rotating their phone (affects width/height/aspectRatio).
Let's target this for 37 or 38; there will be some backend work to do by me as well to support it.  Also, we may be able to get part of this sooner than the entire set covered by this bug.
Assignee: nobody → jib
Target Milestone: mozilla34 → mozilla38
Depends on: 1103188
backlog: --- → webRTC+
Rank: 23
Whiteboard: [p=5, ft:webrtc]
Depends on: 1208316
Depends on: 1208328
Depends on: 1208371
Depends on: 1208373
Depends on: 1208378
Depends on: 1208384
Depends on: 1208390
I just turned this into a meta bug. I think it'll be easier to get things implemented and landed this way.
Assignee: jib → nobody
Keywords: dev-doc-neededmeta
Summary: Finish implementation of MediaStream.webidl and MediaStreamTrack.webidl → [meta] Finish implementation of MediaStream.webidl and MediaStreamTrack.webidl
No longer blocks: 1070216
Depends on: 1070216
Target Milestone: mozilla38 → ---
No longer depends on: 1223696
I'm waiting for the mediastream 'clone' functionality, as it's blocking controlling local streams in a multiple call scenario. Appreciate if you could provide a rough estimate of the targeted milestone for this?


Could anyone please let me know if there's a rough estimate for this 'clone' functionality as we are relying on this.

(In reply to rajkumaradass from comment #12)
> Hi,
> Could anyone please let me know if there's a rough estimate for this 'clone'
> functionality as we are relying on this.
> thanks

You want to track Bug 1208371.  The good news is cloning is basically ready to land.  Because there is so much code changing, we'll likely land the patches on that bug early next week (after uplift) so they get maximum bake time in Fx47 (rather than right before Fx46 goes to Dev Edition).
Depends on: 1282858
Depends on: 1301675
Depends on: 1377146
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.