Closed
Bug 1208390
Opened 9 years ago
Closed 9 years ago
Implement MediaStream.getTrackById()
Categories
(Core :: Audio/Video: MediaStreamGraph, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: pehrsons, Assigned: pehrsons)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete)
Attachments
(3 files)
This seems trivial but wasn't covered by any other bug. We should implement this to make the API complete.
Updated•9 years ago
|
Rank: 25
Priority: -- → P2
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → pehrsons
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/54244/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/54244/
Attachment #8754782 -
Flags: review?(jib)
Attachment #8754783 -
Flags: review?(jib)
Attachment #8754784 -
Flags: review?(jib)
Attachment #8754784 -
Flags: review?(bugs)
Assignee | ||
Comment 2•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/54246/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/54246/
Assignee | ||
Comment 3•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/54248/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/54248/
Comment 4•9 years ago
|
||
Comment on attachment 8754784 [details]
MozReview Request: Bug 1208390 - Implement MediaStream.getTrackById(). r?jib, r?smaug
https://reviewboard.mozilla.org/r/54248/#review50934
Attachment #8754784 -
Flags: review?(bugs) → review+
Comment 5•9 years ago
|
||
Comment on attachment 8754782 [details]
MozReview Request: Bug 1208390 - Add test for MediaStream.getTrackById(). r?jib
https://reviewboard.mozilla.org/r/54244/#review50964
Attachment #8754782 -
Flags: review?(jib) → review+
Comment 6•9 years ago
|
||
Comment on attachment 8754783 [details]
MozReview Request: Bug 1208390 - Use MediaStream.getTrackById() in some existing tests. r?jib
https://reviewboard.mozilla.org/r/54246/#review50968
::: dom/media/tests/mochitest/pc.js:1134
(Diff revision 1)
> return this._pc.getRemoteStreams().some(stream => {
> - return stream.getTracks().some(pcTrack => pcTrack.id == track.id);
> + return !!stream.getTrackById(track.id);
Nit: An opportunity to remove {} and return ?
::: dom/media/tests/mochitest/pc.js:1481
(Diff revision 1)
> var inputElem = from.localMediaElements[0];
>
> // As input we use the stream of |from|'s first available audio sender.
> var inputSenderTracks = from._pc.getSenders().map(sn => sn.track);
> var inputAudioStream = from._pc.getLocalStreams()
> - .find(s => s.getAudioTracks().some(t => inputSenderTracks.some(t2 => t == t2)));
> + .find(s => inputSenderTracks.some(t => t.kind == "audio" && !!s.getTrackById(t.id)));
!! is redundant here.
Attachment #8754783 -
Flags: review?(jib) → review+
Comment 7•9 years ago
|
||
Comment on attachment 8754784 [details]
MozReview Request: Bug 1208390 - Implement MediaStream.getTrackById(). r?jib, r?smaug
https://reviewboard.mozilla.org/r/54248/#review50984
::: dom/media/DOMMediaStream.h:352
(Diff revision 1)
> void GetAudioTracks(nsTArray<RefPtr<AudioStreamTrack> >& aTracks) const;
> void GetVideoTracks(nsTArray<RefPtr<VideoStreamTrack> >& aTracks) const;
> void GetTracks(nsTArray<RefPtr<MediaStreamTrack> >& aTracks) const;
> + MediaStreamTrack* GetTrackById(const nsAString& aId);
Maybe const like the others here?
Attachment #8754784 -
Flags: review?(jib) → review+
Assignee | ||
Comment 9•9 years ago
|
||
Try push was here: https://treeherder.mozilla.org/#/jobs?repo=try&revision=4054d608608e
Comment 10•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dc94f1f82084
https://hg.mozilla.org/mozilla-central/rev/54985370fcd2
https://hg.mozilla.org/mozilla-central/rev/3737024731e6
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Comment 11•9 years ago
|
||
Document created: https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/getTrackById
Updated Firefox 49 for developers.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•