PDA

View Full Version : Problem Loading Videos



pedrodri
07-30-2007, 03:55 PM
Hi people. I have a problem loading videos using innerHTML and Firefox
the source is:



<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Video Page</title>
<style type="text/css">
#mediaplayer {
width: 400px;
height: 320px;
background: #000;
}
</style>

<script type="text/javascript">
function play(media){
//alert(media);
document.getElementById('mediaplayer').innerHTML=
'<object id="MediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"'
+'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"'
+'standby="Loadin..." type="application/x-oleobject">'
+'<param name="FileName" value="videos/'+media+'.wmv">'
+'<param name="AnimationatStart" value="true">'
+'<param name="TransparentatStart" value="true">'
+'<param name="AutoStart" value="true">'
+'<param name="ShowControls" value="TRUE">'
+'<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dllprd=windows&sbp=mediaplayer&ar='
+'Media&sba=Plugin&" src="videos/'+media+'.wmv"'
+'name="MediaPlayer" showcontrols="FALSE" width="400" height="320"></embed>'
+'</object>'
}

</script>

</head>

<body>
<div id="mediaplayer">
<object id="MediaPlayer" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" standby="Loading..." type="application/x-oleobject">
<param name="FileName" value="aaa.wmv">
<param name="AnimationatStart" value="true">
<param name="TransparentatStart" value="true">
<param name="AutoStart" value="true">
<param name="ShowControls" value="TRUE">
<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/isapi/redir.dllprd=windows&sbp=mediaplayer&ar=Media&sba=Plugin&" src="aaa.wmv" name="MediaPlayer" showcontrols="FALSE" width="400" height="320"></embed>
</object>
</div>

<ul id="menu">
<li><a onclick="play('1');return false" href="">Source 1</a></li>
<li><a onclick="play('2');return false" href="">Source 2</a></li>
<li><a onclick="play('3');return false" href="">Source 3</a></li>
</ul>
</embed>
</body>

</html>


In the IE it functions but apper warnings of activex components...
The objective is a site that when click on links, appears in the video window the select video. I'm to use a wrong method?
Somebody can help me?

Thanks and sorry for my English

jscheuer1
07-30-2007, 04:15 PM
In order to avoid the 'click to activate feature' of IE and Opera with multimedia content, the script that loads the code must be external to the page. Warnings about Active X in IE are often just the result of loading a local page with javascript on or linked to it and will not happen once your page is live. I have a wizard for setting up the external code for multimedia content:

http://home.comcast.net/~jscheuer1/side/click_to_activate_w.htm

pedrodri
07-30-2007, 04:22 PM
Thanks for the reply...

How it's that I must make loading of videos?
Because it is that it does not work in Firefox?

Thanks and sorry for my English!

jscheuer1
07-30-2007, 05:37 PM
I'm not sure of the correct syntax for MediaPlayer in FF, usually there are several formats that will work for any given player, and what you have looks about right. No player will work in any given browser though if it is not configured in that browser's setup to do so as a plugin.