JSFiddle - React, Tailwind, and code Playground

by edskeizer

HTML

<script src="http://s.phono.com/releases/1.1/jquery.phono.min.js"></script>
<input id="call" type="button" disabled="true" value="Loading..." />
    <span id="status"></span>

JavaScript

$(document).ready(function(){
      var phono = $.phono({
        apiKey: "cff0bcbbbadf436c66b3d1bb5fe51ed0",
        onReady: function() {
          $("#call").attr("disabled", false).val("Call");
        }
      });

      $("#call").click(function() {
        $("#call").attr("disabled", true).val("Busy");
        phono.phone.dial("+318001424", {
          onRing: function() {
            $("#status").html("Ringing");
          },
          onAnswer: function() {
            $("#status").html("Answered");
          },
          onHangup: function() {
            $("#call").attr("disabled", false).val("Call");
            $("#status").html("Hangup");
          }
        });
      });
    })