How to play video in jsp page


The HTML <embed> tag is used to embed multimedia in an HTML document.
You should use <noembed> tag along with this tag to handle browsers who do not support embed tag.
The <embed> tag is supported in all major browsers.
Attributes:
Following is the list of important attributes for <embed> element.

align - Determines how to align the object. It takes either center, left or right.

autostart - Indicates if the media should start automatically. Netscape default is true, Internet Explorer is false.

loop - Specifies if the sound should be played continuously (set loop to true), a certain number of times (a positive value) or not at all (false). This is supported by Netscape only.

height - Height of the object in pixels or en.

width - Width of the object in pixels or en.

pluginspage - Specifies the URL to get the plugin software.

src - URL of the object to be embedded. This can be any recognizable by the user's browser. It could be .mid, .wav, .mp3, .avi and so on).

volume - Controls volume of the sound. Can be from 0 (off) to 100 (full volume). This attribute is supported by Netscape only.

Example:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style4 {
color: #003333;
font-weight: bold;
}
-->
</style>
</head>

<body>
<table width="100%" border="0">
  <tr >
    <td rowspan="3"></td>
    <td bgcolor="#CCCC33"></td>
    <td rowspan="3" width="300"><div align="center">
    
    </div></td>
  </tr>
  <tr>
    <td width="710" bgcolor="#CCCC33" align="center" ><span class="style4">Video Player Version 1.0</span>      <strong>
      <embed src="song.mp4" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" name="mediaplayer1" ShowStatusBar="true" EnableContextMenu="false" width="700" height="500" autostart="false" loop="false" align="middle" volume="60" ></embed>
    </strong></td>
  </tr>
  <tr>
    <td bgcolor="#CCCC33"></td>
  </tr>
</table>

</body>
</html>

No comments:

Post a Comment