Cordova Plugin to add WebRTC Audio and Video

Over thcordova_bote past weeks I have been working on an open sourced, community driven, Cordova Plugin for OpenTok SDK that will give you the ability to add webrtc live audio/video chat to your Android and iOS applications. In this blog post I hope to let the OpenTok community know that this project is available and if you are a web developer with limited Android or iOS experience, you can now build OpenTok mobile apps with ease using the technology you are familiar with.

Jump right into your own project or watch a demo of the Cordova plugin in action! Since this project is open source, please file issues/concerns on the GitHub issue tracker and feel free to send pull requests!

What is Cordova?

Cordova in a nutshell lets developers build mobile applications using HTML, CSS, and JavaScript. At a very basic level you are building a website and your application is a simple browser (known as WebView) that renders your files. However, webview is limited and it often cannot give developers and access to native hardware like camera, accelerometer, and other native capabilities. Cordova’s strength is its ability to let you leverage native hardware of your mobile device through Cordova Plugins.

Cordova Plugins

Cordova Plugins usually consist of a JavaScript file and all the necessary native code files for each mobile platform ( Objective C files for iOS, Java for Android, C# for Windows Phone, etc ). Methods defined in the JavaScript file will call the methods defined in the native code, thus giving developers to access native functionality of mobile devices after installing the Cordova Plugin and adding the provided JavaScript file. In the Cordova Plugin for OpenTok for example, calling Session.publish() method will invoke the plugin’s native Android and iOS code. The native code will create a video view on top of the Cordova WebView using native OpenTok SDKs, display the camera’s video stream in the view, and stream the video to OpenTok’s servers.

  • Joe V

    Awesome… Ready to start using it..

  • Maswadeh

    Awesome, however, if I want to upstream audio to my server, how can I do that? fast response will be very appreciated

    • Ankur Oberoi

      we don’t support sending media to your server. only to the clients where our libraries are used (JavaScript for Web, Android and iOS for mobile).

    • Xrymz

      wait for phonertc

  • Tom Ashley

    Can you live stream from the cam and mic to other peers and view streams from other peers as well?

    • Ankur Oberoi


      • Tom Ashley

        just using this plugin or do I have to use another to access the live streams from the devices? How do I access the vid/mic streams?

        • Ankur Oberoi

          From this plugin *and* any of our supported clients (JS, Android, iOS). Take a look at the OpenTok API. A Publisher is an object that streams from a device’s own camera and mic, while a Subscriber is an object that presents the audio and video streams from another device. You would create both in this type of an application.

  • Tom Ashley

    The video here on the main page of the site is set to private.

  • cn1109

    This video is set to private. Could you please make it public. Thank you.

  • Jose

    Our company open sourced an iOS (for now) compatible WebRTC cordova plugin,

  • windone

    Does this plugin support encryption, as would be required for HIPPA compliance?

  • Garcia

    Hi, does it means that if I have a web site using opentok js I can create an IOs app just using webview + cordoba plugin without re-coding my web?