123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <%@ page contentType="text/html;charset=UTF-8" %>
- <%@ include file="/webpage/include/taglibf.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>${fns:getConfig("productName")}</title>
- <link rel="stylesheet" href="${ctxStaticWeb}/css/base.css" />
- <link rel="stylesheet" href="${ctxStaticWeb}/css/second.css" />
- <script src="${ctxStaticWeb}/js/jquery-1.8.3.min.js" type="text/javascript"></script>
- <script>
- $(document).ready(function() {
- $('.videoWrapper').bind('contextmenu',function() { return false; });
- $('#myvideo').bind('contextmenu',function() { return false; });
- var init_num=0;
- var myvideo= $("#myvideo")[0];//document.getElementById('myvideo');
- if(myvideo==null){
- //myvideo = document.getElementsByClassName("note-video-clip");
- }
- //console.log(myvideo);
- var totalTimes = 0 ;
- var videoScoreType = '${news.scoreType}';
- if(myvideo!=null){
- /*myvideo.addEventListener('play',function(){
- if(init_num==0){
- init_num++;
- }
- });*/
- //视频可以播放触发事件
- myvideo.addEventListener("canplay",function(){
- totalTimes = Math.ceil(this.duration); //视频总时长
- console.log("total:"+totalTimes);
- alert(videoScoreType);
- if(videoScoreType=='1'){//1-进入观看得分
- $.ajax({
- url:"${ctxF}/videonews/setVideoInfo",
- type:"POST",
- cache: false,
- dataType:"json",
- data: {id: '${news.id}',totalRecord:totalTimes,typeId:'${news.typeId}'},
- success: function(data){
- console.log("canplay:"+data.success);
- },
- complete: function(XMLHttpRequest, textStatus){
- }
- });
- }
- })
- //播放过程中
- myvideo.addEventListener("timeupdate",function(){
- //用秒数来显示当前播放进度
- var timeDisplay = Math.floor(myvideo.currentTime);
- //当视频播放时间大于1分钟
- if(timeDisplay>=60 && timeDisplay %60==0){//60秒一更新
- if(videoScoreType=='2'){//2-观看一定时长得分
- console.log("timeupdate:"+timeDisplay);
- $.ajax({
- url:"${ctxF}/videonews/updateVideoTime",
- type:"POST",
- cache: false,
- dataType:"json",
- data: {id: '${news.id}',totalRecord:totalTimes,typeId:'${news.typeId}',record:timeDisplay},
- success: function(data){
- console.log("timeupdate result:"+data.success);
- },
- complete: function(XMLHttpRequest, textStatus){
- //do something in the end...
- }
- });
- }
- }
- },false);
- //视频播放完成
- myvideo.addEventListener("ended",function(){
- if(videoScoreType=='2'){//2-观看一定时长得分
- $.ajax({
- url:"${ctxF}/videonews/updateVideoTime",
- type:"POST",
- cache: false,
- dataType:"json",
- data: {id: '${news.id}',totalRecord:totalTimes,typeId:'${news.typeId}',record:totalTimes},
- success: function(data){
- console.log("ended:"+data.success);
- },
- complete: function(XMLHttpRequest, textStatus){
- //do something in the end...
- }
- });
- }
- })
- }
- })
- </script>
- <style type="text/css">
- video::-internal-media-controls-download-button {
- display:none;
- }
- video::-webkit-media-controls-enclosure {
- overflow:hidden;
- }
- video::-webkit-media-controls-panel {
- width: calc(100% + 30px);
- }
- </style>
- </head>
- <body>
- <%@ include file="/webpage/modules/web/top.jsp"%>
- <div class="new w">
- <div class="position">当前位置:<a href="${ctx}/">网站首页</a> > <a href="${ctxF}/videonews?typeId=${news.typeId}">${news.typeName}</a> > 详细内容</div>
- </div>
- <div class="new w" style="border:1px solid #ccc">
- <div class="text_top">
- <h1>${news.title}</h1>
- <hr>
- <h2>发布日期:<span><fmt:formatDate value="${news.createDate}" pattern="yyyy-MM-dd"/></span> 文章来源:<span>${news.source==''?'--':news.source}</span> </h2>
- </div>
- <div class="text">
- <c:if test="${news.url1 != null && news.url1 !=''}">
- <c:if test="${news.typeId != '2'}">
- <div class="img">
- <video scrolling="no" height="100%" controlsList="nodownload" autoplay style="scrolling:no;background-color: black;" width="100%" src='${news.url1}' controls="controls" id="myvideo">
- 您的浏览器不支持视频标签.
- </video>
- </div>
- </c:if>
- <c:if test="${news.typeId == '2'}">
- <div class="img">
- <%--<iframe src="http://dygbjy.12371.cn/zbpd/" width="100%" height="1000" ></iframe>--%>
- <iframe src="${news.url1}" width="100%" height="550" ></iframe>
- </div>
- </c:if>
- </c:if>
- <p>${fns:unescapeHtml(news.contents)}</p>
- </div>
- </div>
- <%@ include file="/webpage/modules/web/footer.jsp"%>
- </body>
- </html>
|