NAME

WebService::GData::YouTube::Feed::Video - a Video YouTube contents(read/write) for data API v2.

SYNOPSIS

    use WebService::GData::YouTube;

    #create an object that only has read access
    my $yt = new WebService::GData::YouTube();

    #get a feed response from YouTube;
    my $videos  = $yt->get_top_rated;
    #more specific:
    my $videos  = $yt->get_top_rated('JP','Comedy');

    foreach my $video (@$videos) {
        say $video->video_id;
        say $video->title;
        say $video->content;
        say $video->view_count;
        say $video->favorite_count;
        say $video->duration;
		#...etc
    }

    #connect to a YouTube account
    my $auth = new WebService::GData::ClientLogin(
        email=>'...'
        password=>'...',
        key        =>'...'
    );

    #give write access with a $auth object that you created
    my $yt = new WebService::GData::YouTube($auth);

    my $videos  = $yt->get_user_videos();#returns videos from the loggedin user even if private

    #update the playlist by adding the playlist title as a keyword
    foreach my $video (@$videos) {

        if($video->video_id eq $myid) {

            $video->delete();

        }else {

            if($video->is_listing_allowed){

                $video->kewords($playlist->title.','.$video->keywords);
                $video->save();
            }
        }
    }
	 

DESCRIPTION

!WARNING! Documentation in progress.

!DEVELOPER RELEASE! API may change, program may break or be under optimized.

inherits from WebService::GData::Feed::Entry.

This package represents a Youtube Video. If you are logged in you can edit existing video metadata,create new metadata, upload videos.

Most of the time you will not instantiate this class directly but use some of the helpers in the WebService::GData::YouTube class.

See also:

CONSTRUCTOR

new

Parameters:

jsonc_video_entry_feed:Object (Optional)
authorization:Object (Optional)

or

authorization:Object (Optional)

If an authorization object is set (WebService::GData::ClientLogin),

it will allow you to access private contents and insert/edit/delete/upload videos.

GET METHODS

All the following read only methods give access to the information contained in a video feed.

view_count

favorite_count

media_player

aspect_ratio

duration

content

comments

thumbnails

uploaded

etag

appcontrol_state

denied_countries

restriction

rating

uploader

recorded

genre

is_read_only

GENERAL SET/GET METHODS

All these methods represents information about the video but you have read/write access on them.

It is therefore necessary to be logged in programmaticly to be able to use them in write mode (if not, saving the data will not work).

title

video_id

category

description

keywords

location

ACCESS CONTROL SET/GET METHODS

These methods allow to grant access to certain activity.

You can decide to unlist the video from the search, make it private or forbid comments,etc.

is_private

access_control

    The access control gives you access to the list of access for a video.

    Parameters

    none - getter context

    Returns

    WebService::GData::Collection - collection of WebService::GData::YouTube::YT::AccessControl instances

    Parameters

    access_name:Scalar - a particular access object

    Returns

    WebService::GData::YouTube::YT::AccessControl instance

    Parameters

    access_name:Scalar - a particular access object
    control_type:Scalar - the value to set the permission

    Returns

    void

    Example:

    my $controls   = $video->access_control;
    foreach my $control (@$controls) {
    	$control->action.'->'.$control->permission;
    }
    
    my $control   = $video->access_control('comment')->permission;#default:allowed
    
    $video->access_control('comment','denied');
    
    $video->access_control('comment')->permission; #denied

The following methods are helpers that allows know which access control is allowed. It is therefore a shortcut for the following checking:

$video->access_control('comment')->permission eq 'allowed'

is_listing_allowed

is_comment_allowed

is_comment_vote_allowed

is_video_response_allowed

is_rating_allowed

is_embedding_allowed

is_syndication_allowed

VIDEO QUERY METHODS

These methods actually query the service to save your edits.

You must be logged in programmaticly to be able to use them.

The save method will do an insert if there is no video_id or an update if there is one.

delete

save

These methods actually query the service to save your edits.

You must be logged in programmaticly to be able to use them and have a video_id already set.

Most of the time you will use their counterpart in the WebService::GData::YouTube package as they are shorter.

rate

This will add a rating to the video. It uses the like/dislike system only:

$video->rate('like');
$video->rate('dislike');

add_video_response

You can add a video response to a video by specifying an other video object.

$response_video->id('response_video_id');

$video->add_video_response($response_video);

delete_video_response

$video->delete_video_response('response_video_id');

add_favorite_video

$video->id('video_id');
$video->add_favorite_video(); 

or 

$video->add_favorite_video('video_id');#helper that set the $video->id('video_id')     

CONFIGURATION AND ENVIRONMENT

none

DEPENDENCIES

JSON

LWP

INCOMPATIBILITIES

none

BUGS AND LIMITATIONS

If you do me the favor to _use_ this module and find a bug, please email me i will try to do my best to fix it (patches welcome)!

AUTHOR

shiriru <shirirulestheworld[arobas]gmail.com>

LICENSE AND COPYRIGHT

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.