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