Click to See Complete Forum and Search --> : adding video and audio files


sylvester
06-14-2003, 02:09 PM
Hi all,
I'm in the middle of a project and need to add sound and video files using JavaScript. I cannot use HTML tags (for various reasons). Can anyone help me out? I'm a beginner at this!!! Secondly, where can I download free video files that are relatively short? Thanks for your help.

brendandonhue
06-14-2003, 02:20 PM
document.write('<embed src="file.avi">')

http://altavista.com

sylvester
06-15-2003, 01:04 PM
Thanks for your help. I have two more questions for you. Currently, I have the following code:

<script language="JavaScript"><!--
//Write a JavaScript program that includes a video and sound file

document.write('<embed src="Jungle Maximize.wav"></embed>');

</script>

However, I know that I don't have my src="file" correct. Meaning, I don't think I stored the file in the right location to load because I'm getting a syntax error. Can you provide more information on this?

Secondly, do you know anything about the CreditRoll? Does this go into the <body> of the html document or in the <header> part? Here is the code:

<div align="center"><applet code="CreditRoll.class" width="400" height="100">
<param name="bgcolor" value="66cccc">
<param name="textcolor" value="66cccc">
<param name="fadezone" value="20">
<param name="font" value="Times">
<param name="text1" value="The CreditRoll Applet">
<param name="text2" value=" ">
<param name="text3" value="The CreditRoll applet allows you to">
<param name="text4" value="create scrolling text with different">
<param name="text5" value="font sizes and font colors. You can also">
<param name="text6" value="control the scrolling speed.">
<param name="text7" value=" ">
<param name="text8" value="Click this box to go to the Course home page">
<param name="url" value="http://www.course.com/">
<param name="repeat" value="yes">
<param name="speed" value="80">
<param name="vspace" value="5">
<param name="fontsize" value="12">
</applet></div>

brendandonhue
06-15-2003, 01:19 PM
CreditRoll is java not javascript.

Just put Jungle Maximize.wav in the same folder as the HTML file with the script in it.

sylvester
06-15-2003, 03:37 PM
Hi again,
I have gotten the sound file to work properly. Thanks for your help. I'm trying to add a 20 second video to this same program. I can obviously use the same code for the video as the sound. I am using a .mov video file and it is not showing up. Is there something different that I have to do to make a video work properly?

Here's the code:
<!--

//Write a JavaScript program that includes a video file

document.write('<embed src="escape movie.mov" type="video/quicktime" autostart="true" loop="false" height="200" wideth="200"></embed>');

//-->
</script>

Lastly, regarding the CreditRoll applet, I realize that its Java and not JavaScript, however, I need to add it to my page using JavaScript. Any tips?

brendandonhue
06-15-2003, 05:54 PM
Only problem I see with your video code, is you misspelled width. Are you sure that you have QuickTime installed as well?

You can not convert a java applet to javascript.
You could get a similar script in JS, or Use document.write to add the applet to the page.

sylvester
06-16-2003, 09:15 AM
How do I add the CreditRoll applet using the Document.Write? Does it go in the <header> or in the <body>?

Also, regarding adding the video, I was able to view the video prior to using it in my program. I have the sound file added, but cannot get the video to run, in spite of using the same code for the video as I did the sound. Would there be some other way that I would need to add the .mov file that I am overlooking?

brendandonhue
06-16-2003, 05:09 PM
document.write('<div align="center"><applet code="CreditRoll.class" width="400" height="100">
<param name="bgcolor" value="66cccc">
<param name="textcolor" value="66cccc">
<param name="fadezone" value="20">
<param name="font" value="Times">
<param name="text1" value="The CreditRoll Applet">
<param name="text2" value=" ">
<param name="text3" value="The CreditRoll applet allows you to">
<param name="text4" value="create scrolling text with different">
<param name="text5" value="font sizes and font colors. You can also">
<param name="text6" value="control the scrolling speed.">
<param name="text7" value=" ">
<param name="text8" value="Click this box to go to the Course home page">
<param name="url" value="http://www.course.com/">
<param name="repeat" value="yes">
<param name="speed" value="80">
<param name="vspace" value="5">
<param name="fontsize" value="12">
</applet></div>')

Remove the MIME Type from the embed code, just use <embed src="file.mov"></embed>
And make sure you have QuickTime installed so you can play the video.