';
}
parent.append(htmlStr);
parent.find('.qtuploader__view video')[0].currentTime = $(this).siblings('.qtuploader__picinputBox').find('.qtuploader__picinput').val();
parent.find('.qtuploader__view').fadeIn();
});
/*设置海报帧预览时间*/
$('.qtuploader__items').on('keyup','.qtuploader__picinput',function() {
var parent = $(this).closest('.qtuploader__picinputBox');
var video = $(this).closest('.qtuploader__itemsbd').find('video');
var strVal = $.trim($(this).val());
console.log(strVal)
if (strVal == '') {
parent.addClass('is-error');
parent.find('.qverify__font').text('请设置海报帧');
} else if (!(/^[0-9]*$/.test(strVal))) {
parent.addClass('is-error');
parent.find('.qverify__font').text('请输入数字');
} else if (video.length > 0 && strVal > video[0].duration) {
parent.addClass('is-error');
parent.find('.qverify__font').text('不超过(' + video[0].duration + ')');
console.log('111---' + video[0].duration)
} else {
parent.removeClass('is-error');
parent.find('.qverify__font').text('请设置海报帧');
}
})
/*关闭预览*/
$(document).undelegate('.qtuploader__mask','click');
$(document).delegate('.qtuploader__mask','click',function() {
$(this).closest('.qtuploader__view').fadeOut('normal',function() {
$(this).closest('.qtuploader__view').remove();
})
})
/*设置预览大小*/
function setSize(element) {
var thumbWidth = 0,thumbHeight = 0,arr = [];
var winWidth = $(window).width(),winHeight = $(window).height();
var imgWidth = element.width(),imgHeight = element.height();
if (imgWidth > imgHeight) {
thumbHeight = parseInt(winHeight - 200);
thumbWidth = parseInt((1920 * thumbHeight) / 1080);
} else {
thumbHeight = parseInt(winHeight - 200);
thumbWidth = parseInt((1080 * thumbHeight) / 1920);
}
arr.push(thumbHeight,thumbWidth)
return arr;
}