Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Embedded Windows Media Player with JavaScript controls on a Mac?

Status
Not open for further replies.

MikeRich

Programmer
Joined
Jan 14, 2006
Messages
1
Location
GB
Hi,

Has anyone got an example of a page that uses an embedded Windows Media Player file and JavaScript controls that works on a Mac?

I've spent most of the day ripping my hair out over something that should be really simple, I've followed all of the guides and I'm still hitting my head against a wall.

Here's a stripped down page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<object
id="MediaPlayer"
width="548"
height="446"
classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
standby="Loading Windows Media Player components..."
type="application/x-oleobject"
codebase=" <param name="autoStart" value="True" />
<param name="filename" value="Movies/WindowsMediaSample.wmv" />
<embed
type="application/x-mplayer2"
src="Movies/WindowsMediaSample.wmv"
name="MediaPlayer"
width="320"
height="240">
</embed>
</object>
<script>
if (document.MediaPlayer) {
alert("Exists");
}
</script>
<A HREF="#" onClick ="MediaPlayer.Pause();">Pause</A>
</body>
</html>

I do a quick check to see that document.MediaPlayer exists (it does). I know the movie file is there as it loads correctly when the page opens.

However, when I click on Pause to access the method Pause(), Firefox's JavaScript: window raises an error 'MediaPlayer.Pause() is not a function'. I've also tried using pause() with no luck.

I've tried Firefox 1.5 and Safari, neither work correctly.

I've looked around and a lot of the examples of jukeboxes online (such as Doc Javascript's don't work on my Mac).

So if you have got a page out there with embedded Windows Media and JavaScript controls can you point me in their direction?

Alternatively, if I'm doing something dumb, can you gently point out my error?

Many thanks,

Mike.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top