Jifty::Plugin::YouTube - YouTube Plugin
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 { show '/youtube_widget','http://www.youtube.com/watch?v=4oWbzT_oAJ0'; # or show '/youtube_widget','4oWbzT_oAJ0'; };
Or by given url:
http://your.app/youtube/4oWbzT_oAJ0
You can override the page wrapper by declaring a template called /_youtube
/_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; }; };
Cornelius <cornelius.howl@gmail.com>
<cornelius.howl@gmail.com
To install Jifty::Plugin::YouTube, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Jifty::Plugin::YouTube
CPAN shell
perl -MCPAN -e shell install Jifty::Plugin::YouTube
For more information on module installation, please visit the detailed CPAN module installation guide.