 |
| Javascript General Javascript discussions. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

September 14th, 2007, 06:50 AM
|
|
Registered User
|
|
Join Date: Sep 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Add Items in .WAX PlayList Using javascript window
hi,
i am facing a prob about window media player using java script.
i am using a window media player using java script in my web page,and this window media player working properly,
problem is that if i want to append .mp3 songs in a.WAX PlayList using Array then it's not working....
my code that i am using is ::::
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/javascript">
mp3s = new array();
mp3s[0]='track1';
mp3s[1]='track2';
mp3s[2]='track3';
for(var index = 0; index <= mp3s.length; index++)
{
mp3Audio = mp3s[index]+'.mp3';
mediaItem = Player.newMedia(mp3Audio);
Player.currentPlayList.appendItem(mediaItem);
}
function playAudio(URL){
if (URL != "")
{
document.Player.filename = URL;
document.Player.play();
}
}
</Script>
</head>
<body>
<Table Width=650 Height=50 Border="0" Align="center" Cellspacing="5" Cellpadding="10">
<TR>
<TD align='right'>
<Select name='audioList' onChange="playAudio(audioList.value)">
<option selected value="">Or, Choose One</option>
<option value="playlist.wax"> Play All </option>
<option value="track1.mp3"> First </option>
<option value="track2.mp3"> Second </option>
<option value="track3.mp3"> Third </option>
<option value="track4.mp3"> Fourth </option>
<option value="track5.mp3"> Fifth </option>
</Select>
</TD>
</TR>
</Table>
</body>
</html>
<OBJECT ID="Player" data="http://localhost/jukebox/playlist.wax" WIDTH=170 HEIGHT=45
CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
<param name="src" value="http://localhost/jukebox/playlist.wax">
<PARAM NAME="BufferingTime" VALUE="10">
<PARAM NAME="AudioStream" VALUE="1">
<PARAM NAME="Volume" VALUE="400">
</OBJECT>
the code is in blue ink is not working and items not add in .WAX PlayList please solve this prob
sky is my limit
|
|

November 21st, 2007, 03:06 AM
|
|
Registered User
|
|
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hello there, I know that this thread might be quite old, but hope you are still there.
I'm looking to create an Activex from a DLL I have. I don't know the source code of the DLL, but I do have documentation of its methods.
The idea is to call this Activex from a HTML page, so I could interact with the original DLL. Is this possible?
What do I need to do it? I can imagine that I should write some classes/methods in, for example, Visual Basic that call the DLL, and then save it as an Activex. Am I right?
Sorry if the question is quite confusing.
Mork
|
|

November 21st, 2007, 04:18 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
What sort of DLL, a COM one or native Windows (C style)?
One problem you may have is security, IE is quite strict on what controls you can create without reducing security levels.
--
Joe ( Microsoft MVP - XML)
|
|

November 21st, 2007, 12:42 PM
|
|
Registered User
|
|
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Joe, thanks for your reply. I'm afraid that the DLL is a C style DLL. I'm also aware that some security restrictions may inhibit its execution, however I might my able to change that in my explorer at least to try whether it work or not.
Thanks.
Mork
|
|

November 21st, 2007, 12:57 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
Well you should be able to write a COM wrapper that calls the native functions, providing you have their method signatures.
--
Joe ( Microsoft MVP - XML)
|
|

November 21st, 2007, 01:25 PM
|
|
Registered User
|
|
Join Date: Nov 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Interesting. I've never done something like that. Do you have an example or know where can I get one?
Thanks.
Mork
|
|

November 22nd, 2007, 03:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
This link should help, you don't need the first section as you already have the C DLL. http://support.microsoft.com/kb/106553
You basically DECLARE all your functions and point to the ones in the DLL. You can then compile your code to an ActiveX library and call from script.
The main problems are finding the VB6 equivalents for some of the C variable types.
Alternatively, as a wax playlist is only an XML file, you could just manipulate it via the DOM, see http://www.midistudio.com/MPlayer9/embedWAX.htm for ideas.
--
Joe ( Microsoft MVP - XML)
|
|
 |