From: Dobrica Pavlinusic Date: Sun, 11 Oct 2009 13:55:43 +0000 (+0200) Subject: store video length X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=277b36a2b10b66a06a0fadca7f4e9bc99a25c348;p=HTML5TV.git store video length --- diff --git a/bin/mplayer.pl b/bin/mplayer.pl index f42872a..6da9b45 100755 --- a/bin/mplayer.pl +++ b/bin/mplayer.pl @@ -43,7 +43,7 @@ epoll_ctl($epfd, EPOLL_CTL_ADD, fileno $from_mplayer , EPOLLIN ) >= 0 || die $! sub load_movie { warn "$movie ", -s $movie, " bytes $edl\n"; print $to_mplayer qq|loadfile "$movie"\n|; - print $to_mplayer "get_property $_\n" foreach ( qw/metadata video_codec video_bitrate width height fps/ ); + print $to_mplayer "get_property $_\n" foreach ( qw/metadata video_codec video_bitrate width height fps length/ ); } @@ -119,10 +119,6 @@ sub html5tv { } } - warn "# sync ", dump $sync; - - warn "# prop ", dump $prop; - my $html5tv = { sync => $sync, video => $prop, @@ -146,6 +142,8 @@ sub html5tv { } } + warn "html5tv ", dump $html5tv; + my $sync_path = 'www/media/video.js'; write_file $sync_path, "var html5tv = " . to_json($html5tv) . " ;\n"; warn "sync $sync_path ", -s $sync_path, " bytes\n";