提交 79e6f2a4 编写于 作者: 青阳龙野's avatar 青阳龙野

update to v1.0.32-release

上级 9d104a2d
......@@ -21,9 +21,7 @@ $(function() {
success : function(result) {
if (result != "ERROR") {
f = eval("(" + result + ")");
$("#vname").text(
f.fileName.replace('\'', '&#39;').replace('<',
'&lt;').replace('>', '&gt;'));
$("#vname").text(f.fileName);
$("#vcreator").text(f.fileCreator);
$("#vcdate").text(f.fileCreationDate);
$("#vsize").text(f.fileSize);
......
function getFileId(){var b,a=location.search;return-1!=a.indexOf("?")?(b=a.substr(1),strs=b.split("="),strs[1]):""}function playVideo(){$("#playerbox").html("<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'><source src='resourceController/getResource/"+f.fileId+"' type='video/mp4'></video>");var a=videojs("kiftplayer",{preload:"auto"});a.ready(function(){this.play()})}function reMainPage(){null!=tReq&&tReq.abort(),null!=tTimer&&window.clearTimeout(tTimer),window.opener=null,window.open("","_self"),window.close()}function doTranscode(){tReq=$.ajax({url:"resourceController/getVideoTranscodeStatus.ajax",type:"POST",dataType:"text",data:{fileId:f.fileId},success:function(a){"FIN"==a?playVideo():"ERROR"==a?(alert("错误:请求失败,请刷新重试。"),reMainPage()):($("#transcodeProgress").text(a),tTimer=setTimeout("doTranscode()",500))},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})}function showCloseBtn(){var a=$(window).width();450>a?$("#closeBtn").addClass("hidden"):$("#closeBtn").removeClass("hidden")}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&window.clearInterval(pingInt)},error:function(){window.clearInterval(pingInt)}})}var tReq,tTimer,pingInt;$(function(){window.onresize=function(){showCloseBtn()},pingInt=setInterval("ping()",6e4);var fileId=getFileId();$.ajax({url:"homeController/playVideo.ajax",type:"POST",dataType:"text",data:{fileId:fileId},success:function(result){"ERROR"!=result?(f=eval("("+result+")"),$("#vname").text(f.fileName.replace("'","&#39;").replace("<","&lt;").replace(">","&gt;")),$("#vcreator").text(f.fileCreator),$("#vcdate").text(f.fileCreationDate),$("#vsize").text(f.fileSize),"N"==f.needEncode?playVideo():($("#playerMassage").html("<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>"),doTranscode())):(alert("错误:无法定位要预览的文件或该操作未被授权。"),reMainPage())},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})});
\ No newline at end of file
function getFileId(){var b,a=location.search;return-1!=a.indexOf("?")?(b=a.substr(1),strs=b.split("="),strs[1]):""}function playVideo(){$("#playerbox").html("<video id='kiftplayer' class='video-js col-md-12' controls preload='auto' height='500'><source src='resourceController/getResource/"+f.fileId+"' type='video/mp4'></video>");var a=videojs("kiftplayer",{preload:"auto"});a.ready(function(){this.play()})}function reMainPage(){null!=tReq&&tReq.abort(),null!=tTimer&&window.clearTimeout(tTimer),window.opener=null,window.open("","_self"),window.close()}function doTranscode(){tReq=$.ajax({url:"resourceController/getVideoTranscodeStatus.ajax",type:"POST",dataType:"text",data:{fileId:f.fileId},success:function(a){"FIN"==a?playVideo():"ERROR"==a?(alert("错误:请求失败,请刷新重试。"),reMainPage()):($("#transcodeProgress").text(a),tTimer=setTimeout("doTranscode()",500))},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})}function showCloseBtn(){var a=$(window).width();450>a?$("#closeBtn").addClass("hidden"):$("#closeBtn").removeClass("hidden")}function ping(){$.ajax({url:"homeController/ping.ajax",type:"POST",dataType:"text",data:{},success:function(a){"pong"!=a&&window.clearInterval(pingInt)},error:function(){window.clearInterval(pingInt)}})}var tReq,tTimer,pingInt;$(function(){window.onresize=function(){showCloseBtn()},pingInt=setInterval("ping()",6e4);var fileId=getFileId();$.ajax({url:"homeController/playVideo.ajax",type:"POST",dataType:"text",data:{fileId:fileId},success:function(result){"ERROR"!=result?(f=eval("("+result+")"),$("#vname").text(f.fileName),$("#vcreator").text(f.fileCreator),$("#vcdate").text(f.fileCreationDate),$("#vsize").text(f.fileSize),"N"==f.needEncode?playVideo():($("#playerMassage").html("<h2>播放器正在努力解码中...</h2><h3>已完成:<span id='transcodeProgress'>0</span>%</h3><p class='text-muted'>提示:该视频需解码后播放,请耐心等待!</p>"),doTranscode())):(alert("错误:无法定位要预览的文件或该操作未被授权。"),reMainPage())},error:function(){alert("错误:请求失败,请刷新重试。"),reMainPage()}})});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册