Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Opening Win Media Player from a CHM file ?

27 views
Skip to first unread message

Boopipi

unread,
Mar 29, 2010, 3:23:40 PM3/29/10
to
Hello everyone,

I've made a help file with "HTML Help Workshop 4.74"

What I'd like to do is put a link so that when the user clicks on it,
windows media player opens up (not inside the CHM file, but using it's
regular interface) and automatically starts playing an MP3 file in a fixed
file location.

This will never be viewed in a web browser, it will always be a CHM file.

Someone from this group gave me a link, but that link was on embedding the
player inside the CHM file. This I don't want.

Thanks for your time and for any info you can provide.

Rob Chandler [MVP]

unread,
Mar 30, 2010, 5:49:39 AM3/30/10
to
So you need to write some script that finds the
location of the Video file. Usually the Video
file is near the CHM so you just find the CHM
path, and add the video filename.

http://helpware.net/FAR/far_faq.htm#Applets
(scroll down a bit to the GetChmDir() function)

Rob


"Boopipi" <NotAvailable@Reply_In_Newsgroup.com> wrote in message
news:%23SG6VV3...@TK2MSFTNGP04.phx.gbl...

Boopipi

unread,
Mar 30, 2010, 1:08:31 PM3/30/10
to
Hello,

Thanks for your response,

Actually the MP3 will always be in the same directory as the CHM (don't need
to obtain the path). I just need to call up Windows Media Player (not
within the CHM but in its regular window) and have it play the MP3
automatically.

The "getchmdir()" that you pointed out seems to search for and return the
path.

I tried putting the following directly in the HTML. It didn't work:

<OBJECT ID="mediaPlayer"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
TYPE="application/x-oleobject">
<PARAM NAME="fileName" VALUE="teaching.mp3">
<PARAM NAME="autoStart" VALUE="true">
<PARAM NAME="showControls" VALUE="true">
</OBJECT>

================================

"Rob Chandler [MVP]" <sup...@nospam.helpware.net> wrote in message
news:uRiES5%23zKH...@TK2MSFTNGP05.phx.gbl...

Rob Chandler [MVP]

unread,
Mar 31, 2010, 3:48:20 AM3/31/10
to
No I understand. Your script needs to get the CHM dir using
that GetChmDir() call then you need to dynamically create
that media player code using the path.

Off the top of my head you need to try something like this...

var path = GetCurrDir(); //See script in download link above
if (path != '')
path = path + '\\';
alert(path); //debug
document.writeln('<OBJECT ID="mediaPlayer"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
TYPE="application/x-oleobject">');
document.writeln('<PARAM NAME="fileName" VALUE="'+path+'teaching.mp3">');
document.writeln('<PARAM NAME="autoStart" VALUE="true">');
document.writeln('<PARAM NAME="showControls" VALUE="true">');
document.writeln('</OBJECT>');

I often run external media but I let mine open in the desktop player...

var path = GetCurrDir(); //See script in download link above
if (path != '')
path = path + '\\';
alert(path);
document.writeln('<a href="'+path+'teaching.mp3">Click me</a>');

Rob

"Boopipi" <NotAvailable@Reply_In_Newsgroup.com> wrote in message

news:e%23TffuC0...@TK2MSFTNGP05.phx.gbl...

Boopipi

unread,
Apr 1, 2010, 9:11:57 PM4/1/10
to
As you probably surmised, my Javascript is limited.

Why do you need to have GetChmDir() get the path ? Couldn't one just insert
a path when you dynamically create the media player ? The location of the
CHM and the MP3s are fixed; these paths will not change.

The CHM will have roughly 20 pages. Each page describes an MP3 file of a
sunday service, and gives the user the option of hearing the MP3 in a
separate media player window.

By the way, will this work in XP, 98, Vista ?

Thanks for your help. Much appreciated.

Peter

===================================

"Rob Chandler [MVP]" <sup...@nospam.helpware.net> wrote in message

news:eBhIKaK0...@TK2MSFTNGP02.phx.gbl...

Rob Chandler [MVP]

unread,
Apr 2, 2010, 11:54:19 AM4/2/10
to
Hi Peter

The only reliable way we have found is to dynamically
create an absolute path and code at run time.
If you find a better way let us know :-)

XP and Vista good. Win98 (IE4 and HH 1.1)
is very old. If you have problems you may need
to ask users to upgrade to Win98 SE (IE5 and HH 1.21)
or maybe just install a later version of IE which should
also include a later version of HH runtime.

Rob

"Boopipi" <NotAvailable@Reply_In_Newsgroup.com> wrote in message

news:uu5n$Fg0KH...@TK2MSFTNGP02.phx.gbl...

Boopipi

unread,
Apr 4, 2010, 9:15:07 PM4/4/10
to
In that case, I can go with this.

Thanks


==================
"Rob Chandler [MVP]" <sup...@nospam.helpware.net> wrote in message

news:Ovc0Czn...@TK2MSFTNGP04.phx.gbl...

0 new messages