TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 107
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 103
  • Total: 103

play a random video ?

Started by Tron420, December 19, 2006, 11:07:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tron420

how do i edit this code to make a random video play ( from a certain directory or list )
whenever the page is refreshed or viewed?

  <!-- begin embedded WindowsMedia file... -->
      <table border='0' cellpadding='0' align="center">
      <tr><td>
      <OBJECT id='mediaPlayer' width="160" height="160"
      classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
      codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
      standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
      <param name='fileName' value="-------------------------">
      <param name='animationatStart' value='true'>
      <param name='transparentatStart' value='true'>
      <param name='autoStart' value="true">
      <param name='showControls' value="false">
      <param name='loop' value="true">
      <EMBED type='application/x-mplayer1'
        pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
        id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
        bgcolor='black' showcontrols="false" showtracker='-1'
        showdisplay='0' showstatusbar='-0' videoborder3d='-1' width="150" height="150"
        src="-----------------------" autostart="true" designtimesp='5311' loop="true">
      </EMBED>
      </OBJECT>
      </td></tr>
      <!-- ...end embedded WindowsMedia file -->
    <!-- begin link to launch external media player... -->
        <tr><td align='center'>
        <a href="-------------------" style='font-size: 85%;' target='_blank'>-----------</a>
        <!-- ...end link to launch external media player... -->
        </td></tr>
      </table>
Right Click For Control

alan s

You could try this.

Create a php file called urlrotator.php with the following code

$version = "v1.01";
<?
$linksfile ="urlrotator.txt";

$urls = file("$linksfile");
$url = rand(0, sizeof($urls)-1);

$goto = "$urls[$url]";

header("Location: $goto");

?>


Then create a text file called urlrotator.txt

Put the links to any videos you wanted rotated in the txt file.

Upload it to a directory on your server and then create a TP Script Block with the code


<iframe width="X" height="X" src="http://yoursite/scriptfolder/urlrotator.php"></iframe>


Replace the X's with the width/height that suites you and replace the url with the url to your uploaded script.

Tron420

how is the txt supposed to look? i mean, how should i place the movie file names? canb u show me an example of how the txt file should look?

alan s

text file should just look like

http://yoursite.com/vid/1.avi
http://yoursite.com/vid/a.mpg
http://yoursite.com/vid/jd.wmv



This website is proudly hosted on Crocweb Cloud Website Hosting.