line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::LinkEmbedder::Link::Video::Vimeo; |
2
|
1
|
|
|
1
|
|
438
|
use Mojo::Base 'Mojolicious::Plugin::LinkEmbedder::Link::Text::HTML'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has media_id => sub { |
5
|
|
|
|
|
|
|
my $self = shift; |
6
|
|
|
|
|
|
|
my $media_id = $self->url->path->[-1]; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$media_id =~ s!\.html$!!; |
9
|
|
|
|
|
|
|
$media_id; |
10
|
|
|
|
|
|
|
}; |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
0
|
1
|
|
sub provider_name {'Vimeo'} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub learn { |
15
|
0
|
|
|
0
|
1
|
|
my ($self, $c, $cb) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
return $self->SUPER::learn($c, $cb) unless $self->media_id; |
18
|
0
|
|
|
|
|
|
$self->$cb; |
19
|
0
|
|
|
|
|
|
$self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub to_embed { |
23
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
24
|
0
|
0
|
|
|
|
|
my $media_id = $self->media_id or return $self->SUPER::to_embed; |
25
|
0
|
|
|
|
|
|
my $src = Mojo::URL->new('//player.vimeo.com/video/86404451?portrait=0&color=ffffff'); |
26
|
0
|
|
|
|
|
|
my %args = @_; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
$self->_iframe( |
29
|
|
|
|
|
|
|
src => "//player.vimeo.com/video/$media_id?portrait=0&color=ffffff", |
30
|
|
|
|
|
|
|
class => 'link-embedder video-vimeo', |
31
|
|
|
|
|
|
|
width => $args{width} || 500, |
32
|
0
|
|
0
|
|
|
|
height => $args{height} || 281 |
|
|
|
0
|
|
|
|
|
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding utf8 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Mojolicious::Plugin::LinkEmbedder::Link::Video::Vimeo - vimeo.com video |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
This class inherit from L. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 media_id |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Returns the the digit from the url L. |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 provider_name |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 METHODS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 learn |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 to_embed |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Returns the HTML code for an iframe embedding this movie. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Marcus Ramberg |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |