diff -ur mythweb_ori/modules/stream/handler.pl mythweb/modules/stream/handler.pl
old
|
new
|
|
30 | 30 | elsif ($ENV{'REQUEST_URI'} =~ /\.flvp$/i) { |
31 | 31 | require "modules/$Path[0]/stream_flvp.pl"; |
32 | 32 | } |
33 | | elsif ($ENV{'REQUEST_URI'} =~ /\.flv$/i) { |
| 33 | elsif ($ENV{'REQUEST_URI'} =~ /\.flv\?.+$/i) { |
34 | 34 | require "modules/$Path[0]/stream_flv.pl"; |
35 | 35 | } |
36 | 36 | # Mpeg4? |
diff -ur mythweb_ori/modules/stream/stream_flv.pl mythweb/modules/stream/stream_flv.pl
old
|
new
|
|
29 | 29 | } |
30 | 30 | sub shutdown_handler { |
31 | 31 | kill(1, $ffmpeg_pid) if ($ffmpeg_pid); |
32 | | kill(-1, $ffmpeg_pgid) if ($ffmpeg_pid); |
| 32 | |
| 33 | # this cause an internal server error |
| 34 | # kill(-1, $ffmpeg_pgid) if ($ffmpeg_pid); |
33 | 35 | } |
34 | 36 | |
35 | 37 | # Find ffmpeg |
… |
… |
|
72 | 74 | $vbitrate = 256 unless ($vbitrate && $vbitrate > 1); |
73 | 75 | $abitrate = 64 unless ($abitrate && $abitrate > 1); |
74 | 76 | |
| 77 | if ("$ENV{'REQUEST_URI'}" =~ /start\=(\d+)$/i) { |
| 78 | $start = $1; } |
| 79 | else { |
| 80 | $start = 0; } |
| 81 | |
75 | 82 | my $ffmpeg_command = $ffmpeg |
76 | 83 | .' -y' |
| 84 | .' -ss '.shell_escape("$start") |
77 | 85 | .' -i '.shell_escape($filename) |
78 | 86 | .' -s '.shell_escape("${width}x${height}") |
79 | 87 | .' -g 30' |
… |
… |
|
98 | 106 | $dur = `ffmpeg -i $filename 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//`; |
99 | 107 | if ($dur && $dur =~ /\d*:\d*:.*/) { |
100 | 108 | @times = split(':',$dur); |
101 | | $lengthSec = $times[0]*3600+$times[1]*60+$times[2]; |
| 109 | $lengthSec = ($times[0]*3600+$times[1]*60+$times[2])-$start; |
102 | 110 | $size = int($lengthSec*($vbitrate*1000+$abitrate*1000)/8); |
103 | 111 | print header(-type => 'video/x-flv','Content-Length' => $size); |
104 | 112 | } else { |
105 | 113 | print header(-type => 'video/x-flv'); |
106 | 114 | } |
107 | 115 | |
| 116 | |
| 117 | |
| 118 | |
108 | 119 | my $buffer; |
109 | 120 | if (read DATA, $buffer, 53) { |
110 | 121 | print $buffer; |
diff -ur mythweb_ori/modules/tv/tmpl/default/detail.php mythweb/modules/tv/tmpl/default/detail.php
old
|
new
|
|
554 | 554 | <script> |
555 | 555 | flowplayer( |
556 | 556 | "player", |
557 | | "<?php echo root_url ?>tv/flowplayer-3.1.1.swf", { |
| 557 | "<?php echo root_url ?>tv/flowplayer-3.1.5.swf", { |
558 | 558 | playlist: [ |
559 | 559 | // this first PNG clip works as a splash image |
560 | 560 | { |
… |
… |
|
563 | 563 | }, |
564 | 564 | // Then we have the video |
565 | 565 | { |
| 566 | provider: "pseudo", |
566 | 567 | url: "<?php echo video_url($program, 'flv'); ?>", |
567 | 568 | duration: <?php echo $program->length ?>, |
568 | 569 | autoPlay: false, |
… |
… |
|
571 | 572 | // waste bandwidth and CPU on the remote machine. |
572 | 573 | autoBuffering: false |
573 | 574 | } |
574 | | ]} |
| 575 | |
| 576 | ], |
| 577 | plugins: { |
| 578 | pseudo: { |
| 579 | url: "flowplayer.mythpseudostreaming.swf" |
| 580 | } |
| 581 | } |
| 582 | } |
| 583 | |
575 | 584 | ); |
576 | 585 | </script> |
577 | 586 | <?php } elseif (file_exists('modules/tv/MFPlayer.swf')) { ?> |
… |
… |
|
689 | 698 | <?php } else { ?> |
690 | 699 | <a href="<?php echo $program->url ?>" title="<?php echo t('Direct Download') ?>" |
691 | 700 | ><img src="<?php echo $program->thumb_url($flv_w,0) ?>" width="<?php echo $flv_w ?>"></a> |
692 | | <?php } ?></td> |
| 701 | <?php } ?> |
693 | 702 | </div> |
694 | 703 | <div class="x-links"> |
695 | 704 | <a href="<?php echo video_url($program, 'asx') ?>" title="<?php echo t('ASX Stream') ?>" |