Click to See Complete Forum and Search --> : javascript and real audio


dominator69
12-14-2003, 12:42 AM
<embed src="<:FILENAME:> type="audio/video" hidden="false" autostart="true" loop="true" height="100" width="350"></embed>
this is how plays the songs what i need is to open the song in javascript pop up thanx in advance

fredmv
12-14-2003, 12:48 AM
<script type="text/javascript">
//<![CDATA[
var w = window.open('', '', 'height=300,width=450');
with(w.document)
{
write('<embed src="<:FILENAME:>" type="audio/video" hidden="false" autostart="true" loop="true" height="100" width="350"></embed>');
close();
}
//]]>
</script>

dominator69
12-14-2003, 12:50 AM
do u think some javascript should be in the <head>

fredmv
12-14-2003, 12:53 AM
It depends. However, JavaScript can go in the <head> or <body>. Each place is perfectly valid.

dominator69
12-14-2003, 01:01 AM
thanx that works and i wanted to know how i can but background image and to put that player in the middle thanx in advance

fredmv
12-14-2003, 01:06 AM
You're welcome. Here you go:<script type="text/javascript">
//<![CDATA[
var w = window.open('', '', 'height=300,width=450');
with(w.document)
{
write('<body style="text-align: center; background-image: url(foo.gif);"><embed src="<:FILENAME:>" type="audio/video" hidden="false" autostart="true" loop="true" height="100" width="350"></embed></body>');
close();
}
//]]>
</script>Simply change foo.gif to the image filename of your choice.

dominator69
12-14-2003, 01:12 AM
thanx again i need one more ur help i wanted to put that embed player little bit down maybe 2 rows

fredmv
12-14-2003, 01:15 AM
You're welcome. Here you go:<script type="text/javascript">
//<![CDATA[
var w = window.open('', '', 'height=300,width=450');
with(w.document)
{
write('<body style="text-align: center; background-image: url(foo.gif); margin-top: 30px;"><embed src="<:FILENAME:>" type="audio/video" hidden="false" autostart="true" loop="true" height="100" width="350"></embed></body>');
close();
}
//]]>
</script>Simply change margin-top: 30px to whatever amount of space you would like from the top of the page.

dominator69
12-14-2003, 01:19 AM
thank you so much u save my life u r my hero lol

fredmv
12-14-2003, 01:21 AM
No problem. :D

dominator69
12-14-2003, 02:57 PM
do u know the script that in the player block the choice when they do right click on it they have choice to play it in real one player

dominator69
12-14-2003, 03:02 PM
so i want to block them to not play songs in real one player bc they will found out where the file is located

dominator69
12-15-2003, 10:47 PM
anybody can help me