From fcdd4a5b9dbb529e718ea964ed203757c008188c Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Wed, 8 Jun 2022 17:17:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/static/assets/js/layui-util.js | 80 ++++++++++++++----- 1 file changed, 61 insertions(+), 19 deletions(-) diff --git a/common/src/main/resources/static/assets/js/layui-util.js b/common/src/main/resources/static/assets/js/layui-util.js index 5de36289..edf08967 100644 --- a/common/src/main/resources/static/assets/js/layui-util.js +++ b/common/src/main/resources/static/assets/js/layui-util.js @@ -218,12 +218,6 @@ function LayuiUtil(layui, viewer) { function addClick() { var layerLoadingIndex; var url = 'api/file/v2/upload-file'; - if (isApp) { - url = 'app/file/v2/upload-file' - } - if (isAppRelease) { - url = 'app/file/v2/upload-file-release' - } upload.render({ elem: uploadBtnId, url: url, @@ -302,6 +296,31 @@ function LayuiUtil(layui, viewer) { var uploadBtnId = id + 'UploadBtn'; var deleteBtnClass = '.delete-' + fieldName + '-btn'; + /** + * 绑定视频事件 + */ + function bindVideoEvent() { + // 暂停其他所有的视频 + function pauseOtherAllVideo(playVideo) { + var videos = document.querySelectorAll('video'); + for(var i = 0, video; video = videos[i++];) { + if(playVideo === video) { + continue; + } + video.pause(); + } + } + // 绑定事件 + var videos = document.querySelectorAll('video'); + for(var i = 0, video; video = videos[i++];) { + video.onplay = function() { + // 关闭其他 + pauseOtherAllVideo(this); + } + video.onpause = function() {} + } + } + function init() { var files = $(id).val(); var fileArray = files ? files.split(',') : []; @@ -312,7 +331,7 @@ function LayuiUtil(layui, viewer) { var fileName = idNameArray[1]; html += [ '
', - '