Solved

Divx Web Player Dynamic Pages - Pass video source in URL

Posted on 2013-01-14
6
338 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
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)
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

726 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