Thursday, 6 February 2014

Filled Under:
,

how to upload video on vimeo using php

           
              There are follow some steps you to upload a video on vimeo via the vimeo API.also you can access all of your uploaded video on vimeo.com. vimeo is a one of the power full video sharing website like youtube.


 <?php  
 require_once('vimeo.php');  
 try  
 {  
      $consumer_key = 'CONSUMER KEY HERE';  
      $consumer_secret = 'CONSUMER SECRETE HERE';  
      $oauth_access_token = 'AUTH ACCESS TOKEN HERE';  
      $oauth_request_token_secret = 'AUTH TOKEN SECRETE HERE';  
      $vimeo = new phpVimeo($consumer_key, $consumer_secret, $oauth_access_token, $oauth_request_token_secret);  
      $video_id = $vimeo->upload('VIDEO NAME HERE');  
      $videotitle = 'VIDEO TITLE HERE !';  
      $videodesc = 'VIDEO DESCRIPTION HERE !';  
      if ($video_id) {  
       $sUploadResult = 'Your video has been uploaded and available <a href="http://vimeo.com/'.$video_id.'">here</a> !';  
       $vimeo->call('vimeo.videos.setTitle', array('title' => $videotitle, 'video_id' => $video_id));  
       $vimeo->call('vimeo.videos.setDescription', array('description' => $videodesc, 'video_id' => $video_id));  
                $videourl = 'http://vimeo.com/'.$video_id;  
                     $arry['data']['flag'] = true;  
                     $arry['data']['url'] = $videourl;  
                     $arry['data']['msg'] = "Video Uploaded Successfully.";  
                 }   
                 else   
                 {  
                      $arry['data']['flag'] = false;  
                      $arry['data']['msg'] = "Not able to retrieve the video status information yet. " ."Please try again later.\n";  
                 }  
 }  
 catch(Exception $e)  
 {  
      $arry['data']['flag'] = false;  
      $arry['data']['msg'] = $e->getMessage();  
 }       
      if($video_id)  
      {  
                $arry['data']['flag'] = true;  
                $arry['data']['url'] = $videourl;  
                $arry['data']['msg'] = 'Video Uploaded Successfully.';  
      }  
      else  
      {  
           $arry['data']['flag'] = false;  
      }  
      if($arry['data']['msg'] == 'Invalid signature')  
      {  
           $arry['data']['msg'] = 'Invalid Secret or oauth_request_token_secret';  
      }  
      if($arry['data']['msg'] == 'Permission Denied')  
      {  
           $arry['data']['msg'] = 'Invalid oauth_access_token';  
      }  
      echo "<pre>";  
      print_r($arry);  
 ?>  





18 comments:

  1. Replies
    1. Dear Kailash,

      you can download vimeo.php file from this url
      http://easyscript4u.com/demo/vimeo.rar

      Enjoy......

      Delete
  2. Swoon media video production company Auckland NZ produces HD
    quality for online video marketing and video production for TVCweb site video

    ReplyDelete
  3. [msg] => Not able to retrieve the VIDEO status information yet. Please try again later.
    help please

    ReplyDelete
  4. if authentication fails, or if we have internet failure, handling error was not possible

    ReplyDelete
  5. I created the vimeo api and requested five days to approve the upload via this api will be the reason for the error below?

    Array
    (
    [data] => Array
    (
    [flag] =>
    [msg] => Cannot upload
    )

    )

    ReplyDelete
    Replies
    1. Dear ,

      first check your vimeo request is approve or rejected by vimeo.

      Delete
  6. will the same script work for video file larger than 100MB size?

    ReplyDelete
    Replies
    1. Basic members have a weekly upload limit of 500MB, and can upload video files up to 500MB each. Plus members have a weekly upload limit of 5GB, and can upload files up to 5GB each. Keep in mind that there are a million variables in video compression.

      Delete
  7. Hi Bodar from vimeo i got these two CONSUMER KEY HERE,CONSUMER SECRETE HERE but how can i get the AUTH ACCESS TOKEN HERE,AUTH TOKEN SECRETE HERE please help me to move forward

    ReplyDelete
  8. vimio.php file is not find on this link.
    http://easyscript4u.com/demo/vimeo.rar

    ReplyDelete

  9. Array
    (
    [data] => Array
    (
    [flag] =>
    [msg] => Invalid Secret or oauth_request_token_secret
    )

    )

    this message very frustating help me

    ReplyDelete
  10. also iwas unable to get oauth_access_token,oauth_request_token_secret hiow to get these things help me

    ReplyDelete
  11. unable to get oauth_access_token,oauth_request_token_secret hiow to get these things help me

    ReplyDelete