diff --git a/dom/media/DOMMediaStream.cpp b/dom/media/DOMMediaStream.cpp index a42f08553c9f..f46cf6e14ab7 100644 --- a/dom/media/DOMMediaStream.cpp +++ b/dom/media/DOMMediaStream.cpp @@ -711,7 +711,7 @@ DOMMediaStream::CloneInternal(TrackForwardingOption aForwarding) } MediaStreamTrack* -DOMMediaStream::GetTrackById(const nsString& aId) +DOMMediaStream::GetTrackById(const nsAString& aId) const { for (const RefPtr& info : mTracks) { nsString id; @@ -724,7 +724,7 @@ DOMMediaStream::GetTrackById(const nsString& aId) } MediaStreamTrack* -DOMMediaStream::GetOwnedTrackById(const nsString& aId) +DOMMediaStream::GetOwnedTrackById(const nsAString& aId) { for (const RefPtr& info : mOwnedTracks) { nsString id; diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index 2ebc7361855f..2920897bcea4 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -352,6 +352,7 @@ public: void GetAudioTracks(nsTArray >& aTracks) const; void GetVideoTracks(nsTArray >& aTracks) const; void GetTracks(nsTArray >& aTracks) const; + MediaStreamTrack* GetTrackById(const nsAString& aId) const; void AddTrack(MediaStreamTrack& aTrack); void RemoveTrack(MediaStreamTrack& aTrack); @@ -374,9 +375,7 @@ public: }; already_AddRefed CloneInternal(TrackForwardingOption aForwarding); - MediaStreamTrack* GetTrackById(const nsString& aId); - - MediaStreamTrack* GetOwnedTrackById(const nsString& aId); + MediaStreamTrack* GetOwnedTrackById(const nsAString& aId); /** * Returns true if this DOMMediaStream has aTrack in its mPlaybackStream. diff --git a/dom/webidl/MediaStream.webidl b/dom/webidl/MediaStream.webidl index 60f71022d0e7..5b8a42a246c0 100644 --- a/dom/webidl/MediaStream.webidl +++ b/dom/webidl/MediaStream.webidl @@ -36,7 +36,7 @@ interface MediaStream : EventTarget { sequence getAudioTracks (); sequence getVideoTracks (); sequence getTracks (); - // MediaStreamTrack? getTrackById (DOMString trackId); + MediaStreamTrack? getTrackById (DOMString trackId); void addTrack (MediaStreamTrack track); void removeTrack (MediaStreamTrack track); MediaStream clone ();