cip
asked on
"permission denied" with media player 9
Hi,
I have this html page with a media player object:
<html>
<head>
<script>
<!--
function showPosition(num)
{
document.WinMedia.currentp osition=do cument.Win Media.getm arkertime( num);
document.WinMedia.Play()
}
//-->
</script>
</head>
<body topmargin='0' leftmargin='0' bgcolor='#010066' onload="showPosition(1)">
<object id="WinMedia" width="224" height="176"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
classid="CLSID:22D6F312-B0 F6-11D0-94 AB-0080C74 C7E95"
standby="Loading Windows Media Player components..."
type="application/x-oleobj ect">
<param name="FileName" value="mms://192.168.1.1/v ideo.asf">
<param name="ShowStatusBar" value="true">
<param name="EnableContextMenu" value="false">
<param name="AutoSize" value="false">
<param name="ShowControls" value="false">
<param name="ShowDisplay" value="false">
<param name="DefaultFrame" value="synch">
<param name="autostart" value="false">
</object>
</body>
</html>
With Windows Media Player series 9, as soon as the "showPosition()" script is invoked, I get the error:
"Javascript run-time error: permission denied" (or authorization denied, couldn't figure out the precise english translation here). The statement that cause the problem is "document.WinMedia.getmark ertime(num )". Sseems that reading the marker time is enough to trigger the error.
Any help?
I have this html page with a media player object:
<html>
<head>
<script>
<!--
function showPosition(num)
{
document.WinMedia.currentp
document.WinMedia.Play()
}
//-->
</script>
</head>
<body topmargin='0' leftmargin='0' bgcolor='#010066' onload="showPosition(1)">
<object id="WinMedia" width="224" height="176"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
classid="CLSID:22D6F312-B0
standby="Loading Windows Media Player components..."
type="application/x-oleobj
<param name="FileName" value="mms://192.168.1.1/v
<param name="ShowStatusBar" value="true">
<param name="EnableContextMenu" value="false">
<param name="AutoSize" value="false">
<param name="ShowControls" value="false">
<param name="ShowDisplay" value="false">
<param name="DefaultFrame" value="synch">
<param name="autostart" value="false">
</object>
</body>
</html>
With Windows Media Player series 9, as soon as the "showPosition()" script is invoked, I get the error:
"Javascript run-time error: permission denied" (or authorization denied, couldn't figure out the precise english translation here). The statement that cause the problem is "document.WinMedia.getmark
Any help?
ASKER
Jaysolomon,
Tried that, but unfortunately I still get the permission denied message.
Tried that, but unfortunately I still get the permission denied message.
Maybe a shot in the dark, but is the html page and the media in the same domain?
M=
M=
hey cip,
your link is dead:
mms://192.168.1.1/video.as f
try some other:
mms://media3.ag.org/gc2003 /20030801_ PMvideo.as f
your link is dead:
mms://192.168.1.1/video.as
try some other:
mms://media3.ag.org/gc2003
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Mikehd,
I have downloaded and copied the lesson in the same folder of the html file, and changed the filename parameter to:
<param name="FileName" value="video.asf">
but I am still getting the error.
Devic, I changed the parameter file to point to your video, same thing. The link is dead because I don't want my video server address to be public. What do you mean by "sound is inside, you need wait"?
I have downloaded and copied the lesson in the same folder of the html file, and changed the filename parameter to:
<param name="FileName" value="video.asf">
but I am still getting the error.
Devic, I changed the parameter file to point to your video, same thing. The link is dead because I don't want my video server address to be public. What do you mean by "sound is inside, you need wait"?
Mikehd,
i mean, that movie beginn without sound, and sound in this movie come later.
so i changed only mms link and for me works fine:
========================== =
<html>
<head>
<script>
<!--
function showPosition(num)
{
document.WinMedia.currentp osition=do cument.Win Media.getm arkertime( num);
document.WinMedia.Play()
}
//-->
</script>
</head>
<body topmargin='0' leftmargin='0' bgcolor='#010066' onload="showPosition(1)">
<object id="WinMedia" width="224" height="176"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
classid="CLSID:22D6F312-B0 F6-11D0-94 AB-0080C74 C7E95"
standby="Loading Windows Media Player components..."
type="application/x-oleobj ect">
<param name="FileName" value="mms://media3.ag.org /gc2003/20 030801_PMv ideo.asf">
<param name="ShowStatusBar" value="true">
<param name="EnableContextMenu" value="false">
<param name="AutoSize" value="false">
<param name="ShowControls" value="false">
<param name="ShowDisplay" value="false">
<param name="DefaultFrame" value="synch">
<param name="autostart" value="false">
</object>
</body>
</html>
i mean, that movie beginn without sound, and sound in this movie come later.
so i changed only mms link and for me works fine:
==========================
<html>
<head>
<script>
<!--
function showPosition(num)
{
document.WinMedia.currentp
document.WinMedia.Play()
}
//-->
</script>
</head>
<body topmargin='0' leftmargin='0' bgcolor='#010066' onload="showPosition(1)">
<object id="WinMedia" width="224" height="176"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
classid="CLSID:22D6F312-B0
standby="Loading Windows Media Player components..."
type="application/x-oleobj
<param name="FileName" value="mms://media3.ag.org
<param name="ShowStatusBar" value="true">
<param name="EnableContextMenu" value="false">
<param name="AutoSize" value="false">
<param name="ShowControls" value="false">
<param name="ShowDisplay" value="false">
<param name="DefaultFrame" value="synch">
<param name="autostart" value="false">
</object>
</body>
</html>
ASKER
I finally managed to solve the problem.
When the script executes the command WinMedia.getMarkerTime(num ), the media player still hasn't completely loaded the file, and the total number of markers (property markerCount) is set to 0. So the attempt to read the position of marker number 1, when the total number of markers is still 0, triggers the error.
I changed the script this way:
var globalTries = 0;
function showPosition(num)
{
self.setTimeout("timeoutSh owPosition ("+num+")" ,200);
}
function timeoutShowPosition(num)
{
if (WinMedia.MarkerCount == 0) // MarketCount still 0, file hasn't completely loaded yet
{
if (globalTries > 100 ) // timeout after 20 seconds
alert("Timeout occurred trying to open the movie.");
else
self.setTimeout("timeoutSh owPosition ("+num+")" ,200);
globalTries++; // increment tries
return;
}
document.WinMedia.currentp osition=do cument.Win Media.getm arkertime( num);
document.WinMedia.Play()
}
I didn't want to believe that today's media players could still have syncronizing problems, but that is it.
I'll give Devic's the points. His sentence "you need to wait" gave me the idea of waiting till the file was loaded, even if the real sentence meaning is different.
When the script executes the command WinMedia.getMarkerTime(num
I changed the script this way:
var globalTries = 0;
function showPosition(num)
{
self.setTimeout("timeoutSh
}
function timeoutShowPosition(num)
{
if (WinMedia.MarkerCount == 0) // MarketCount still 0, file hasn't completely loaded yet
{
if (globalTries > 100 ) // timeout after 20 seconds
alert("Timeout occurred trying to open the movie.");
else
self.setTimeout("timeoutSh
globalTries++; // increment tries
return;
}
document.WinMedia.currentp
document.WinMedia.Play()
}
I didn't want to believe that today's media players could still have syncronizing problems, but that is it.
I'll give Devic's the points. His sentence "you need to wait" gave me the idea of waiting till the file was loaded, even if the real sentence meaning is different.
function showPosition(num)
{
document.getElementById('W
document.getElementById('W
}