How to Auto Play a Video from a Website
If you want to produce a website that automatically plays a video, you will need to create code in JavaScript to not only embed the video within the page, but also to automatically play the video once the page loads. This code can be easily copied and customized to fit any website. You only need to have the name of your video file handy so that it can be entered into the code.
Instructions
-
-
1
Open the web page into which you want to embed your video in your web page editor or a text editor like Notepad. If you have opened the web page in a web page editor, click on the code tab to display the actual coding of the page.
-
2
Copy and paste this code inside your Body Tags (<body></body>) of the web page:
<object width="160" height="144"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab">
<param name="src" value="Example.mov">
<param name="autoplay" value="false">
<param name="controller" value="true"><embed src="Example.mov" width="160" height="144"
autoplay="false" controller="true"
pluginspage="http://www.apple.com/quicktime/download/">
</embed></object>
-
-
3
Enter your video as the source file. To do this, find these lines:
<param name="src" value="Example.mov">
<embed src="Example.mov" width="160" height="144"Change "Example.mov" to the name of your video file. (The video format can be different from the example. For instance, <param name="src" value="myvideo.avi">.
-
4
Configure auto play by changing the "autoplay" parameters to "true" and the "controller" parameters to "false."
They should now look like this:
<param name="autoplay" value="true">
<param name="controller" value="false"><embed src="Example.mov" width="160" height="144"
autoplay="true" controller="false" -
5
Change the height and width parameters by entering in new numeric values next to height and width. This is not necessary, simply a matter of preference for how large your auto play video is to be on the page.
-
6
Save the new code and transfer it to your web hosting via a file transfer program.
-
1
Tips & Warnings
File Transfer Programs (or FTP Programs) aid users in transferring web pages and other files to the Internet. Many exist, but two of the most popular are Cute FTP and Coffee Cup FTP. You can find others at Downloads.com or SourceForge.net.
References
Resources
- Photo Credit Digital Vision./Digital Vision/Getty Images