views:

215

answers:

4

Hello,

I'm using Zend and PHP to upload and delete videos from my home page. The uploading part is working fine but to download is more complicated.

$videoEntryToDelete = $yt->getVideoEntry($videoId);
$yt->delete($videoEntryToDelete);

I use this code to delete a video and the first row do work. The video object is created and I can get all data from it. But when I try to delete it I get this error message: "You must specify an URI to which to post"

Do anyone know how to solve this problem?

Thanks!

A: 

I'm using a Zend class called Zend_Gdata_YouTube and create an object like this

$yt = new Zend_Gdata_YouTube($httpClient, $applicationId, $clientId, $developerKey);
Mikael
A: 

By default, getVideoEntry() gets a read only video object. In order to edit it, you must pass true in the third parameter for getVideoEntry(). The video object will then contain all of the metadata, including the URL required to delete it.

Try this:

$videoEntryToDelete = $yt->getVideoEntry($videoId, null, true);
$yt->delete($videoEntryToDelete);
Marcus Adams
A: 

Now I think it works.

Thank you!

Mikael
A: 

MAny thanks !!!!!!!!!!!!!!!!!!!!

Janray thomas