How to upload Video to YouTube using Google API PHP Client Library and Youtube API V3?

前端 未结 2 973
庸人自扰
庸人自扰 2021-02-15 16:45

Trying to simply upload video using Google API PHP Client (latest release 1.1.6), but code in Youtube API V3 is not working and giving 500 internal server error.

What is

2条回答
  •  伪装坚强ぢ
    2021-02-15 17:30

    Strangely a very small tweak in code fixes the problem.

    Instead of just $videoPath = "/path/to/file.mp4"; using DOCUMENT_ROOT solves the issue. Other than that code of documentation is perfect.

    $videoPath = $_SERVER["DOCUMENT_ROOT"] . "/mapapp/videos/test.mp4";
    

提交回复
热议问题