1 Star 3 Fork 5

还俗二师兄 / layui-ctyun

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

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();
		}
	})
});

Repository Comments ( 1 )

Sign in to post a comment

About

layui模块:使用plupload插件,调用天翼云官方SDK实现分片上传。 expand collapse
JavaScript
MIT
Cancel

Releases

No release

layui-ctyun

Contributors

All

Activities

Load More
can not load any more
JavaScript
1
https://gitee.com/2sx/layui-ctyun.git
git@gitee.com:2sx/layui-ctyun.git
2sx
layui-ctyun
layui-ctyun
master

Search

184635 d8eb8a04 1850385 161156 f1cf3f24 1850385