W3C home > Mailing lists > Public > public-webrtc@w3.org > November 2016

[webrtc-pc] CaptureStream adds mediaTracks with delay, we need a callback?

From: Ivrrimum via GitHub <sysbot+gh@w3.org>
Date: Tue, 08 Nov 2016 13:28:36 +0000
To: public-webrtc@w3.org
Message-ID: <issues.opened-187991598-1478611715-sysbot+gh@w3.org>
IvRRimum has just created a new issue for 
https://github.com/w3c/webrtc-pc:

== CaptureStream adds mediaTracks with delay, we need a callback? ==
When calling video.captureStream() getTracks() returns empty array, 
but after 1.5 seconds, it returns tracks as expected.

Error produced if no tracks are added: 
http://stackoverflow.com/questions/40472743/webrtc111-error-domexception-internalerror-cannot-create-an-offer-with-no-lo

Adding this for doc purposes, as others might find this confusing.

Solution:

setInterval(function(){
      // We wait till the mediaTracks are added to mediaStream
      console.log(stream.getTracks());
      // Further actions with the mediaStream
}, 1000);

Thanks!

Please view or discuss this issue at 
https://github.com/w3c/webrtc-pc/issues/923 using your GitHub account
Received on Tuesday, 8 November 2016 13:28:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:49 UTC