Ticket #8017: mythweb.diff

File mythweb.diff, 2.3 KB (added by justin.johnson3@…, 10 years ago)
  • mythplugins/mythweb/modules/tv/tmpl/default/detail.php

     
    2727
    2828    if ($program && $program->filename) {
    2929        $flv_w = setting('WebFLV_w');
    30         $flv_h = intVal($flv_w / $program->getAspect()) + 20;  // +20px for the playback controls
     30        $flv_h = intVal($flv_w / $program->getAspect()) + 25;  // +25px for the playback controls
    3131    }
    3232
    3333/*
     
    538538                        // this first PNG clip works as a splash image
    539539                        {
    540540                            url: '<?php echo $program->thumb_url($flv_w,0) ?>',
    541                             scaling: 'orig'
     541                            scaling: 'fit'
    542542                            },
    543543                        // Then we have the video
    544544                        {
    545545                            url: "<?php echo video_url($program, 'flv'); ?>",
    546                             duration: <?php echo $program->length ?>,
    547546                            autoPlay: false,
     547                            scaling: 'fit',
    548548                            // Would be nice to auto-buffer, but we don't want to
    549549                            // waste bandwidth and CPU on the remote machine.
    550550                            autoBuffering: false
  • mythplugins/mythweb/modules/stream/stream_flv.pl

     
    8383                "Can't do ffmpeg: $!\n${ffmpeg_command}";
    8484        exit;
    8585    }
    86     print header(-type => 'video/x-flv');
     86
     87# Guess the filesize based on duration and bitrate. This allows for progressive download behavior
     88    $dur = `ffmpeg -i $filename 2>&1 | grep "Duration" | cut -d ' ' -f 4 | sed s/,//`;
     89    @times = split(':',$dur);
     90    $length = $times[0]*3600+$times[1]*60+$times[2];
     91    $size = int($length*($vbitrate*1000+$abitrate*1000)/8);
     92
     93    print header(-type => 'video/x-flv','Content-Length' => $size);
    8794    my $buffer;
    8895    while (read DATA, $buffer, 262144) {
    8996        print $buffer;