How to Create a URL to Autoplay in Windows Media Player
Creating URLs in an HTML document provides users with a link to each page on your website. You can create a link to a URL that contains a multimedia file. When the user clicks a link to a Media Player formatted file, the Windows Media Player automatically runs. This allows programmers to provide music and videos on a website.
Instructions
-
-
1
Open your HTML file with the URL link in your editor. You can use Notepad or more advanced editors such as Notepad++ or Visual Studio.
-
2
Add a link that displays an alert for the user. The alert is used to tell the user that the Windows Media Player is loading. The following link displays an alert for your users:
<object ID="Video" WIDTH="400" HEIGHT="400" CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Microsoft Media Player software..." TYPE="application/x-oleobject" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> -
-
3
Create the link that automatically plays the file after the Media Player application loads. The following code is used to play a file automatically for your website readers:
<embed TYPE="application/x-mplayer2" SRC="my_domain/filename.asx" NAME="MediaPlayer" WIDTH="400" HEIGHT="400" autostart="1" showcontrols="0"></embed></object>
Replace "my_domain/filename.asx" with the name of your Media Player file. -
4
Save the file and open it in your web browser. The movie automatically plays in your Media Player software installed on the machine.
-
1
Tips & Warnings
For Media Player to run, it first must be installed on the local machine.
References
- Photo Credit camera media image by Christopher Dodge from Fotolia.com