How to Embed Media Player in HTML Code
Media players are sometimes featured on websites so that visitors can listen to music while browsing the site. Media players allow visitors to control whether they listen to the background music you have on your page as well as pause and adjust the portion of the song they want to listen to. You must implement a new string of HTML code into a webpage to embed a media player.
Instructions
-
-
1
Navigate to a file host (see resources) and upload your media file to the file host server. Click on the “Upload” button and choose the media file from your computer to upload it. Note the URL to your now-hosted media file (the URL is found in the address bar).
-
2
Log in to your web host and double-click on the webpage that you want to embed the media player in.
-
-
3
Copy and paste the following string of HTML code into the webpage where you want the media player to appear:
<embed name="Media File Name"
src="Media File URL"
loop="false"
width="300"
height="90"
hidden="false"
autostart="false">
</embed>Change “Media File Name” to the name of the media file and “Media File URL” to the URL to where the media file is hosted (the URL you noted in Step 1).
-
4
Save the webpage with the new HTML code it by clicking “Save.”
-
1
Tips & Warnings
Make the media player bigger or smaller by adjusting the values of the width and height in the code.
The code will not work if the URL to the media file is not correct.
References
Resources
- Photo Credit Ciaran Griffin/Lifesize/Getty Images