/[Frey]/trunk/lib/Frey/Web/FLVPlayer.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

Diff of /trunk/lib/Frey/Web/FLVPlayer.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 809 by dpavlin, Thu Dec 11 20:18:28 2008 UTC revision 825 by dpavlin, Fri Dec 12 23:20:33 2008 UTC
# Line 10  L<http://flowplayer.org/documentation/in Line 10  L<http://flowplayer.org/documentation/in
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 skeleton => (  has path => (
16          is => 'rw',          is => 'rw',
17          isa => 'Str',          isa => 'Str',
18          required => 1,          required => 1,
19          default => 'skeleton',          default => 'var/flv/codeswarm.flv',
20    );
21    
22    has flowplayer_js => (
23            is => 'rw',
24            isa => 'Str',
25            required => 1,
26            default => 'http://static.flowplayer.org/js/flowplayer-3.0.1.min.js',
27    );
28    
29    has flowplayer_swf => (
30            is => 'rw',
31            isa => 'Str',
32            required => 1,
33            default => 'http://static.flowplayer.org/swf/flowplayer-3.0.1.swf',
34  );  );
35    
36  sub as_markup {  sub as_markup {
37          my ($self) = @_;          my ($self) = @_;
38    
39          warn $self->skeleton;          my $path = $self->path;
40            die "can't find $path" unless -e $path;
41    
42            my $url = "http://localhost:3000/$path"; # FIXME
43    
44            $self->add_js( $self->flowplayer_js );
45            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">
56    
 <!-- include the only required JavaScript file -->  
 <script src="http://static.flowplayer.org/js/flowplayer-3.0.1.min.js"></script>      
   
57  <!--    <!--  
58     Setup player with standard HTML syntax     Setup player with standard HTML syntax
59        * movie file is specified in "href" attribute          * movie file is specified in "href" attribute  
60        * player dimensions are defined with CSS          * player dimensions are defined with CSS  
61  -->  -->
62  <a    <a  
63      href="http://blip.tv/file/get/KimAronson-TwentySeconds4461.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    
68  <!-- this script block will install Flowplayer inside previous anchor tag -->  <!-- this script block will install Flowplayer inside previous anchor tag -->
69  <script language="JavaScript">  <script language="JavaScript">
70      flowplayer("player", "http://static.flowplayer.org/swf/flowplayer-3.0.1.swf");      flowplayer("player", "$swf");
71  </script>  </script>
72          |;          |;
73    

Legend:
Removed from v.809  
changed lines
  Added in v.825

  ViewVC Help
Powered by ViewVC 1.1.26