'" controls="controls" width="260">您的浏览器不支持 video 标签。</video>' +
'</div><hr/>';
$('#listVideo{$append}').html(imTpl);
$(window).trigger("resize");
});
},
before: function(obj) {
console.log(obj)
layer.load();
},
done: function(res, index, upload) {
console.log(res)
layer.closeAll('loading');
if (res.code == 0) {
$(videoInput).val(res.data.src);
} else {
$(videoInput).val('');
layer.msg(res.msg, {
time: 1500
});
}
},
error: function(index, upload) {
layer.closeAll('loading');
}
});
$('#serverVideos{$append}').click(function(){
var html = ''
$.ajax('/manager/file/list',{
data:{
type:'video',
page:1,
size:30,
_token:_token
},
dataType:'json',//服务器返回json格式数据
type:'post',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
success:function(data){
if(data.code == 0){
if(data.data.length > 0){
html += '<divclass="layui-card-body"><divclass="serverVideoList"><ul>'
$.each(data.data,function(i,item){
html += '<li><idata-src="'+item.src+'"data-box="listVideo{$append}"data-input="video{$append}"onclick="videoUrl(this)"></i><videosrc="'+item.src+'"controls="controls"width="260">您的浏览器不支持 video 标签。</video></li>'
})
html += '</ul></div>';
if(data.data.length >= 30){
html += '<divclass="serverMore"><adata-box="listVideo{$append}"data-input="video{$append}"onclick="videoList(this)">加载更多</a></div>'
}
html += '<divclass="layui-clear"></div></div>';
layer.open({
type: 1,
title: '服务器视频',
shadeClose: true,
area: ['800px',''], //宽高
move: false,
content: html,
success:function(layero, index) {
alertRender()
layero.find('.serverVideoList ul li i').attr('data-id',index)
html += '<li><idata-src="'+item.src+'"data-id="'+$(obj).attr('data-id')+'"data-box="'+$(obj).attr('data-box')+'"data-input="'+$(obj).attr('data-input')+'"onclick="videoUrl(this)"></i><videosrc="'+item.src+'"controls="controls"width="260">您的浏览器不支持 video 标签。</video></li>'