2

I am trying to implement video and audio chat in my ionic app. I tried many solutions but they work on either android or ios but not in a hybrid app. also some solutions provide Cordova code, how to convert that Cordova code to ionic?

1 Answers1

0

the "WebRTC" is something you must know about! search it in Google. And as a solution I really recommend you to try Twilio. the docs can be read at: https://www.twilio.com/docs

and you can add it in your project using npm or yanr and then use it with the prochased accountSid and authoken.

we used it in our project and it works perfectly!

Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54
  • 1
    hello, I tried twilio in following way, but by local as well as participants camera not displaying(all other tasks works fine) Video.connect(token, {name: room_name}).then(function (room) { Video.createLocalVideoTrack().then(function (track) { $("#localVideo").append(track.attach()); }); room.on('participantConnected', function (participant) { $("#patientVideo").append(participant.track.attach()) }) }); HTML
    – shubham shinde May 30 '20 at 05:48
  • @shubhamshinde you didn't specify the width of video – Mahdi Zarei May 30 '20 at 15:17
  • @shubhamshinde `{name: room_name, video: {width: this.platform.width()}}` – Mahdi Zarei May 30 '20 at 15:17
  • @shubhamshinde I used it in 3 different projects and it works just fine. follow the docs again with more attention. and if my answer was useful to you make it the correct answer. – Mahdi Zarei May 30 '20 at 15:20
  • its working fine on browser, but on android device it gives error as **ERROR Error: Uncaught (in promise): NotReadableError: Could not start video source** – shubham shinde May 31 '20 at 15:20
  • @shubhamshinde I really need to see the code if you want me to help more – Mahdi Zarei Jun 02 '20 at 12:56
  • thnks @MahdiZarei its working fine now, i had forgotten to add video and audio permissions in config.xml – shubham shinde Jun 02 '20 at 17:58
  • @shubhamshinde Good Luck with it! :-D – Mahdi Zarei Jun 02 '20 at 19:35