From Code to Community: Sponsoring The Perl and Raku Conference 2025 Learn more

NAME

Jifty::Plugin::YouTube - YouTube Plugin

SYNOPSIS

To use YouTube plugin, insert the below config to your etc/config.yml

Plugins:
- YouTube: {}

You can write render_as 'Jifty::Plugin::YouTube::Widget' in your model schema:

column url =>
type is 'varchar',
render_as 'Jifty::Plugin::YouTube::Widget';

then render the action:

my $foo = Jifty->web->new_action(
class => 'UpdateFoo',
moniker => "update-foo",
record => $record->id,
);
render_action( $foo => ['url'] );

If the column contains a youtube url or a hash code, then the video will be rendered.

Or you can just display a Youtube Widget in Template::Declare:

template 'index.html' => page {
# or
show '/youtube_widget','4oWbzT_oAJ0';
};

Or by given url:

You can override the page wrapper by declaring a template called /_youtube

template '/_youtube' => page {
my $self = shift;
my $hash = get('hash');
return unless( $hash ) ;
h1 { { id is 'banner' };
_('Your Page Wrapper');
};
div { { class is 'youtube-wrapper' };
show '/youtube_widget', $hash;
};
};

DESCRIPTION

AUTHOR

Cornelius <cornelius.howl@gmail.com>