Click to See Complete Forum and Search --> : Help with media player coding


Trebour
April 25th, 2010, 12:31 PM
Hi first of sorry if ive posted in wrong place im unsure if this code is html or javascrpit tho i know it uses java scrpit i think, Im a absolute novice when it comes to coding ive done very little but im trying to implement a code in my webpage to play media which i have done with success but i would like to change it to suite my needs.

1) The code ive used uses a url for the video file which i would like to change which im sure is possible, instaed of using a url i would like to use a file on the server ie /home/files/video/sample.avi

Could you tell me how to change the code to do this please ?

2) Now assuming the above is possible i would like to also change the drop down box and use a browser to navigate to the file to load in to the divx player as the video files change constantly and would mean constant code change.

If this is at all possible i would be greatful for some help i include the code below


<td style="width:100px;vertical-align:top;">

<form name="videoSelector">
Choose a video to play:
<select name="movie" onChange="javascriptpenNewMovie();">
<option value="" selected>
<option value="Enter url here">Vid 1
<option value="Enter url here">Vid 2
<option value="Enter url here">Vid 3
<option value="Enter url here">Vid 4
</select>
</form>



<object id="ie_plugin" classid="clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616"
width="320" height="212"
codebase="http://go.divx.com/plugin/DivXBrowserPlugin.cab">
<embed id="np_plugin" type="video/divx"
width="620" height="512"
pluginspage="http://go.divx.com/plugin/download/">
</embed>
</object>

<script type="text/javascript">

//
// This code detects which browser we are
// running into (IE or others) and assigns
// the correct element (object or embed) to
// the "plugin" variable, that we will use.
//

var plugin;

if(navigator.userAgent.indexOf('MSIE') != -1)
{
plugin = document.getElementById('ie_plugin');
}
else
{
plugin = document.getElementById('np_plugin');
}

//
// This is a local JS function used by our form
// element to call the plugin functions using
// the "plugin" variable that we defined above
//

function openNewMovie()
{
var url = document.forms['videoSelector'].movie.value;

if(url != '')
{
plugin.Open(url);
}
}

</script>
Trebour is online now Add to Trebour's Reputation Report Post Edit/Delete Message