Giter Site home page Giter Site logo

linphonegap's Introduction

Description

Phonegap (Cordova) plugin to wrap the linphone softphone library for phonegap videophone applications.

Important

In order to use this plugin you will need to download and build the linphone iOS libraries and then add them to your phonegap project.

This is a challenging task. Start at linphone.org

This is a preliminary implementation refactored from a working project. At this point we've not taken this refactored code forward to build a working app. Useful as a reference or starting point for your own plugin. YMMV.

If there's interest we'll commit more time to enhancing and maintaining this.

Usage

<div>
    <input type="text" id="number" value="Guest" />
    <button id="call" onClick="javascript:doCall();" disabled>Call</button>
    <button id="hangup" onClick="javascript:doHangup();" disabled>Hangup</button>
    <button id="videoOn" onClick="javascript:doVideoOn();" disabled>Video On</button>
    <button id="videoOff" onClick="javascript:doVideoOff();" disabled>Video Off</button>
</div>
<script>
    // see below
</script>
    var inCall = false;
    function onCallUpdate(dict) {
        document.getElementById('call').disabled = (dict.canCall!==true);
        document.getElementById('hangup').disabled = (dict.canHangup!==true);
        document.getElementById('videoOn').disabled = (dict.canStartVideo!==true);
        document.getElementById('videoOff').disabled = (dict.canStopVideo!==true);
        inCall = (dict.canCall!==true);
        }

    function setup() {
        window.plugins.LinPhoneGap.initPhone(onCallUpdate);
        }

    function doCall() {
        var number = document.getElementById('number').value;
        window.plugins.LinPhoneGap.call(number,function(err){});
        }

    function doHangup() { window.plugins.LinPhoneGap.hangup(function(err){}); }
    function doVideoOn() { window.plugins.LinPhoneGap.videoOn(function(err){}); }
    function doVideoOff() { window.plugins.LinPhoneGap.videoOff(function(err){}); }

    /* *IMPORTANT*
    You will need to invoke the setup() function above to initialize and before use.
    Exactly how you do that will depend on your environment, frameworks and target
    browsers.
    */
    

Installation

cordova plugin add https://github.com/babelroom/LinPhoneGap.git

linphonegap's People

Contributors

johnroy avatar

Watchers

James Cloos avatar Florin Peter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.