NSV PHP Caster Home

This PHP script is used to take a URL list of NSV files and generate a random playlist without the need of MySQL.  All that is required is for your web host to have PHP installed.

The generated playlist file can be clicked on and viewed as "streamed" content on demand.

Caution should be used so that you do not exceed your monthly web host bandwidth allocation, as video distribution uses large amounts of bandwidth.

If you plan on accessing external NSV files ( files that are not hosted by you ), it is highly recommended that you receive permission from the host of the NSV files you wish to link to.

You should also ensure that the playlist content is in strict compliance with your local governing copyright regulations.

This code is released under:
The GNU General Public License (GPL)
Version 2, June 1991
www.opensource.org/licenses/gpl-license.php

WARRANTY NOTICE
BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

Original code contributed by Kevin VandeWettering.

You can also download a copy of this information.
This information has been stored in zip file format. You must extract it to view it.
Download :
www.scvi.net/soft/nsv_php.zip.

------------ shufflelist.php ---------------

<?php
$list = array(); // Reinitiallize array for cleanliness
$handle = fopen("inputlist.txt","r"); // open the source file full of urls
$i = 0;
while (!feof($handle)) // As long as lines are coming in we do this
{
$temp=fgets($handle);
$list[$i]=$temp;
$i++;
}
shuffle($list);
$z=0;
fclose($handle);
$handle=fopen("outputfile.m3u","w");
while ($z < $i)
{
$temp=$list[$z];
fputs($handle,$temp);
$z++;
}

fclose($handle);
?>

<a href="outputfile.m3u">Play Shuffled List.</a>



------------- cut ---------------

Notes:

To automatically launch this PHP file when a website is opened, place the following code in your HTML header file.
You must also remove this reference <a href="outputfile.m3u">Play Shuffled List.</a> after the ?>

<head>
<script language="javascript" src="shufflelist.php"></script>
</head>

You will need to create a empty file and name it outputfile.m3u.  You need to make this file writable with a chmod a+wrx, before you invoke the PHP file. This should not present any security issues.

When shufflelist.php is invoked, it reads the inputfile.txt file and writes data to the outputfile.m3u file.

When the script ends (at the ?>) a link to the newly created .m3u file is displayed.

"inputfile.txt " should contain a list of NSV files, one file per line.

Example listing for inputfile.txt:

http://www.web_address.com/horror_movie.nsv
http://www.web_address.com/space_movie.nsv
http://www.web_address.com/war_movie.nsv
http://www.web_address.com/western_movie.nsv

This PHP script can support most media formats including: NSV, Theora, WMV, MP3, Ogg, AAC and WMA file types.

To Do List:

Include a PHP routine that can be configured to limit the number of consecutive connections to the playlist file.
This is would be identical to limiting the number of clients that can connect to a ShoutCast DNAS server, and would be configurable by the host.

Include a PHP routine that can be configured to place promo's or advertisements in a designated order within the playlist.

Contributions or suggestions for improving the code can be submitted
here.

Home

Search SCVI.NET using Mozilla or FireFox.

Search SCVI.NET using Internet Explorer below.
Google
  Web www.scvi.net
[ German | Portuguese | Spanish | French | Italian ]

International language support provided by Google.com