3 |
|
|
4 |
=head1 SEE ALSO |
=head1 SEE ALSO |
5 |
|
|
6 |
L<http://flowplayer.org/documentation/installation.html> |
L<http://flv-player.net/> |
7 |
|
|
8 |
=cut |
=cut |
9 |
|
|
19 |
default => 'var/flv/codeswarm.flv', |
default => 'var/flv/codeswarm.flv', |
20 |
); |
); |
21 |
|
|
22 |
has flowplayer_js => ( |
has player_swf => ( |
23 |
is => 'rw', |
is => 'rw', |
24 |
isa => 'Str', |
isa => 'Str', |
25 |
required => 1, |
required => 1, |
26 |
default => 'http://static.flowplayer.org/js/flowplayer-3.0.1.min.js', |
default => 'http://flv-player.net/medias/player_flv_maxi.swf', |
|
); |
|
|
|
|
|
has flowplayer_swf => ( |
|
|
is => 'rw', |
|
|
isa => 'Str', |
|
|
required => 1, |
|
|
default => 'http://static.flowplayer.org/swf/flowplayer-3.0.1.swf', |
|
27 |
); |
); |
28 |
|
|
29 |
sub as_markup { |
sub as_markup { |
34 |
|
|
35 |
my $url = "http://localhost:3000/$path"; # FIXME |
my $url = "http://localhost:3000/$path"; # FIXME |
36 |
|
|
37 |
$self->add_js( $self->flowplayer_js ); |
my $swf = $self->player_swf; |
|
my $swf = $self->flowplayer_swf; |
|
38 |
|
|
39 |
my %info = $self->flv_info; |
my %info = $self->flv_info; |
40 |
warn "# info ", $self->dump( \%info ); |
warn "# info ", $self->dump( \%info ); |
43 |
my $height = $info{meta_height}; |
my $height = $info{meta_height}; |
44 |
|
|
45 |
qq| |
qq| |
46 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
<object type="application/x-shockwave-flash" data="$swf" width="$width" height="$height"> |
47 |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<param name="movie" value="$swf" /> |
48 |
|
<param name="FlashVars" value="flv=$url" /> |
49 |
<!-- |
</object> |
|
Setup player with standard HTML syntax |
|
|
* movie file is specified in "href" attribute |
|
|
* player dimensions are defined with CSS |
|
|
--> |
|
|
<a |
|
|
href="$url" |
|
|
style="display:block;width:${width}px;height:${height}px;" |
|
|
id="player"> |
|
|
</a> |
|
|
|
|
|
<!-- this script block will install Flowplayer inside previous anchor tag --> |
|
|
<script language="JavaScript"> |
|
|
flowplayer("player", "$swf"); |
|
|
</script> |
|
50 |
|; |
|; |
51 |
|
|
52 |
} |
} |