twilio / twilio-video.js

Twilio’s Programmable Video JavaScript SDK
https://www.twilio.com/docs/video/javascript
Other
571 stars 217 forks source link

onaddstream is deprecated! Use peerConnection.ontrack instead. #16

Closed GarPit closed 7 years ago

GarPit commented 8 years ago

onaddstream is deprecated! Use peerConnection.ontrack instead.

I have this issue in Firefox and sometimes local video preview not showing up.

Twilio.Conversations.LocalMedia.getLocalMedia().then((cameraTrack)=>{
    // attach to a <video> element
    cameraTrack.attach('.chat .left-part .video .preview-video');
  }, (error)=>{
    console.error('Unable to get access to the local camera.' + error.message);
    this.set('cameraDisabled', true);
  }
);
GarPit commented 8 years ago

then callback not called if I have breakpoint only on 3rd line, but if I add breakpoint at 1st line and 3rd (with cameraTrack.attach), then I can see preview

markandrus commented 8 years ago

@GarPit thanks for the report! We'll work on updating this. The Firefox behavior is strange...

GarPit commented 8 years ago

Yes, but I'm not sure showing local preview related with this warning

markandrus commented 7 years ago

@GarPit we started doing feature detection for ontrack versus onaddstream in recent twilio-video.js releases. This warning should no longer print.