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