If you are embedding video the old-fashioned way, by embedding it directly with the embed element and allowing the web browser to choose the user's preferred video player, then you can mute the sound using the volume attribute of the <embed> element. Set it to 0 (meaning 0%), like this:
<embed src="myvideo.avi" volume="0" height="320" width="280" autostart="true"/>
</embed>
Not every player will necessarily respect this, and users who really want to will find ways around it, so if it's crucial that no one hear it, you should strip the sound out of your video file with a video editor before uploading it.
Yes, you can use the same technique with audio files. Or, if you are using my recommended audio solution, the Flash-based XSPF Free Music Player, you can control the volume level with parameters passed to Flash. See how do I play embedded sounds at a specific volume?
For more information, see How do I add video to my website?
Legal Note: yes, you may use sample HTML, Javascript, PHP and other code presented above in your own projects. You may not reproduce large portions of the text of the article without our express permission.
Got a LiveJournal account? Keep up with the latest articles in this FAQ by adding our syndicated feed to your friends list!
Follow us on Twitter | Contact Us
Copyright 1994-2012 Boutell.Com, Inc. All Rights Reserved.
