admin
Admin
| Posts: 1568 |  |

|
Re: Resume without Simese - 2008/09/09 14:39
OK, some tips on modifying stream.php to stream movies in PHP:
In SwissCenter, all media files are requested via the Stream.php file. It is broken down into the following structure:
| Code: | if ( in_array(strtolower($req_ext),$subtitles) )
{
// The player has requested the subtitles for the movie
// (the type can be determined by examining the $req_ext variable)
}
elseif (!is_readable($location))
{
// If the file is unreadable (wrong permissions) then send a message
// to the log.
}
elseif ($media == 1) //music
{
// Streams the mp3 file via the stream_file() function
}
elseif ($media == 2) //photos
{
// Loads, scales, rotates and outputs images that are part of a slideshow
}
else
{
// All other types
// Send a "Redirect" response to the player and give the locations
// as the actual file on disk.
}
|
Simply add a section which tests for "$media == 3" (movies) and stream the file. You'll need to send the appropriate headers before calling stream_file().
Note 1 - most of your changes will probably need to be in stream_file()
Note 2 - You might want to comment out the section which outputs subtitles to being with and concentrate on the streaming the movie. If the subtitles are not sent correctly then the movie does not play... I never did get that working.
You'll need to test all combinations of movies with/without subtitles and the player's subtitles setting on/off.
Player : Pinnacle Showcenter 200 (wired ethernet) Server : HP MediaSmart EX470 NAS (Windows Home Server / Sempron CPU / 2Gb RAM / 2.0 Tb Storage).
|