php - Updating Picasa Video Thumbnails Using Zend GData Picasa API -
i want update thumbnail of video in picasa web albums using api. i've got photos php sample code photos data api running.
the documentation says can "provide own video thumbnail" updating photo.
i've tried following function nothing happens. please help!
/** * updates photo (for changing video thumbs * * @param zend_http_client $client authenticated client * @param string $user user's account name * @param integer $albumid album's id * @param integer $photoid photo's id * @param array $photo 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); }
i right, updated code works...
/** * updates photo (for changing video thumbs * * @param zend_http_client $client authenticated client * @param string $user user's account name * @param integer $albumid album's id * @param integer $photoid photo's id * @param array $photo 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); $uri = $entry->getlink("edit-media")->href; $fd = $photos->newmediafilesource($photo["tmp_name"]); $fd->setcontenttype($photo["type"]); $entry->setmediasource($fd); $result = $entry->save($uri); if ($result) { outputphotofeed($client, $user, $albumid, $photoid); } else { echo "there issue upating photo."; } }
see 'updating thumbnails of picasa web videos' full code , working example.
Comments
Post a Comment