PHP - How to change privacy status of a youtube video through Youtube API v3?

ricopo

I need to know how can I change the privacy status of a youtube video. The video have 'unlisted' privacy status and I want to change to 'public'.

Here there is an example to add some tags to video but i don't know how to apply the example for update privacy status. Thank you!

Saumini Navaratnam

I have set the privacy status when uploading video to YouTube. I believe it similar for updating the video also.

I didn't test the following code. But I hope you can give a shot.

First you retrieve the video status property.

$listResponse = $youtube->videos->listVideos('status', array('id' => $videoId));

Then you get the video status property

$video = $listResponse[0];
$videoStatus = $video['status'];

Then you set the video status. Valid values are 'private', 'public', 'unlisted'.

$videoStatus->privacyStatus = 'public';

Finally you update the status & then video

$video->setStatus($videoStatus);
$updateResponse = $youtube->videos->update('status', $video);

Hope this will help you

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How to find if video is syndicated on YouTube data api v3

分類Dev

Youtube v3 API video language

分類Dev

PHP server-side YouTube V3 OAuth API video upload for different users

分類Dev

Enabling and disabling comments on youtube video through api

分類Dev

How to detect youtube pay videos using api v3

分類Dev

Youtube API v3 get comments

分類Dev

How do I get a YouTube video thumbnail from the YouTube API?

分類Dev

Ruby + Youtube Data API v3 Getting video info slow

分類Dev

Unable to delete a youtube playlist using youtube api v3

分類Dev

youtube video downloader with php

分類Dev

Given the video ID, how to get it's title using YouTube Data API v.3

分類Dev

Get youtube title from videoid in PHP using API v3

分類Dev

Youtube data api v3 - how to ask for only a part of snippet in playlists?

分類Dev

How to receive & process data when I subscribe to youtube api v3 push notification?

分類Dev

How to query / retrieve keywords using YouTube Data API (v3)

分類Dev

Javascript n00b - Get YouTube API v3 Video Description instead of Title (existing code)

分類Dev

YouTube API V3の使用方法は?

分類Dev

Unable to download closed captions in Youtube API v3

分類Dev

android youtube api v3 not work on release version

分類Dev

Error using youtube API V3 for C#

分類Dev

Youtube v3 API - pageToken doesn't work

分類Dev

Inserting Json from YouTube API v3 into MySQL

分類Dev

How to autoplay a YouTube video in a UIWebView

分類Dev

How to loop an embeded YouTube video?

分類Dev

YouTube Data API (v3) : Does Google OAuth2 authorization for YouTube uploads retrieval?

分類Dev

If user video removed from youtube , how do I change featured video to newest uploaded video on my website?

分類Dev

YouTube API v3、会社のYouTubeアカウントのiOSアプリ認証

分類Dev

Youtube API V3 GETバナー画像とPHP(未定義のインデックス)

分類Dev

How to stop a youtube video from playing

Related 関連記事

  1. 1

    How to find if video is syndicated on YouTube data api v3

  2. 2

    Youtube v3 API video language

  3. 3

    PHP server-side YouTube V3 OAuth API video upload for different users

  4. 4

    Enabling and disabling comments on youtube video through api

  5. 5

    How to detect youtube pay videos using api v3

  6. 6

    Youtube API v3 get comments

  7. 7

    How do I get a YouTube video thumbnail from the YouTube API?

  8. 8

    Ruby + Youtube Data API v3 Getting video info slow

  9. 9

    Unable to delete a youtube playlist using youtube api v3

  10. 10

    youtube video downloader with php

  11. 11

    Given the video ID, how to get it's title using YouTube Data API v.3

  12. 12

    Get youtube title from videoid in PHP using API v3

  13. 13

    Youtube data api v3 - how to ask for only a part of snippet in playlists?

  14. 14

    How to receive & process data when I subscribe to youtube api v3 push notification?

  15. 15

    How to query / retrieve keywords using YouTube Data API (v3)

  16. 16

    Javascript n00b - Get YouTube API v3 Video Description instead of Title (existing code)

  17. 17

    YouTube API V3の使用方法は?

  18. 18

    Unable to download closed captions in Youtube API v3

  19. 19

    android youtube api v3 not work on release version

  20. 20

    Error using youtube API V3 for C#

  21. 21

    Youtube v3 API - pageToken doesn't work

  22. 22

    Inserting Json from YouTube API v3 into MySQL

  23. 23

    How to autoplay a YouTube video in a UIWebView

  24. 24

    How to loop an embeded YouTube video?

  25. 25

    YouTube Data API (v3) : Does Google OAuth2 authorization for YouTube uploads retrieval?

  26. 26

    If user video removed from youtube , how do I change featured video to newest uploaded video on my website?

  27. 27

    YouTube API v3、会社のYouTubeアカウントのiOSアプリ認証

  28. 28

    Youtube API V3 GETバナー画像とPHP(未定義のインデックス)

  29. 29

    How to stop a youtube video from playing

ホットタグ

アーカイブ