Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle API's php client library - YouTube chunked upload ERROR
    primarykey
    data
    text
    <p>I'm using Google API's PHP client library and when I use this solution:</p> <p><a href="https://stackoverflow.com/a/14552052/1181479">https://stackoverflow.com/a/14552052/1181479</a> and the same as here <a href="https://developers.google.com/youtube/v3/code_samples/php#resumable_uploads" rel="nofollow noreferrer">https://developers.google.com/youtube/v3/code_samples/php#resumable_uploads</a></p> <p>witch contain such logic:</p> <pre><code>if ($client-&gt;getAccessToken()) { $videoPath = "path/to/foo.mp4"; $snippet = new Google_VideoSnippet(); $snippet-&gt;setTitle("Test title2"); $snippet-&gt;setDescription("Test descrition"); $snippet-&gt;setTags(array("tag1", "tag2")); $snippet-&gt;setCategoryId("22"); $status = new Google_VideoStatus(); $status-&gt;privacyStatus = "private"; $video = new Google_Video(); $video-&gt;setSnippet($snippet); $video-&gt;setStatus($status); $chunkSizeBytes = 1 * 1024 * 1024; $media = new Google_MediaFileUpload('video/mp4', null, true, $chunkSizeBytes); $media-&gt;setFileSize(filesize($videoPath)); $result = $youtube-&gt;videos-&gt;insert("status,snippet", $video, array('mediaUpload' =&gt; $media)); $status = false; $handle = fopen($videoPath, "rb"); while (!$status &amp;&amp; !feof($handle)) { $chunk = fread($handle, $chunkSizeBytes); $uploadStatus = $media-&gt;nextChunk($result, $chunk); } fclose($handle); } </code></pre> <p>The main problem is this error:</p> <blockquote> <p>ErrorException [ Recoverable Error ]: Argument 1 passed to Google_MediaFileUpload::nextChunk() must be an instance of Google_HttpRequest, instance of Google_Video given, called in /opt/code/host/resulinkpro/www/application/classes/Controller/Upload.php on line 132 and defined</p> </blockquote> <p>the core of that stuff is: <strong>$media</strong> is Google_Video class and </p> <pre><code>$media-&gt;nextChunk($result, $chunk); </code></pre> <p>requires <strong>$result</strong> to be Google_HttpRequest SO Google documentation and any example in web will not help to achieve that task at all! Last chance on you guys! Thank you!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload