Changeset 1721

Show
Ignore:
Timestamp:
2005-12-21 20:34:03 (3 years ago)
Author:
ctford
Message:

Checks t= bit of URL and returns appropriate bit of video. Only works for time formats that can be cast to double for now.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • phpannodex/trunk/phpsrc/mod_annodex.php

    r1720 r1721  
    11#!/usr/local/bin/php 
    22<?php 
    3  
    43        //require_once("/var/www/phpannodex/php_tests/echo_anx.php"); 
    54        //exit; 
    6         define( "BUFFER_SIZE",  64); 
     5        define( "BUFFER_SIZE",  2048); 
    76         
    87        /* Attempt to stop browsers caching the output of the script. */ 
     
    2120        //echo $filename_root; 
    2221         
    23         if( cmml_prioritised( $http_accept ) ) { 
     22        if( false || cmml_prioritised( $http_accept ) ) { 
    2423                //echo "Pretend we outputted cmml"; 
    2524                output_cmml( $filename_root ); 
     
    9493 
    9594        $comp = "/var/www/phpannodex/php_tests/a_new_computer"; 
     95        $filename = $filename_root . ".ogg"; 
    9696        $filename = $comp . ".ogg"; 
    97         $filename = $filename_root . ".ogg"; 
    9897         
    99         header('Content-type: application/x-annodex'); 
     98        header('Content-Type: application/x-annodex'); 
     99        header("X-Duration: $duration"); 
     100        header("X-Bitrate: $bitrate"); 
    100101        echo "\n"; 
    101102        flush(); 
     
    106107 
    107108        /* This should calculate time offset */ 
    108         anx_write_import( $anx, $filename, NULL, NULL, 0, -1, 0 );  
     109        $id = $_GET['id']; 
     110        $clip = $_GET['clip']; 
     111 
     112        /* Split the t URL parameter into start and end.   
     113         */ 
     114        $t = explode( '-', $_GET['t'] ); 
     115        if( !$t[1] ) { 
     116               $t[1] = -1; 
     117        }               
     118        anx_write_import( $anx, $filename, $id, $content_type, (double) $t[0],  
     119                (double) $t[1], (int) $flags );  
    109120 
    110121        /* Output the file as a series of binary strings, the size of which