NAME
HTML::Video::Embed - convert a url into a html embed string
SYNOPSIS
#css
.css-video-class{
width:570px;
height:340px;
}
#perl
use HTML::Video::Embed;
my $embedder = HTML::Video::Embed->new({
class => 'css-video-class',
secure => 1
});
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="https://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
DESCRIPTION
Converts urls into html embed codes, supported sites are
Collegehumor
DailyMotion
EbaumsWorld
FunnyOrDie
Kontraband
LiveLeak
MetaCafe
Vimeo
YahooScreen
Youtube
Youtu.be
METHODS
new
Takes two arguments
class
sets the css class of the video
secure
if true, will return a url with the https scheme, or undef if the site doesn't support secure embedding
url_to_embed
converts a url into the html embed code
returns html on success, or undef if not supported
AUTHORS
Mark Ellis <markellis@cpan.org>
SEE ALSO
LICENSE
Copyright 2014 Mark Ellis <markellis@cpan.org>
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.