Link to home
Start Free TrialLog in
Avatar of Tony Hungate
Tony HungateFlag for United States of America

asked on

Divx Web Player Dynamic Pages - Pass video source in URL

Let me start by let you all know that I am by no means an expert in web dev.  I have dabbled here and there over the years in an effort to put my core database design skill to use.

Here is my situation:
I just rebuilt an older PC from the ground up and installed windows 7 Ultimate on it to use only as a media web server.  I install IIS7, Media Services, Smooth Stream Extensions and Bit Rate Throttling Extensions on it.  I ensured it was up to date with dotNet 3.5 and 4.0 as well as configured it for .ASP and CGI.  Bottom line it is ready to rock and do its thing.

Now, I have a large number of videos that I would like to be able to watch via http while traveling.  I use a home media solution for the house and have everything connected and sharing beautifully so I am familiar with file formats, containers and encoding.

Here is tricky part number 1, the files are in all sorts of formats, the majority are in .AVI, .MKV and .MP4.

What I would like to do is have a webpage that I can use to list all the files that are on the server and when a linked movie title is clicked a new page/tab opens and loads the correct embedded player and streams the file for my viewing pleasure.

I have been able to get this to work no problem locally with Windows Media files (.wmv, .avi and even .mp4) Still need to do some off site testing to verify but it is working via my dynamicDNS host and them back so I think I am good there.  

That only leaves tricky part number 2, the .mkv files (I really do not want to spend hours converting them to flash), for which I found that the new Divx Web Player, I have found the solution I think.  My issue now is avoiding making a separate webpage for each file. What I would like to do is pre can a template page with null "", source values and then pass them to the template when the link is clicked and the page opened.  

I was able to do this with the other file formats by using the following.


<!DOCTYPE HTML>
<html>
<head>
<title>tvids Test</title>
<style type="text/css">
<!--
h1	{text-align:center;
	font-family:Arial, Helvetica, Sans-Serif;
	}

p	{text-indent:20px;
	}
-->
</style>
</head>
<body bgcolor = "#ffffcc" text = "#000000">
<h1>MediaPlayer Test</h1>

<object id='mediaPlayer' width="600" height="534" 
      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="true" />
      <param name='loop' value="false" />	  
 </object>

<script type="text/javascript">
u1 = window.location.toString();
u2 = u1.split("#");
videofile = u2[1];
document.getElementById('mediaPlayer').fileName=videofile;
</script>

Open in new window



And passing the video fileName as part of the link.  

Example: http://MYDDNSNAME/playwmv.html#webmedia\Movies\Test.avi

I am able to get the Divx player to display videos if I hard code the source file into the html as follows:


<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="640" height="368" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
  <param name="custommode" value="none" />
  <param name="mode" value="zero" />
  <param name="previewImage" value="webmedia\CoverArt\Arrested Development.jpg" />
  <param name="autoPlay" value="false" />
  <param name="src" value="http://tvids.no-ip.org/MyTest.mkv" />

Open in new window



I have be researching it for 3 days now and it is driving me crazy.  I am hoping that there is a java or php guru out there that writes CMS or something that could help me out.

Thanks in advance.

<:TLH:>
Avatar of Lukasz Chmielewski
Lukasz Chmielewski
Flag of Poland image

From what I understand, you could just do
<param name="src" value="http://tvids.no-ip.org/<?php echo $_GET['thefilenamestring'];?>" />

Open in new window

Avatar of Tony Hungate

ASKER

Can you please clarify it for me a bit, like I said I do deal with these systems often and I am not up to speed.

Where would I be getting the file name string from and how would I pass it to the line you provided?

If you could break it down with an example of what I would need on the main page and the subsequent player pages.

Thanks for the quick response though.

<:TLH:>
Exactly and to maintain functionality on other browsers I actually need that variable passes to two locations.

<object classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616" width="640" height="368" codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
  <param name="custommode" value="none" />
  <param name="mode" value="zero" />
  <param name="previewImage" value="webmedia\CoverArt\Arrested Development.jpg" />
  <param name="autoPlay" value="false" />
  <param name="src" value="http://tvids.no-ip.org/MyTest.mkv" />
<embed type="video/divx" src="HERE AS WELL" width="400" height="280" pluginpage.....
ASKER CERTIFIED SOLUTION
Avatar of Tony Hungate
Tony Hungate
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I ended up scraping the project and going with a pre built platform.

Thank you to those that participated.