1 Star 3 Fork 6

还俗二师兄 / layui-ctyun

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

layui-ctyun

介绍

layui整合天翼云jssdk

软件架构

layui整合天翼云jssdk

安装教程

  1. 下载直接安装到modules目录

使用说明

模块中直接连接的天翼云的官方jssdk,也可以修改成本地路径即可。 使用简单,直接传天翼云的相关参数进去就行,支持自定义FilesAdded、FileUploaded、ChunkUploaded、BeforeUpload等方法。

layui.config({
	base: '__PUBLIC__/layui/' //静态资源所在路径
}).extend({
	ctyun: 'ctyun/index',
}).use(['index', 'ctyun'], function(){
	var $ = layui.$
	,element = layui.element
	,layer = layui.layer
	,ctyun= layui.ctyun;
	ctyun.loader({
		endPoint: '{$config.ctyun_domain}'
		, browse_button: "upload-video" 
		, drop_element: "hahaha" 
		, BucketName: "{$config.ctyun_bucket}"
		, accessKeyId: "{$config.ctyun_access_key}"
		, secretAccessKey: "{$config.ctyun_secret_key}"
		, initial: true
		, UploadProgress: function(response){
			$(".show_video").show();
			$(".layui-progress").hide();
			element.progress('video-progress', response.percent + '%');
		}
		, UploadComplete: function(res){
			// layer.closeAll('loading'); // 可以调用loading
			layer.msg("上传成功!");
			$("#video_url").val(res.Location);
			$(".show_video").find("video").attr("src", res.Location);
			$(".layui-progress").hide();
		}
	})
});
MIT License Copyright (c) 2020 还俗二师兄 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

layui模块:使用plupload插件,调用天翼云官方SDK实现分片上传。 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/deusit/layui-ctyun.git
git@gitee.com:deusit/layui-ctyun.git
deusit
layui-ctyun
layui-ctyun
master

搜索帮助