Solved

Divx Web Player Dynamic Pages - Pass video source in URL

Posted on 2013-01-14
6
287 Views
Last Modified: 2014-10-07
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:>
0
Comment
Question by:t_hungate
  • 4
  • 2
6 Comments
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 38777303
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

0
 
LVL 10

Author Comment

by:t_hungate
ID: 38777366
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:>
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 38777376
The problem is getting the
Example: http://MYDDNSNAME/playwmv.html#webmedia\Movies\Test.avi
"Test.avi" into
http://tvids.no-ip.org/...HERE...

right ?
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 10

Author Comment

by:t_hungate
ID: 38777412
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.....
0
 
LVL 10

Accepted Solution

by:
t_hungate earned 0 total points
ID: 40357030
I ended up scraping the project and going with a pre built platform.

Thank you to those that participated.
0
 
LVL 10

Author Closing Comment

by:t_hungate
ID: 40365545
I ended up scraping the project and going with a pre built platform.

Thank you to those that participated.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Read about why website design really matters in today's demanding market.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The viewer will learn how to count occurrences of each item in an array.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now