198 lines
8.1 KiB
Plaintext
198 lines
8.1 KiB
Plaintext
<%@ Page CodeBehind="insertvideo.aspx.cs" Language="c#" AutoEventWireup="True" Inherits="CompanyWeb.insertvideo" %>
|
||
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" >
|
||
<HTML>
|
||
<HEAD>
|
||
<TITLE>²åÈëÊÓÆµ</TITLE>
|
||
<style type="text/css">*{ margin:0;padding:0;}</style>
|
||
<link rel="stylesheet" type="text/css" href="/css/cjadd.css">
|
||
<script src="/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
|
||
<script src="/Scripts/qiniu.min.js" type="text/javascript"></script>
|
||
<script src="/Scripts/moment.js" type="text/javascript"></script>
|
||
<style type="text/css">
|
||
.uploadvideobox{ display:inline-block; width:100%;}
|
||
.uploadvideobtnbox{ position:relative;
|
||
width: 8em;
|
||
height: 2em;
|
||
line-height: 2em;
|
||
margin: 1em auto;
|
||
background: linear-gradient(to right, #fec02e, #fc9b06);
|
||
border-radius: 0.5em;
|
||
|
||
color:#fff;}
|
||
.uploadvideobtnbox span{width: 100%;height: 100%; display:block;text-align:center;}
|
||
.uploadvideobtnbox input#videofile{position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 100%;
|
||
opacity: 0;
|
||
border:0;
|
||
background-color:#000;}
|
||
.processbox{position: relative; width: 90%;height: 0.5em;border-radius: 10px;background: #999;margin: 10px auto;border: 1px solid #ff6780;}
|
||
.child{position: relative;height:100%;border-radius:inherit; background-color:#ff4500;}
|
||
|
||
.process-animate{background: #ff6780;position: absolute;left: 0;top: 0;bottom: 0;border-radius:inherit;
|
||
animation: process 1s linear forwards ;
|
||
}
|
||
@keyframes process
|
||
{
|
||
0%{
|
||
left:0;right:100%;
|
||
}
|
||
20%{
|
||
right:80%
|
||
}
|
||
40%{
|
||
right:60%;
|
||
}
|
||
60%{right:40%;}
|
||
80%{right:20%;}
|
||
100%{right:0;}
|
||
}
|
||
.delvideobtnbox{display:inline-block; margin-left:1em; margin-top:1em; width:2em; height:2em; background-color:#fff; cursor:pointer; display:none}
|
||
.delvideobtnbox img{display:inline-block; width:100%; height:100%;}
|
||
</style>
|
||
<script src="/artDialog/artDialog.js?skin=default" type="text/javascript"></script>
|
||
<script src="/artDialog/iframeTools.js" type="text/javascript"></script>
|
||
<script type="text/javascript">
|
||
function judgetime1(){
|
||
var thedate = new Date();
|
||
return date2str(thedate,"yyyyMMddhhmmss");
|
||
}
|
||
|
||
function date2str(x,y) {
|
||
var z = {y:x.getFullYear(),M:x.getMonth()+1,d:x.getDate(),h:x.getHours(),m:x.getMinutes(),s:x.getSeconds()};
|
||
return y.replace(/(y+|M+|d+|h+|m+|s+)/g,function(v) {return ((v.length>1?"0":"")+eval('z.'+v.slice(-1))).slice(-(v.length>2?v.length:2))});
|
||
}
|
||
function selectimage(id) {
|
||
$("#"+id).toggleClass("selected");
|
||
}
|
||
function qydelete(id) {
|
||
var file = $("#hidden_file").val();
|
||
if (file != "") {
|
||
$.post("/ajax.ashx", { action: "deleteimage", delpics: escape(file) }, function (data) {
|
||
|
||
if (data.success) {
|
||
alert("ɾ³ý³É¹¦");
|
||
$("#hidden_file").val("");
|
||
art.dialog.close();
|
||
} else {
|
||
alert("ɾ³ýʧ°Ü");
|
||
}
|
||
});
|
||
} else {
|
||
alert("Äú»¹Ã»ÓÐÉÏ´«ÊÓÆµ");
|
||
}
|
||
}
|
||
function qx() {
|
||
art.dialog.close();
|
||
}
|
||
function qyinsert(t) {
|
||
var file = $("#hidden_file").val();
|
||
if (file != "") {
|
||
<%if (t == 1)
|
||
{%>
|
||
var d = $(window.parent.document);
|
||
var ypic = d.find("#hiddenvideo").val();
|
||
var dpic = file;
|
||
if (ypic!="" && ypic != dpic) {
|
||
window.parent.deletefile(1);
|
||
}
|
||
d.find("#hiddenvideo").val(file);
|
||
d.find("#selectvideo").html("ÒÑÉÏ´«");
|
||
d.find("#delvideo").css("display","inline-block");
|
||
<%}
|
||
else
|
||
{%>
|
||
var html = "<div style=\"width:100%;text-align:center;\"><video width=\"500\" height=\"400\" style=\"background-color: #000000;\" controls=\"controls\" autoplay=\"autoplay\" poster=\"\" x5-playsinline=\"\" playsinline=\"\" webkit-playsinline=\"\"><source src=\"" + file + "\" type=\"video/mp4\"></video></div><span style=\"display:none\">ÓÃÓÚ±£´æÊÓÆµ²»Äܱ£´æÎÊÌâ</span><br/>";
|
||
window.parent.insertHtml(html);
|
||
<%}%>
|
||
art.dialog.close();
|
||
|
||
} else {
|
||
alert("Äú»¹Ã»ÓÐÉÏ´«ÊÓÆµ");
|
||
}
|
||
}
|
||
function videoUploading() {
|
||
var d = $(window.parent.document);
|
||
|
||
try {
|
||
// ÆßÅ£ÔÆuptoken
|
||
var token = "<%=upToken %>";
|
||
|
||
// configÐÅÏ¢ object ²ÎÊý¿ÉÑ¡
|
||
var config = {
|
||
//±íʾÊÇ·ñʹÓà cdn ¼ÓËÙÓòÃû£¬Îª²¼¶ûÖµ£¬true ±íʾʹÓã¬Ä¬ÈÏΪ false¡£
|
||
useCdnDomain: false,
|
||
// ÊÇ·ñ½ûÓÃÈÕÖ¾±¨¸æ£¬Îª²¼¶ûÖµ£¬Ä¬ÈÏΪ false¡£
|
||
disableStatisticsReport: true,
|
||
// Ñ¡ÔñÉÏ´«ÓòÃûÇøÓò£»µ±Îª null »ò undefined ʱ£¬×Ô¶¯·ÖÎöÉÏ´«ÓòÃûÇøÓò¡£
|
||
retryCount: 3,
|
||
// Ñ¡ÔñÉÏ´«ÓòÃûÇøÓò£»µ±Îª null »ò undefined ʱ£¬×Ô¶¯·ÖÎöÉÏ´«ÓòÃûÇøÓò¡£
|
||
region: "",
|
||
// ÊÇ·ñ¿ªÆô MD5 УÑ飬Ϊ²¼¶ûÖµ£»ÔڶϵãÐø´«Ê±£¬¿ªÆô MD5 УÑé»á½«ÒÑÉÏ´«µÄ·ÖƬÓ뵱ǰ·ÖƬ½øÐÐ MD5 Öµ±È¶Ô£¬Èô²»Ò»Ö£¬ÔòÖØ´«¸Ã·ÖƬ£¬±ÜÃâʹÓôíÎóµÄ·ÖƬ¡£¶ÁÈ¡·ÖƬÄÚÈݲ¢¼ÆËã MD5 ÐèÒª»¨·ÑÒ»¶¨µÄʱ¼ä£¬Òò´Ë»áÉÔ΢Ôö¼Ó¶ÏµãÐø´«Ê±µÄºÄʱ£¬Ä¬ÈÏΪ false£¬²»¿ªÆô¡£
|
||
checkByMD5: false,
|
||
// ·ÖƬÉÏ´«Ê±Ã¿Æ¬µÄ´óС
|
||
chunkSize: 4,
|
||
};
|
||
|
||
// putExtra
|
||
var putExtra = {
|
||
customVars: {}
|
||
};
|
||
// ¶¨ÒåÉÏ´«Îļþ
|
||
var file = $("#videofile")[0].files[0]
|
||
// ÉèÖÃkey keyΪÉÏ´«ºóµÄÎļþÃû ×Ô¶¨Òå¼´¿É
|
||
var name = file.name;
|
||
var key = "mdavideo/" + judgetime1() + name.substring(name.lastIndexOf("."));
|
||
|
||
const observable = qiniu.upload(file, key, token, putExtra, config)
|
||
// ¿ªÊ¼ÉÏ´«
|
||
observable.subscribe({
|
||
next: (result) => {
|
||
$(".processbox .child").css("width",result.total.percent+"%");
|
||
//alert(JSON.stringify(result));
|
||
//ÉÏ´«½ø¶È
|
||
//if (response.total.percent > 0) {
|
||
/* code ¡¤¡¤¡¤ */
|
||
// }
|
||
},
|
||
error: (err) => {
|
||
//ÉÏ´«Ê§°Ü
|
||
/* code ¡¤¡¤¡¤ */
|
||
//alert(JSON.stringify(err)+"00");
|
||
},
|
||
complete: (res) => {
|
||
//ÉÏ´«³É¹¦
|
||
$("#hidden_file").val("https://fv.pmhapp.cn/"+res.key);
|
||
alert("ÉÏ´«³É¹¦");
|
||
},
|
||
});
|
||
} catch (err) {
|
||
alert(err);
|
||
}
|
||
}
|
||
</script>
|
||
</HEAD>
|
||
<BODY>
|
||
<div class="imagebox"><h3><a href="javascript:void()" id="a1" class="visited" onclick="showbox(1)">±¾µØÉÏ´«</a><!--<a href="javascript:void()" id="a2" onclick="showbox(2)">ÔÚÏß¹ÜÀí</a>--></h3>
|
||
<div id="insertbox1" class="insertbox">
|
||
|
||
<div class="insertbody"> <div class="uploadvideobox">
|
||
<div class="processbox">
|
||
<div class="child" style="width:0%">
|
||
<p class="process-animate"></p>
|
||
</div>
|
||
</div>
|
||
<div class="clear"></div>
|
||
<div class="uploadvideobtnbox"><span>ÉÏ´«</span><input type="file" id="videofile" value="" onchange="videoUploading()" accept="video/*" /></div>
|
||
|
||
</div></div>
|
||
<div class="insertbutton"><input id="qydelete1" type="button" value="ɾ³ý" onclick="qydelete(1)" class="btnccc" /><input id="qx1" type="button" value="È¡Ïû" onclick="qx()" class="btnccc" /><input id="qyinsert1" type="button" value="²åÈëÊÓÆµ" onclick="qyinsert(1)" /></div>
|
||
</div>
|
||
|
||
</div>
|
||
<input id="hidden_file" type="hidden" />
|
||
</BODY>
|
||
</HTML>
|