From b6d7655e02a13a769b4e221e36760a01641f45af Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 10 Oct 2009 23:45:17 +0200 Subject: [PATCH] rename video_sync to html5tv and add video prop --- bin/mplayer.pl | 11 +++++++---- www/html5tv.js | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bin/mplayer.pl b/bin/mplayer.pl index bde40d6..a658309 100755 --- a/bin/mplayer.pl +++ b/bin/mplayer.pl @@ -24,6 +24,7 @@ my $preroll = 3; our $to_mplayer; our $from_mplayer; our $err_mplayer; +our $prop = {}; my $pid = open3( $to_mplayer, $from_mplayer, $err_mplayer, 'mplayer', @@ -116,12 +117,15 @@ sub html5tv { warn "# sync ", dump $sync; - my $json = to_json $sync; + warn "# prop ", dump $prop; + + my $html5tv = $prop; + $html5tv->{sync} = $sync; + my $sync_path = 'www/video.js'; - write_file $sync_path, "var video_sync = $json;\n"; + write_file $sync_path, "var html5tv = " . to_json($html5tv) . " ;\n"; warn "sync $sync_path ", -s $sync_path, " bytes\n"; - warn "prop ", dump $prop; } @@ -249,7 +253,6 @@ sub move_subtitle { # XXX main epool loop -our $prop; load_movie; while ( my $events = epoll_wait($epfd, 10, 1000) ) { # Max 10 events returned, 1s timeout diff --git a/www/html5tv.js b/www/html5tv.js index e7b6f11..f8e14b8 100644 --- a/www/html5tv.js +++ b/www/html5tv.js @@ -44,7 +44,7 @@ function chapterChange(isActive, args) { $().ready(function() { //console.debug( video_sync ); - $("#vid").sync( video_sync ); + $("#vid").sync( html5tv.sync ); $(".toggleContentPanel").click(function() { var contentPanelId = "#" + ($(this).attr("class")).split(" ")[1]; -- 2.20.1