Skip to content

Instantly share code, notes, and snippets.

@ctaloi
Forked from chrismatthieu/gist:1670592
Created June 28, 2012 16:38
Show Gist options
  • Save ctaloi/3012388 to your computer and use it in GitHub Desktop.
Save ctaloi/3012388 to your computer and use it in GitHub Desktop.
Phono 0.3 Java Applet
<html>
<head>
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script src="http://s.phono.com/releases/0.3/jquery.phono.js"></script>
</head>
<body>
<input id="call" type="button" disabled="true" value="Loading..." />
<span id="status"></span>
<script>
$(document).ready(function(){
var phono = $.phono({
apiKey: "YOUR_KEY_GOES_HERE",
audio: {type:'java',
jar:"http://s.phono.com/releases/0.3/plugins/audio/phono.audio.jar"},
onReady: function(event) {
$("#call").attr("disabled", false).val("Call");
}
});
$("#call").click(function() {
$("#call").attr("disabled", true).val("Busy");
phono.phone.dial("985-655-2500", {
onRing: function() {
$("#status").html("Ringing");
},
onAnswer: function() {
$("#status").html("Answered");
},
onHangup: function() {
$("#call").attr("disabled", false).val("Call");
$("#status").html("Hangup");
}
});
});
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment