2

I want to build a phonegap video chat for public use, but I didn't find any solution for iOS.

I tried Phonertc for example, which looks like the only plugin built for p2p video, but it doesn't work at all. It's full of bugs and really not stable, what would you suggest now?

I thought about streaming in p2p the camera video in background using the phonegap media plugin and some services like amazon servers for relaying, I would avoid using tools like tokbozx and twillio.

I really need to be able to manage the video stream so that I can apply filters and more from a canvas for example.

Please if you have some idea let me know, thanks!!

So what do you think the steup and logic should be behind building a cordova video and audio p2p chat? thsanks

logic
  • 1,739
  • 3
  • 16
  • 22
klusterz
  • 31
  • 3

2 Answers2

1

Not sure if it's the model you're going for, but you could try p2p: http://www.webrtc.org/architecture Can HTML5 Websockets connect 2 clients (browsers) directly without using a server? (P2P)

I haven't played with server-side much, but here's a tutorial: http://codesamplez.com/programming/php-html5-video-streaming-tutorial

Client Side Only (expand from here, could add canvas):

<html><head>
<script>
    navigator.getUserMedia = ( navigator.getUserMedia ||
                       navigator.webkitGetUserMedia ||
                       navigator.mozGetUserMedia ||
                       navigator.msGetUserMedia);

if (navigator.getUserMedia) {
   navigator.getUserMedia (

      // constraints
      {
         video: true,
         audio: true
      },

      // successCallback
      function(localMediaStream) {
         var video = document.querySelector('video');
         video.src = window.URL.createObjectURL(localMediaStream);
         // Do something with the video here, e.g. video.play()
      },

      // errorCallback
      function(err) {
         console.log("The following error occured: " + err);
      }
   );
} else {
   console.log("getUserMedia not supported");
}
    </script>
</head><body>

<video style="border: solid 1px" autoplay="true">

</body></html>
Community
  • 1
  • 1
MaKR
  • 1,882
  • 2
  • 17
  • 29
  • iOS safari does not support webRTC anyway thanks for your answer – klusterz Mar 30 '15 at 19:44
  • Ah, sorry, I'm an android guy :/ hopefully the client-side portion is helpful as it should be supported on ios. You might want to read into server-side solutions then, although that's going to make a lot of overhead that would be nice to skip. – MaKR Mar 30 '15 at 20:00
0

There is ConnectyCube platform which provides Cordova chat & video chat SDKs and code samples

Here is a Video Chat how to guide: https://developers.connectycube.com/js/code-samples-videochat-cordova

It describes how to run their Video Chat web code sample under Cordova/PhoneGap. Looks pretty simple. It's based on top of WebRTC API, it's a P2P video chat. They use cordova-plugin-iosrtc plugin for iOS to work

Rubycon
  • 18,156
  • 10
  • 49
  • 70