0

ビデオ エントリで getEditLink() を使用すると、接続しているユーザーがビデオの作成者であっても、常に null になります。

// $this->yt_user is the Zend_Gdata_YouTube object that is connected
//    to the API using the user's session token. This same object was
//    used to upload the video to the user's account.
// $input['get'] is sanitized $_GET. The id value is the video's ID
//    sent by Youtube after a video upload from the browser.

$videoEntry = $this->yt_user->getVideoEntry($input['get']['id']);

var_export($videoEntry->getEditLink());

var_export($videoEntry) を呼び出すことで、$videoEntry が有効な動画であることを確認できます。

アップロード後にビデオを編集できるようにする必要がありますが、getEditLink() は常に null であるため、$videoEntry->getEditLink()->getHref(); を呼び出すことができません。

4

1 に答える 1

0

質問へのコメントのおかげで答えが見つかりました。

getVideoEntry()では、編集可能なビデオエントリを返すために、3番目の引数がtrueである必要があります。

$videoEntry = $this->yt_user->getVideoEntry($input['get']['id'], null, true);

私が読んだ例のどれもこれを示していませんでした(主にGoogleのドキュメントまたはZendのドキュメントから)。彼らは最初の議論だけを示した。

于 2013-03-21T20:31:25.463 に答える