Merge branch 'master' of github.com:dpavlin/HTML5TV
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 15 Oct 2009 11:46:22 +0000 (13:46 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 15 Oct 2009 11:46:22 +0000 (13:46 +0200)
bin/mplayer.pl
media/kca2009-ZFS_the_next_word/hCalendar.html [new file with mode: 0644]
media/kca2009-ZFS_the_next_word/www [new file with mode: 0644]

index a12309e..9d23196 100755 (executable)
@@ -36,6 +36,7 @@ my $pid = open3( $to_mplayer, $from_mplayer, $err_mplayer,
                '-quiet',
                '-edlout', $edl,
                '-osdlevel', 3,
+               '-vf' => 'screenshot',
 );
 
 my $epfd = epoll_create(10);
@@ -163,15 +164,16 @@ sub html5tv {
                };
        }
 
-       my ( $slide_width, $slide_height );
-
        my @slides_hires = glob 'www/media/s/hires/p*.jpg';
+       @slides_hires    = glob 'shot*.png' unless @slides_hires;
+       my $factor_s_path;
 
        foreach my $factor ( 4, 2, 1 ) {
                my $w = $prop->{width}  / $factor;
                my $h = $prop->{height} / $factor;
 
                my $path = "www/media/s/${w}x${h}";
+               $factor_s_path->{$factor} = $path;
 
                if ( ! -d $path ) {
                        mkdir $path;
@@ -188,12 +190,21 @@ sub html5tv {
                        }
                }
 
-               if ( $factor == $slide_factor ) {
-                       my $im = Imager->new( file => "$path/p001.jpg" );
-                       $slide_width  = $im->getwidth;
-                       $slide_height = $im->getheight;
-               }
+       }
+
+       my ( $slide_width, $slide_height );
+
+       my $im = Imager->new( file => $factor_s_path->{ 1 } . '/p001.jpg"')
+                       || Imager->new( file => "shot0001.png" ) # from mplayer [s]
+                       ;
 
+       if ( $im ) {
+               $slide_width  = $im->getwidth  / $slide_factor;
+               $slide_height = $im->getheight / $slide_factor;
+       } else {
+               warn "can't find first slide default to 1/$slide_factor of video size\n";
+               $slide_width  = $prop->{width}  / $slide_factor;
+               $slide_height = $prop->{height} / $slide_factor;
        }
 
        my $html5tv = {
@@ -290,7 +301,7 @@ sub html5tv {
 
        write_file 'www/media.html', $html;
 
-       my $carousel_width = $prop->{width} + Imager->new( file => "www/media/s/$res/p001.jpg" )->getwidth - 80;
+       my $carousel_width = $prop->{width} + $slide_width - 80;
        $carousel_width -= $carousel_width % ( $slide_width + 6 ); # round to full slide
        my $carousel_height =   $slide_height + 2;
 
diff --git a/media/kca2009-ZFS_the_next_word/hCalendar.html b/media/kca2009-ZFS_the_next_word/hCalendar.html
new file mode 100644 (file)
index 0000000..3bc7e62
--- /dev/null
@@ -0,0 +1,15 @@
+<!-- http://microformats.org/wiki/hcalendar-cheatsheet -->
+<div class="vevent">
+ <span class="organiser">
+       Jeff Bonwick and Bill Moore
+ </span>
+ <span class="summary">
+       Oslobodimo hardware – sve što ste željeli znati o RFID-u a niste se usudili pitati
+ </span>
+ <a class="url" href="https://slx.sun.com/1179275620">Kernel Conference Australia 2009</a>,
+ <span class="location">Brisbane, Australia</span>,
+ <abbr class="dtstart" title="2009-07-15">Wednesday 15th July</abbr>
+ <div class="description">
+       Keynote speech from Jeff Bonwick and Bill Moore at <a href="http://au.sun.com/sunnews/events/2009/kernel/">Kernel Conference Australia 2009</a>, 15-17 July. Held at Queensland Brain Institute, University of Queensland, Australia.
+ </div>
+</div>
diff --git a/media/kca2009-ZFS_the_next_word/www b/media/kca2009-ZFS_the_next_word/www
new file mode 100644 (file)
index 0000000..c777fda
--- /dev/null
@@ -0,0 +1 @@
+https://slx.sun.com/download/1179275620/11792756201254087565.mp4