【发布时间】:2011-05-18 15:53:00
【问题描述】:
我想使用 API 更新我在 picasa 网络相册中的视频缩略图。 我有 Photos PHP sample code 用于运行照片数据 API。
文档说我可以通过更新照片“Provide your own video thumbnail”。
我尝试了以下功能,但没有任何反应。请帮忙!
/**
* Updates photo (for changing video thumbs
*
* @param Zend_Http_Client $client The authenticated client
* @param string $user The user's account name
* @param integer $albumId The album's id
* @param integer $photoId The photo's id
* @param array $photo The uploaded photo
* @return void
*/
function updatePhoto($client, $user, $albumId, $photoId, $photo)
{
$photos = new Zend_Gdata_Photos($client);
$photoQuery = new Zend_Gdata_Photos_PhotoQuery;
$photoQuery->setUser($user);
$photoQuery->setAlbumId($albumId);
$photoQuery->setPhotoId($photoId);
$photoQuery->setType('entry');
$entry = $photos->getPhotoEntry($photoQuery);
$fd = $photos->newMediaFileSource($photo["tmp_name"]);
$fd->setContentType($photo["type"]);
$entry->setMediaSource($fd);
$entry->save();
outputPhotoFeed($client, $user, $albumId, $photoId);
}
【问题讨论】:
标签: php api picasa zend-gdata