ueditor处理不能上传音乐的问题

选了个较简单的方法,在上传视频的功能里处理上传音乐

参考:https://segmentfault.com/a/1190000010364068

但上文方法不能同时上传音乐和视频,需要处理一下第一个方法:文件路径ueditor/dialog/video/video.js

/* 插入上传视频 */ function insertUpload() { var videoObjs = [], uploadDir = editor.getOpt(‘videoUrlPrefix’), width = parseInt( G ( ′ u p l o a d w i d t h ′ ) . v a l u e , 10 ) ∣ ∣ 420 , h e i g h t = p a r s e I n t ( G('upload_width').value, 10) || 420, height = parseInt( G(uploadwidth).value,10)420,height=parseInt(G(‘upload_height’).value, 10) || 280, align = findFocus(“upload_alignment”, “name”) || ‘none’; // for (var key in uploadVideoList) { // var file = uploadVideoList[key]; // videoObjs.push({ // url: uploadDir + file.url, // width: width, // height: height, // align: align // }); // } var count = uploadFile.getQueueCount(); // if (count) { // $(’.info’, ‘#queueList’).html(’’ + ‘还有2个未上传文件’.replace(/[\d]/, count) + ‘’); // return false; // } else { // editor.execCommand(‘insertvideo’, videoObjs, ‘upload’); // } if (count) { $(’.info’, ‘#queueList’).html(’’ + ‘还有2个未上传文件’.replace(/[\d]/, count) + ‘’); return false; } else { for (var key in uploadVideoList) { var is_music = 0; var file = uploadVideoList[key]; var ext = file.url.split(’.’).pop().toLowerCase(); var music_type = [‘mp3’, ‘wav’]; for (var i in music_type) { if (music_type[i] == ext) {

is_music = 1; }

} if (is_music) { editor.execCommand(‘music’, { url: uploadDir + file.url, width: 400, height: 95 }); } else { var file = uploadVideoList[key]; videoObjs.push({ url: uploadDir + file.url, width: width, height: height, align: align

}); editor.execCommand(‘insertvideo’, videoObjs, ‘upload’); }

}

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值