Play Videos in Pure HTML Page
(Windows Media Player)
Page1 : Videoslist.html
<table
border="1"
cellpadding="10"
cellspacing="0"
width="90%"
align="center"
>
<tr>
<td>
<a
href="videos.html?vid=videos/1.wmv"><b>Video
1</b></a>
// Local Video Path
</td>
</tr>
<tr>
<td>
<a
href="videos.html?vid=videos/Wildlife.wmv"><b>Video
2</b></a>
</td>
</tr>
<tr>
<td>
<a
href="videos.html?vid=http://flightpass.higherplaneproductions.com/g2data/albums/FreeAll/freewmv/JoeNall10_3DH-_W640.wmv"><b>Video
3</b></a>
// Server Video Path '
</td>
</tr>
<tr>
<td>
<a
href="videos.html"><b>Video
4</b></a>
</td>
</tr>
<tr>
<td>
<a
href="videos.html"><b>Video
5</b></a>
</td>
</tr>
<tr>
<td>
<a
href="videos.html"><b>Video
6</b></a>
</td>
</tr>
<tr>
<td>
<a
href="videos.html"><b>Video
7</b></a>
</td>
</tr>
</table>
Page 2 : Videos.html
Step
1 : Add Script
<script
language="javascript"
type="text/javascript">
function
qs(search_for) {
var
query = window.location.search.substring(1);
var
parms = query.split('&');
for
(var
i = 0; i < parms.length; i++) {
var
pos = parms[i].indexOf('=');
if
(pos > 0 && search_for == parms[i].substring(0, pos)) {
return
parms[i].substring(pos + 1); ;
}
}
return
"";
}
function
Show() {
var
path = qs("vid");
var
x = "";
x
+= "<div><object
id='mediaplayer' classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95'
codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701'";
x
+= "
standby='loading microsoft windows media player components...'
type='application/x-oleobject'";
x
+= "
width='800px' height='600px'>";
x
+= "
<param name='filename' value='"
+ path + "'
/>";
x
+= "
<param name='animationatstart' value='true' />";
x
+= "
<param name='transparentatstart' value='true' />";
x
+= "
<param name='autostart' value='true' />";
x
+= "
<param name='showcontrols' value='true' />";
x
+= "
<param name='ShowStatusBar' value='true' />";
x
+= "
<param name='windowlessvideo' value='true' />";
x
+= "
<embed src='' autostart='true' showcontrols='true'
showstatusbar='1' bgcolor='white'";
x
+= "
width='200' height='100'></div>";
document.getElementById('div1').innerHTML
= x; // find the div element and assign the video
}
</script>
Step2
: on body tag add the onload event call the Show() funtion in
javascript
<body
onload="Show()">
step
3 : add div in body tag
<div
id="div1"></div>
Video will play when load the Videos.html.
Hey There. I found your blog using msn. This is a really well written article.
ReplyDeleteI will make sure to bookmark it and return to read more of your useful information.
Thanks for the post. I will definitely return.
Review my web blog; atlaslm.com
That is really fascinating, You are a very skilled blogger.
ReplyDeleteI have joined your feed and stay up for seeking
extra of your fantastic post. Additionally, I have shared your site in my social
networks
my blog post ... helpful resources
I'm not sure why but this website is loading very slow for me. Is anyone else having this issue or is it a problem on my end? I'll check back later on and see if the
ReplyDeleteproblem still exists.
Look at my web page; Read the Full Article
Hello all, here every person is sharing these experience, thus it's good to read this webpage, and I used to pay a quick visit this website all the time.
ReplyDeletemy web blog ... Quote - duq.ca