Solved

Divx Web Player Dynamic Pages - Pass video source in URL

Posted on 2013-01-14
6
306 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to reference objects of the calling class without passing them as parameters 29 176
manage footer size 4 54
Help with query 3 25
Scroll 5 news at a time. 4 27
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

809 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