<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
|
<title>文件浏览</title>
|
<link rel="stylesheet" href="static/plugins/mediaelement/mediaelementplayer.min.css" type="text/css" />
|
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
|
<script type="text/javascript" src="static/plugins/mediaelement/mediaelement-and-player.min.js"></script>
|
<style>
|
html, body {
|
height: 100%;
|
overflow: hidden;
|
margin: 0px;
|
padding: 0px;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="players" id="player1-container">
|
<div class="media-wrapper">
|
<%-- <video id="player1" src="general/${attachViewUrl}"> --%>
|
<object width="100%" height="240" type="application/x-shockwave-flash" data="static/plugins/mediaelement/mediaelement-flash-video.swf">
|
<param name="movie" value="static/plugins/mediaelement/mediaelement-flash-video.swf" />
|
<param name="flashvars" value="controls=true&allowScriptAccess=always&file=general/${attachViewUrl}" />
|
</object>
|
<!-- </video> -->
|
</div>
|
</div>
|
<script>
|
if ($('#player1').mediaelementplayer) {
|
var mediaElem = $('#player1').mediaelementplayer({
|
"alwaysShowControls" : "true",
|
"autoplay" : true,
|
"loop" : false,
|
"stretching" : "fill",
|
"success" : function(mediaElement, originalNode, instance) {}
|
});
|
|
$(window).resize(function() {
|
var videoHeight = $("video").height();
|
var videoWidth = $("video").width();
|
var wheight = $(this).height();
|
console.log(videoHeight, wheight)
|
if (videoHeight > wheight) {
|
mediaElem.get(0).setSize(null, wheight);
|
}
|
})
|
}
|
</script>
|
</body>
|
</html>
|