public String uploadVideo(Context context,Uri videoUri){
  String filePath=VideoMediaStoreUtils.getPath(context,videoUri);
  Video androidVideo=VideoMediaStoreUtils.getVideo(context,filePath);
  if (androidVideo != null) {
    File videoFile=new File(filePath);
    if (videoFile.length() < Constants.MAX_SIZE_MEGA_BYTE) {
      try {
        Video receivedVideo=mVideoServiceProxy.addVideo(androidVideo);
        if (receivedVideo != null) {
          VideoStatus status=mVideoServiceProxy.setVideoData(receivedVideo.getId(),new TypedFile(receivedVideo.getContentType(),videoFile));
          if (status.getState() == VideoState.READY) {
            return STATUS_UPLOAD_SUCCESSFUL;
          }
        }
      }
 catch (      Exception e) {
        return STATUS_UPLOAD_ERROR;
      }
    }
 else     return STATUS_UPLOAD_ERROR_FILE_TOO_LARGE;
  }
  return STATUS_UPLOAD_ERROR;
}

public String uploadVideo ( Context context , Uri videoUri ) { String filePath = VideoMediaStoreUtils . getPath ( context , videoUri ) ; Video androidVideo = VideoMediaStoreUtils . getVideo ( context , filePath ) ; if ( androidVideo != null ) { File videoFile = new File ( filePath ) ; if ( videoFile . length ( ) < Constants . MAX_SIZE_MEGA_BYTE ) { try { Video receivedVideo = mVideoServiceProxy . addVideo ( androidVideo ) ; if ( receivedVideo != null ) { VideoStatus status = mVideoServiceProxy . setVideoData ( receivedVideo . getId ( ) , new TypedFile ( receivedVideo . getContentType ( ) , videoFile ) ) ; if ( status . getState ( ) == VideoState . READY ) { return STATUS_UPLOAD_SUCCESSFUL ; } } } catch ( Exception e ) { return STATUS_UPLOAD_ERROR ; } } else return STATUS_UPLOAD_ERROR_FILE_TOO_LARGE ; } return STATUS_UPLOAD_ERROR ; }
uploads the video having the given id . this id is the id of video in android video content provider .
