Return to Snippet

Revision: 52895
at November 4, 2011 07:27 by parkerkrhoyt


Initial Code
$( '#record' )
.bind( 'touchstart', function( e ) {
  if( media == null )
  {
    $( this ).attr( 'src', 'assets/record.down.png' );     
  } else {
    $( this ).attr( 'src', 'assets/stop.down.png' );      
  }
} )
.bind( 'touchend', function( e ) { 
  $( this ).attr( 'src', 'assets/stop.up.png' );
    
  if( media == null )
  {
    media = new Media( reference, function() {
      // alert( 'Got media' );
    }, function( err ) {
      // alert( 'Problems accessing media' );
    } );
    
    media.startRecord();      
  } else {
    media.stopRecord();
    media.release();
    media = null;
      
    $( this ).attr( 'src', 'assets/record.up.png' );
  }
} );

Initial URL


Initial Description


Initial Title
Record Audio with PhoneGap

Initial Tags
phone, mobile

Initial Language
JavaScript