Thursday, March 31, 2011

[YouTube-API] Re: Change permissions after upload

Hello,

What does the code for "# apply the setting to this video" look like?

You should be able to turn on request logging in the PHP client
library using

$yt->enableRequestDebugLogging('/tmp/foo.txt');

where $yt is your Zend_Gdata_YouTube object and /tmp/foo.txt is
whatever file you want to log to. If you turn that on and look at the
request body that's being sent when you update the video, what does it
look like? If there's no obvious problem with it, could you pass it
along so that we could look into it further?

Cheers,
-Jeff Posnick, YouTube API Team
~ YouTube is hiring! ~ http://google.com/jobs/workyoutube ~


On Mar 28, 7:03 am, hockeyshooter <c.p.valent...@open.ac.uk> wrote:
> Am trying to use the Zend PHP library to change the permissions of a
> video or number of videos after uploading. Would like to be able to
> turn off "rate", "comment", "commentVote", "videoRespond", "embed" and
> "syndicate" but although I'm not getting any errors, the permissions
> are not being changed. Having authenticated (which I know is working
> since I can upload), this is the code I'm trying:
>
> $videoFeed=$yt->getuserUploads('my username'); # all videos in our
> Channel
> $actions = array("rate", "comment", "commentVote", "videoRespond",
> "embed", "syndicate");
> foreach ($videoFeed as $videoEntry) {
>   foreach($actions as $action) {
>     echo "<li> setting '".$action."' for video ".$videoEntry->getVideoId()."</li>\n";
>
>     $accessControlElement = new
> Zend_Gdata_App_Extension_Element('yt:accessControl', 'yt', 'http://
> gdata.youtube.com/schemas/2007', '');
>     $accessControlElement->extensionAttributes = array(
>       array(
>         'namespaceUri' => '',
>         'name' => 'action',
>         'value' => '$action'),
>       array('namespaceUri' => '',
>         'name' => 'permission',
>         'value' => 'denied')
>       );
>     $videoEntry->extensionElements = array($accessControlElement); #
> apply the setting to this video
>   }
>
> }
>
> PHP is 5.3.0, Zend is version 1.11.4 Release (r23791). Any ideas?

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment