Media Player embedding issue

T

Tom Richards

I know how to embed media player. Is there a way to embed media player and
have it called by a link on the page? Example at one of my websites in
developement:

http://renaraso.com/yoga.htm

My links work for asana, vinyasa and pranayama, but i would like to embed 3
media players (invisible mode) and have those 3 links call their respective
media player to play the wav file seamlessly, that is, with no interuption
of a media player loading on the viewer's pc. I've tried and tried, but
can't seem to put this together.

Tom
 
J

Jim Buyens

I spent some time playing with this and couldn't find a
really satisfying solution. The following code *sort of*
works (if all on one line, and if player is the name of
the Media Player object):

<a href="javascript:;"
onclick="player.URL='sounds/dog.wav';player.controls.play
();">Play</a>

but even though the sound plays, I get an error message
stating that the play method isn't available. There's a
fix for that error message -- I could change some
security settings and then rerun Media Player setup, but
how many Web visitors are going to discover the same
problem, find the fix, and then apply it, just for your
Web site?

If you have Frontpage 2003, a much better solution is to
forget Media Player, and just use the Play Sound
behavior. To do this, you select the text that will
trigger the sound, display the Behaviors task pane, click
Insert, choose Play Sound, and specify the sound file you
want.

If you have FP2002 or earlier, paste this script into the
<head> section of your page:

<script language="JavaScript">
<!--
function playIt(path) {
var b,e,es,i
var d=document
var se="<EMBED SRC='"+path+"' HIDDEN=TRUE LOOP=FALSE
AUTOSTART=TRUE>";
if(d.body) b=d.body;
if(d.getElementsByTagName) {
es=d.getElementsByTagName('embed')
for(i=0;i<es.length;i++) {
e=es(i);
if( e.src==path ) {
if(e.removeNode) e.removeNode();
break;
}
}
if(b&&b.insertAdjacentHTML) b.insertAdjacentHTML
("beforeend",se);
}
}
// -->
</script>

and then code your hyperlink:

href="javascript:playIt(sounds/DOG.WAV')"

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
T

Tom Richards

Thanks Jim! I'm going to try this tomorrow night when I'm back on the proper
pc. I'll post back with the results.

Tom
 
T

Tom Richards

Hi Jim,

I went out and purchased the fp 2003 upgrade and attempted to add a sound to
those links. The results were horrible - all 3 sounds would play
simultaneously most of the time. There wasn't much control over what was
happening on that page. So I think I'm going to do some inline framing and
link the wav files to an embedded media player in the target inline frame
page. Thanks again for your help.

Tom
 
J

Jim Buyens

Tom Richards said:
Hi Jim,

I went out and purchased the fp 2003 upgrade and attempted to add a sound to
those links.

What procedure did you use for this?
The results were horrible - all 3 sounds would play simultaneously most of
the time.

Do you mean that clicking one sound didn't stop the previousone from
playing, or clicking a link played multiple sounds, that some sounds
played spontaneously, or what?
There wasn't much control over what was
happening on that page. So I think I'm going to do some inline framing and
link the wav files to an embedded media player in the target inline frame
page. Thanks again for your help.

Tom Richards
(e-mail address removed)

That approach should work as well.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
T

Tom Richards

What procedure did you use for this?

From the Behaviors pane, I inserted a Play Sound - one for each link. I
disabled each respective hyperlink too.
Do you mean that clicking one sound didn't stop the previousone from
playing, or clicking a link played multiple sounds, that some sounds
played spontaneously, or what?

If I used the onmouseover behavior, the sounds would start playing when the
mouse moved anywhere. On click or doubleclick, I guess they work ok.
http://renaraso.com/yoga.htm
That approach should work as well.

Thanks Jim.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top