升级Layui版本,优化视频上传

This commit is contained in:
邹景立 2022-11-09 10:36:25 +08:00
parent cfb3ff4938
commit 7e8e721883
3 changed files with 3 additions and 3 deletions

View File

@ -597,7 +597,7 @@ $(function () {
if (this.dataset.inited) return; else this.dataset.inited = 'true';
var $bt = $('<div class="uploadimage uploadvideo"><span><a data-file class="layui-icon layui-icon-upload-drag"></a><i class="layui-icon layui-icon-search"></i><i class="layui-icon layui-icon-close"></i></span><span data-file></span></div>');
var $in = $(this).on('change', function () {
if (this.value) $bt.find('span[data-file]').html('<video width="100%" height="100%" controls><source src="' + encodeURI(this.value) + '" type="video/mp4"></video>');
if (this.value) $bt.find('span[data-file]').html('<video width="100%" height="100%" autoplay loop muted><source src="' + encodeURI(this.value) + '" type="video/mp4"></video>');
}).after($bt).trigger('change');
$bt.on('click', 'i.layui-icon-search', function (event) {
event.stopPropagation(), $in.val() && $.form.iframe(encodeURI($in.val()), '视频预览');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long