10 |
extends 'Frey'; |
extends 'Frey'; |
11 |
with 'Frey::Web'; |
with 'Frey::Web'; |
12 |
#with 'Frey::Storage'; |
#with 'Frey::Storage'; |
13 |
|
with 'Frey::File::FLV'; |
14 |
|
|
15 |
has flv => ( |
has path => ( |
16 |
is => 'rw', |
is => 'rw', |
17 |
isa => 'Str', |
isa => 'Str', |
18 |
required => 1, |
required => 1, |
36 |
sub as_markup { |
sub as_markup { |
37 |
my ($self) = @_; |
my ($self) = @_; |
38 |
|
|
39 |
my $flv = $self->flv; |
my $path = $self->path; |
40 |
die "can't find $flv" unless -e $flv; |
die "can't find $path" unless -e $path; |
41 |
|
|
42 |
$flv = "http://localhost:3000/$flv"; |
my $url = "http://localhost:3000/$path"; # FIXME |
43 |
|
|
44 |
$self->add_js( $self->flowplayer_js ); |
$self->add_js( $self->flowplayer_js ); |
45 |
my $swf = $self->flowplayer_swf; |
my $swf = $self->flowplayer_swf; |
46 |
|
|
47 |
|
my %info = $self->flv_info; |
48 |
|
warn "# info ", $self->dump( \%info ); |
49 |
|
|
50 |
|
my $width = $info{meta_width}; |
51 |
|
my $height = $info{meta_height}; |
52 |
|
|
53 |
qq| |
qq| |
54 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
55 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
60 |
* player dimensions are defined with CSS |
* player dimensions are defined with CSS |
61 |
--> |
--> |
62 |
<a |
<a |
63 |
href="$flv" |
href="$url" |
64 |
style="display:block;width:425px;height:300px;" |
style="display:block;width:${width}px;height:${height}px;" |
65 |
id="player"> |
id="player"> |
66 |
</a> |
</a> |
67 |
|
|