<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>藏品管理系统</title>
<link rel="icon" href="/resource/images/logo/titlelogo.png" type="image/x-icon"/>
<base href="<%=basePath%>" />
<script language=javascript src="resource/player/images/jquery.js"
type=text/javascript></script>
<style>
.video{
width:800px;
hegiht:600px;
margin:50px auto;
}
body{
background-color: #373737;
}
</style>
</head>
<body>
<script type="text/javascript"
src="resource/player/images/swfobject.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var so = new SWFObject("resource/player/player.swf", "ply","800","600", "9", "#000000");
so.addParam("allowfullscreen", "true");
so.addParam("allowscriptaccess", "always");
so.addParam("wmode", "opaque");
so.addParam("quality", "high");
so.addParam("salign", "lt");
//播放器设置文件-----------------------------
so.addVariable("JcScpFile", "resource/player/CuSunV2set.xml");
//视频文件及略缩图--------------------------
so.addVariable("JcScpVideoPath", "${webRoot}/${videoSrc}");
so.addVariable("JcScpImg", "images/startpic.jpg");
so.write("CuPlayer");
//document.body.clientHeight;
});
</script>
<div class="close_light_bg" id="close_light_bg"></div>
<!--极酷播放器/代码开始-->
<script type="text/javascript"
src="resource/player/images/swfobject.js"></script>
<div class="video" id="CuPlayer">
<b><img src="resource/player/images/loading.gif" />
网页视频播放器加载中,请稍后...</b>
</div>
<script language=javascript src="resource/player/images/action.js"
type=text/javascript></script>
<!--极酷播放器/代码结束-->
<script src="resource/js/jquery/jquery-1.10.2.min.js"></script>
</ BODY> </ HTML>
@RequestMapping("/IoReadVideo")
public String IoReadVideo(String videoName,String dataNo,String accuracy,String returnIma,HttpServletRequest request,HttpServletResponse response) throws IOException {
String saveVedio="";
String lookAccuracys="";
String returnImas="";
InputStream in = null;
ServletOutputStream out = null;
try {
String videoNames=new String(videoName.getBytes("iso-8859-1"), "utf-8");
String dataNos=new String(dataNo.getBytes("iso-8859-1"), "utf-8");
lookImg(dataNos);
String accuracyNo=new String(accuracy.getBytes("iso-8859-1"), "utf-8");
if(returnIma!=null && !"".equals(returnIma)){
returnImas=new String(returnIma.getBytes("iso-8859-1"), "utf-8");
}
Properties prop = new Properties();
InputStream ins = this.getClass().getResourceAsStream("/config/webconfig.properties");
prop.load(ins);
String web=prop.getProperty("imageFileUrl");
String afterWeb=prop.getProperty("afterFileUrl");
String afrontWeb=prop.getProperty("frontFileUrl");
if(accuracyNo!=null){
SysDicInfo dicInfos=imageService.get(SysDicInfo.class, accuracyNo);
if(dicInfos!=null){
lookAccuracys=dicInfos.getName();
}
}
if(returnImas!=null && !"".equals(returnImas) ){
if("backVedio".equals(returnImas)){
saveVedio=afterWeb+ "/"+dataNos+ "/video"+ "/"+lookAccuracys+"/"+videoNames;
}else if("frontVedio".equals(returnImas)){
saveVedio=afrontWeb+ "/"+dataNos+ "/video"+ "/"+lookAccuracys+"/"+videoNames;
}
}else{
saveVedio=web+ "/"+dataNos+ "/video"+ "/"+lookAccuracys+"/"+videoNames;
}
File file = new File(saveVedio);
in = new FileInputStream(file);
out = response.getOutputStream();
byte[] buffer = new byte[1024 * 1024];
int length;
while ((length = in.read(buffer)) > 0) {
out.write(buffer, 0, length);
}
} catch (FileNotFoundException e) {
System.out.println("文件读取失败,文件不存在");
e.printStackTrace();
} catch (IOException e) {
System.out.println("文件流输出异常");
e.printStackTrace();
} finally {
try {
in.close();
out.close();
} catch (IOException e) {
System.out.println("文件流关闭异常");
e.printStackTrace();
}
}
return null;
}