@Obaida-Alhassan wrote:
Hi, I’m developing a webrtc project using Twilio video and works well on Web, Android on IOS I do not get it to work
I’ve used cordova-plugin-iosrtc plugin to expose the navigator.mediaDevices API
on the connect method I get this error
`TypeError: track must be a LocalAudioTrack, LocalVideoTrack, LocalDataTrack, or MediaStreamTrack`
after reading an issue on Twilio-video with the same error, I changed the code to
const { LocalAudioTrack, LocalVideoTrack, connect } = require('twilio-video'); const mediaStream = await navigator.mediaDevices.getUserMedia(constraints); const tracks = mediaStream.getTracks().map(track => track.kind === 'audio' ? new LocalAudioTrack(track) : new LocalVideoTrack(track)); const room = await connect('token', { tracks });
and I get this error after chagning code
TypeError: Argument 1 ('track') to mediaStream.addTrack must be an instance of MediaStreamTrack
please, I will appreciate any kind of help I stuck very long on this issue, or if somebody implements a similar app to guide me,Thanks In Advance
Posts: 1
Participants: 1