Basic PHP Vimeo Advanced API Call

前端 未结 2 1433

This is a self Q&A.

I\'ve often looked around for help on using the Vimeo API, and always found the entry level examples and documentation very

2条回答
  •  囚心锁ツ
    2020-12-16 21:46

    Visite https://github.com/leandrocfe/PHPVimeoAPI_List_Private_Video

    List private videos from Vimeo | Access private videos

    1. Modify config.json info vimeo account;
    2. Access video.php and add vimeo_video_id get param. Ex: localhost/vimeo/video.php?id=123123123

      request("/me/videos/$id");
      
          //iframe vídeo
          $embed = $me["body"]["embed"]["html"];
      
          //edit video size
          $default_size = 'width="'.$me["body"]["width"].'" height="'.$me["body"]["height"].'"';
          $new_size = 'width="420" height="220"';
      
          $embed = str_replace($default_size, $new_size, $embed);
      
          //autoplay
          $embed = str_replace('player_id=0', 'player_id=0&autoplay=1', $embed);
      
      }else{
      
          echo("Not find get id video");
      }
      ?>
      
      
          
              Vimeo Vídeo
          
          
              

      Name:

      Description:

      Link:

      Likes:

      Data Created:

      Data Modified:

      Images: | | | | | |

提交回复
热议问题