MediaStreamTrack.getVideoTracks() and getAudioTracks() always returns an empty array

RESOLVED INVALID

Status

()

Core
WebRTC: Audio/Video
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: tom, Unassigned)

Tracking

25 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:25.0) Gecko/20130723 Firefox/25.0 (Nightly/Aurora)
Build ID: 20130723030205

Steps to reproduce:

* Go to https://apprtc.appspot.com.
* On another computer (or private window), go to the same URL.
* Wait for the call to connect and both sides to show video.
* Open up the console in one of the windows.
* Try to get the MediaStreamTracks from the MediaStream with "localStream.getVideoTracks()" or "localStream.getAudioTracks()" (there is also a remoteStream variable).


Actual results:

The video tracks array and audio tracks array are always empty.


Expected results:

The MediaStreamTracks should be present. You can see it work if you use Chrome. Ultimately getting the tracks is useful so that you can enable/disable (mute/unmute) the tracks:

localStream.getVideoTracks()[0].enabled = false;

Updated

4 years ago
Component: Untriaged → WebRTC: Audio/Video
Product: Firefox → Core
This is a bug with apprtc's adapter.js code. They haven't updated their adapter.js to recognize that Firefox now supports getVideoTracks and getAudioTracks. I'd file a bug about this here - https://code.google.com/p/webrtc/issues/list.

You can evidence of this here - https://code.google.com/p/webrtc/source/browse/trunk/samples/js/base/adapter.js?r=4139#56.

Given that this is not a bug in our code, I'm closing this out.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
(Reporter)

Comment 2

4 years ago
You're correct. I should have looked at the adapter.js code first; sorry for the noise.
You need to log in before you can comment on or make changes to this bug.