[trick] membuat aplikasi teleconfrence dengan jquery

bismillah..

langsung saja :


<!DOCTYPE html>
<html>
 <head>
 <script language="JavaScript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
 <script language="JavaScript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
 <script language="JavaScript" src="scriptcam.js"></script>
 <script language="JavaScript">
 $(document).ready(function() {
 $("#webcam").scriptcam({
 showMicrophoneErrors:false,
 onError:onError,
 cornerRadius:20,
 cornerColor:'e3e5e2',
 onWebcamReady:onWebcamReady,
 uploadImage:'upload.gif',
 onPictureAsBase64:base64_tofield_and_image
 });
 });
 function base64_tofield() {
 $('#formfield').val($.scriptcam.getFrameAsBase64());
 };
 function base64_toimage() {
 $('#image').attr("src","data:image/png;base64,"+$.scriptcam.getFrameAsBase64());
 };
 function base64_tofield_and_image(b64) {
 $('#formfield').val(b64);
 $('#image').attr("src","data:image/png;base64,"+b64);
 };
 function changeCamera() {
 $.scriptcam.changeCamera($('#cameraNames').val());
 }
 function onError(errorId,errorMsg) {
 $( "#btn1" ).attr( "disabled", true );
 $( "#btn2" ).attr( "disabled", true );
 alert(errorMsg);
 }
 function onWebcamReady(cameraNames,camera,microphoneNames,microphone,volume) {
 $.each(cameraNames, function(index, text) {
 $('#cameraNames').append( $('<option></option>').val(index).html(text) )
 });
 $('#cameraNames').val(camera);
 }
 </script>
 </head>
 <body>
 <div style="width:500px;float:left; margin-left:400px;" >
 <div id="webcam">
 </div>
 <div style="margin:5px;">


 </div>
 </div>
 </body>
</html>

hasil

 

 

Leave a comment

3 Comments

  1. itu bukan elu, des….

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: