HTML::Video::Embed - convert a url into a html embed string
#css .css-video-class{ width:570px; height:340px; } #perl use HTML::Video::Embed; my $embedder = HTML::Video::Embed->new({ 'class' => 'css-video-class', }); my $url = 'http://www.youtube.com/watch?v=HMhks1TSFog'; my $html_embed_code = $embedder->url_to_embed( $url );
$html_embed_code is now == "<iframe class="css-video-class" src="http://www.youtube.com/embed/HMhks1TSFog" frameborder="0" allowfullscreen="1"></iframe>"
my $url = 'http://this.is.not/a_supported-video_url'; my $html_embed_code = $embedder->url_to_embed( $url );
$html_embed_code is now == undef
Converts urls into html embed codes, supported sites are
Collegehumor DailyMotion EbaumsWorld FunnyOrDie Kontraband LiveLeak MetaCafe Vimeo YahooScreen Youtube Youtu.be
Takes one argument, class, which sets the css class of the video
converts a url into the html embed code
returns html on success, or undef if not supported
Please submit bugs through https://github.com/n0body-/html-video-embed/issues
For other issues, contact the maintainer
n0body <n0body@thisaintnews.com>
http://thisaintnews.com
Copyright (C) 2013 by n0body http://thisaintnews.com/
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install HTML::Video::Embed, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Video::Embed
CPAN shell
perl -MCPAN -e shell install HTML::Video::Embed
For more information on module installation, please visit the detailed CPAN module installation guide.