line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::LinkEmbedder::Link::Video::Dbtv; |
2
|
1
|
|
|
1
|
|
410
|
use Mojo::Base 'Mojolicious::Plugin::LinkEmbedder::Link::Video'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has media_id => sub { |
5
|
|
|
|
|
|
|
my $self = shift; |
6
|
|
|
|
|
|
|
my $url = $self->url; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$url->query->param('vid') || $url->path->[-1]; |
9
|
|
|
|
|
|
|
}; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
1
|
|
sub provider_name {'Dagbladet'} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub learn { |
14
|
0
|
|
|
0
|
1
|
|
my ($self, $c, $cb) = @_; |
15
|
|
|
|
|
|
|
|
16
|
0
|
0
|
|
|
|
|
if ($self->media_id) { |
17
|
0
|
|
|
|
|
|
$self->$cb; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
else { |
20
|
0
|
|
|
|
|
|
$self->SUPER::learn($c, $cb); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
return $self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub pretty_url { |
27
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
28
|
0
|
0
|
|
|
|
|
my $media_id = $self->media_id or return $self->SUPER::to_embed; |
29
|
0
|
|
|
|
|
|
my $url = $self->url->clone; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
$url->fragment(undef); |
32
|
0
|
|
|
|
|
|
$url->query(vid => $media_id); |
33
|
0
|
|
|
|
|
|
$url; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub to_embed { |
37
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
38
|
0
|
|
|
|
|
|
my $src = Mojo::URL->new('http://beta.dbtv.no/player'); |
39
|
0
|
|
|
|
|
|
my %args = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
push @{$src->path}, $self->media_id; |
|
0
|
|
|
|
|
|
|
42
|
0
|
0
|
|
|
|
|
$src->query({autoplay => $args{autoplay} ? 'true' : 'false'}); |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
$self->_iframe( |
45
|
|
|
|
|
|
|
src => $src, |
46
|
|
|
|
|
|
|
class => 'link-embedder video-dbtv', |
47
|
|
|
|
|
|
|
width => $args{width} || 980, |
48
|
0
|
|
0
|
|
|
|
height => $args{height} || 551 |
|
|
|
0
|
|
|
|
|
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=encoding utf8 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Mojolicious::Plugin::LinkEmbedder::Link::Video::Dbtv - dbtv.no video |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This class inherit from L. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 media_id |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Returns the the digit from the url L. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 provider_name |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 METHODS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 learn |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head2 pretty_url |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Returns a pretty version of the L. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head2 to_embed |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Returns the HTML code for an iframe embedding this movie. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 AUTHOR |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Marcus Ramberg |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=cut |