搜索引擎的对视频的预览界面设计(调用windows media player)

 编写的jsp界面,实现调用windows media player进行视频的播放

<%@ page language="java" import="java.util.*" import="java.net.URLEncoder"pageEncoding="GBK"%>
<%@ page contentType="text/html;charset=GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String fileID =(String)request.getAttribute("fileID");
String url = (String)request.getAttribute("url");
String downUrl = url;
String videoID = (String)request.getAttribute("videoID");
String title = (String)request.getAttribute("title");
String describe = (String)request.getAttribute("describe");
String author = (String)request.getAttribute("author");
String kind =(String)request.getAttribute("kind");
url = url.substring(0,url.lastIndexOf("/"));
url = url +"/"+ videoID + "." + kind;
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <%=url %>
  <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
    <base href="<%=basePath%>">
    <title>My JSP 'ShowDoc.jsp' starting page</title>
    
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">    
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <!--
 <link rel="stylesheet" type="text/css" href="styles.css">
 -->
<style type="text/css">
<!--
.STYLE1 {font-family: "宋体"}
-->
</style>
  </head>
<%=url %>
<body onunload=SeeYouLater()>
<form action="close.action?title=<%=title%>" method="post" name="form1">
<input type="hidden" name="time" >
</form>
<script language="JavaScript">
pageOpen = new Date();
function SeeYouLater() {
pageClose = new Date();
minutes = (pageClose.getMinutes() - pageOpen.getMinutes());
seconds = (pageClose.getSeconds() - pageOpen.getSeconds());
time = (seconds + (minutes * 60));
form1.time.value=time;
document.form1.submit();
} 
</script>
  <form >
   <table width="1299" height="593" border="0">
     <tr>
       <td height="129" colspan="2" bgcolor="#66ccff"> </td>
     </tr>
     <tr>
       <td width="1006" height="133" rowspan="4" bgcolor="#ccffff"><object align=middle class=OBJECT classid=CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95  //视频的预览
height=600 id=MediaPlayer width=900 >
         <param name="ShowStatusBar" value="-1">
         <param name="Filename"  value= <%out.println(url); %>>
         <param name="SAMIFilename" value="http://192.168.0.16:8080/resources2/4.smi">
         <param  name="Rate"  value="1">
         <embed type=application/x-oleobject autostart="true"   
codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701
flename=mp src= <%out.println(url); %> width=900 height=600> </embed>
       </object></td>
       <td width="277" bgcolor="#99ffff"><a href="download.action?downFileName=<%=url%>"><img src="pic19864video.jpg" alt="下载文档" /></a></td>
     </tr>
     <tr>
       <td height="98"   bgcolor="#99ffff">标题:<%=title %></td>
     </tr>
     <tr>
       <td height="138" bgcolor="#99ffff">作者:<%=author %></td>
     </tr>
     <tr>
       <td height="138" bgcolor="#99ffff">描述:<%=describe %></td>
     </tr>
   </table>
   <table align="center">
   <td>
   
 </table>
 <br>
    </center>
 </form>
  </body>
</html>


你可能感兴趣的:(搜索引擎的对视频的预览界面设计(调用windows media player))