/[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

trunk/lib/Frey/Web/Flowplayer.pm revision 809 by dpavlin, Thu Dec 11 20:18:28 2008 UTC trunk/lib/Frey/Web/FLVPlayer.pm revision 846 by dpavlin, Mon Dec 15 18:42:48 2008 UTC
# Line 1  Line 1 
1  package Frey::Web::Flowplayer;  package Frey::Web::FLVPlayer;
2  use Moose;  use Moose;
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    
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 player_swf => (
23            is => 'rw',
24            isa => 'Str',
25            required => 1,
26            default => 'http://flv-player.net/medias/player_flv_maxi.swf',
27  );  );
28    
29  sub as_markup {  sub as_markup {
30          my ($self) = @_;          my ($self) = @_;
31    
32          warn $self->skeleton;          my $path = $self->path;
33            die "can't find $path" unless -e $path;
34    
35            my $url = "http://localhost:3000/$path"; # FIXME
36    
37            my $swf = $self->player_swf;
38    
39            my %info = $self->flv_info;
40            warn "# info ", $self->dump( \%info );
41    
42            my $width  = $info{meta_width};
43            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  <!-- include the only required JavaScript file -->                  </object>
 <script src="http://static.flowplayer.org/js/flowplayer-3.0.1.min.js"></script>      
   
 <!--    
    Setup player with standard HTML syntax  
       * movie file is specified in "href" attribute    
       * player dimensions are defined with CSS    
 -->  
 <a    
     href="http://blip.tv/file/get/KimAronson-TwentySeconds4461.flv"    
     style="display:block;width:425px;height:300px;"    
     id="player">  
 </a>  
   
 <!-- this script block will install Flowplayer inside previous anchor tag -->  
 <script language="JavaScript">  
     flowplayer("player", "http://static.flowplayer.org/swf/flowplayer-3.0.1.swf");  
 </script>  
50          |;          |;
51    
52  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26