You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
This is because you are capturing stream before video is played. You need to capture stream after video has started playing to avoid delay in stream tracks.
A better way instead of setTimeout is to use:
1- Use await on video.play() method and capture stream after that.
2- Use 'onplay' event of video element to capture stream when video is played.
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!
The text was updated successfully, but these errors were encountered: