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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Active X Control Message

Status
Not open for further replies.

kliz0328

Programmer
Nov 7, 2005
138
0
0
US
I used the following code to embed an Audio file into my page, it works good, but when I open the page in IE I get a message box saying click to run Active X control. Is this going to happen with everyone's IE browser, is this a property of my code or of my IE browser and is there a way to stop this from happening?

Code:
<embed src="Sound/BeautifulDisaster.mp3" autostart=True width=0 height=0 id="sound1"
enablejavascript="true">
 
Is this going to happen with everyone's IE browser

Pretty much most of them, yes.

is this a property of my code or of my IE browser

Security feature of IE. If you sign your ActiveX then you may have more luck, but it won't make it work for everyone. This is set by IE to protect users from malicious code.

is there a way to stop this from happening

No. You can minimise the impact by signing the ActiveX control, but some IE configurations will still reject it - signed or not.

This is also very IE centric, and will not work natively in other browsers.. do you intend to ignore browsers like FireFox, Opera, Safari, Konqueror etc ?

A smile is worth a thousand kind words. So smile, it's easy! :)
 
no the message does not come up when I use FireFox, how would I go about signing the active x contrtol?
 
Firefox doesn't support ActiveX natively.. that's why it doesn't throw a security message. There is a plugin available, but I would expect it would have the same security principles, and also requires users to install it anyway.


And,

If you're happy to force users to use IE and have security alerts then continue with ActiveX.. but to be more compatible either sign your ActiveX control or better still - do it without ActiveX - most cases for web app development you don't need them.



A smile is worth a thousand kind words. So smile, it's easy! :)
 
Currently I do not have to force users to only use IE the page actually is rendering better in firefox. After all of the research that i have done I can't find a way to Add Audio to my webpage without using the embed tag. Is there an alternative way to do this without using active X?
 

I can't find a way to Add Audio to my webpage without using the embed tag. Is there an alternative way to do this without using active X?

embed != ActiveX

embed is originally a Netscape idea used for plugins.
plugins are not ActiveX controls - ActiveX controls are Microsoft IE only (natively anyway) - and have more access to the OS than plugins.

Have you tried something like:
Code:
<embed src="example.mp3" 
  width="200"
  height="75"
  autostart="true"
  type="audio/mpeg" />

This should work in most browsers and open the default player associated with the content type inline in the page, without an activex or any nasty security issues. However, it may ask the user to download a plugin if you use an unsupported media type.

Also, you may want to note that <embed> is not XHTML compliant, so you may want to change to the <object> element instead.

My knowledge and experience of audio in web pages is very limited so there may be a better way - but a quick search on Google will probably be of most use to you.



A smile is worth a thousand kind words. So smile, it's easy! :)
 
With IE you can use bgsound to load your background sound file. It is IE only but the setting should be ignored by all other browsers and if IE does not reponse to the embed tag you may not even have to bother with browser detection to load/start the audio.

<bgsound id='mySound' src='myaudiofile.wav' loop='0'>

This also works with mp3 and wma files.


[blue]It's hard to think outside the box when I'm trapped in a cubicle.[/blue]
In an increasingly self-focused society it is important to recognize the unselfish actions of others so they will feel encouraged to continue such actions. Please give acknowledgement to those who aid you whether it is waving to the person who let you out
 
First Off, thanks for your help it is greatly appreciated, the last question I will bug you with is, the fact that now the page will play any .wav file, but will not play and mp3 file, is this due to my browser settings?
 
In FF or IE?
I have never used the embed tag and do not know what it supports but I am pretty sure that I have used the IE bgsound tag to play MP3 files.


[blue]It's hard to think outside the box when I'm trapped in a cubicle.[/blue]
In an increasingly self-focused society it is important to recognize the unselfish actions of others so they will feel encouraged to continue such actions. Please give acknowledgement to those who aid you whether it is waving to the person who let you out
 

embed or object will work with either FF or IE and with whatever media files types you have registered against an appropriate player plugin.

If the browser doesn't have the file type registedered against a known plugin then it is likely to fail.

if this is just for a background sound then, as theniteowl suggests, bgsound will do what you need. Though if you want a playlist, or pausable/etc streamed player version you need to use embed or object.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
I have both of them in there right now, my computer at home plays any type of file just fine for both IE and FF, but at work my IE will only play wav files, and FF will not play anything, but for FF that is b/c I do not have the plugin installed. Are there plugins that go with IE, I thought all IE would just use the active X control? I am thinking about just using a wav file, but I am hesitant to put a 41,000kb file on there as opposed to a 4,100 kb file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top