/[Frey]/trunk/lib/Frey/Web/Flowplayer.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Frey/Web/Flowplayer.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 814 - (show annotations)
Thu Dec 11 21:07:52 2008 UTC (15 years, 4 months ago) by dpavlin
File size: 1353 byte(s)
add attributes
1 package Frey::Web::Flowplayer;
2 use Moose;
3
4 =head1 SEE ALSO
5
6 L<http://flowplayer.org/documentation/installation.html>
7
8 =cut
9
10 extends 'Frey';
11 with 'Frey::Web';
12 #with 'Frey::Storage';
13
14 has flv => (
15 is => 'rw',
16 isa => 'Str',
17 required => 1,
18 default => 'var/flv/strix-2005-2008-codeswarm.flv',
19 );
20
21 has flowplayer_js => (
22 is => 'rw',
23 isa => 'Str',
24 required => 1,
25 default => 'http://static.flowplayer.org/js/flowplayer-3.0.1.min.js',
26 );
27
28 has flowplayer_swf => (
29 is => 'rw',
30 isa => 'Str',
31 required => 1,
32 default => 'http://static.flowplayer.org/swf/flowplayer-3.0.1.swf',
33 );
34
35 sub as_markup {
36 my ($self) = @_;
37
38 my $flv = $self->flv;
39 die "can't find $flv" unless -e $flv;
40
41 $flv = "http://localhost:3000/$flv";
42
43 $self->add_js( $self->flowplayer_js );
44 my $swf = $self->flowplayer_swf;
45
46 qq|
47 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
48 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
49
50 <!--
51 Setup player with standard HTML syntax
52 * movie file is specified in "href" attribute
53 * player dimensions are defined with CSS
54 -->
55 <a
56 href="$flv"
57 style="display:block;width:425px;height:300px;"
58 id="player">
59 </a>
60
61 <!-- this script block will install Flowplayer inside previous anchor tag -->
62 <script language="JavaScript">
63 flowplayer("player", "$swf");
64 </script>
65 |;
66
67 }
68
69 1;

  ViewVC Help
Powered by ViewVC 1.1.26