GithubHelp home page GithubHelp logo

hwthwt / mvs-java-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tencentyun/mvs-java-sdk

0.0 1.0 0.0 2.95 MB

微视频(Micro Video Service)Java SDK使用说明

Home Page: https://www.qcloud.com/doc/product/314/3502

License: MIT License

Java 100.00%

mvs-java-sdk's Introduction

tencentyun-video-java-sdk

java sdk for [腾讯云微视频服务]

安装(直接下载源码集成)

直接下载源码集成

从github下载源码装入到您的程序中 调用请参考示例

修改配置

修改Demo.java内的appid等信息为您的配置

上传、查询、删除程序示例

package com.qcloud.video;
import com.qcloud.video.api.*;

public class Demo {
	//通过控制台获取AppId,SecretId,SecretKey
	public static final int APP_ID = 1000000;
	public static final String SECRET_ID = "SECRET_ID";
	public static final String SECRET_KEY = "SECRET_KEY";
	
	public static void main(String[] args) {
		VideoCloud video = new VideoCloud(APP_ID, SECRET_ID, SECRET_KEY);
		try{			
			String result = "";
			String bucketName = "abcde";
            long start = System.currentTimeMillis();
			//创建目录
			result = video.createFolder(bucketName, "/sdk/","");
			System.out.println("=======createFolder========\n"+result);
			//上传视频
			result = video.uploadFile(bucketName, "/sdk/test.mp4", "D:\\test.mp4");
			System.out.println("=======uploadFile========\n"+result);
			//result = video.uploadFile(bucketName, "/sdk/test.mp4", "D:\\test.mp4", "test file attr", "test title","test desc");
			//更新视频属性、标题、描述等信息
			result = video.updateFile(bucketName, "/sdk/test.mp4", "test file attr", "test title","test desc");
			System.out.println("=======updateFile========\n"+result);
			//获取目录下视频文件信息
            result = video.getFolderList(bucketName, "/", 20, "", 0, VideoCloud.FolderPattern.Both);
            System.out.println("=======getFolderList========\n"+result);
            //获取视频信息  
            result = video.getFileStat(bucketName, "/sdk/test.mp4");
            System.out.println("=======getFileStat========\n"+result);
			//更新目录属性
            result = video.updateFolder(bucketName, "/sdk/", "test folder");
            System.out.println("=======updateFolder========\n"+result);
			//获取目录属性
            result = video.getFolderStat(bucketName, "/sdk/");
            System.out.println("=======getFolderStat========\n"+result);
			//删除视频文件
            result = video.deleteFile(bucketName, "/sdk/test.mp4");
            System.out.println("=======deleteFile========\n"+result);
			//删除目录,目录必须为空
            result = video.deleteFolder(bucketName, "/sdk/");
            System.out.println("=======deleteFolder========\n"+result);
			//分片上传文件
            //result = video.sliceUploadFile(bucketName, "/sdk/big.mp4", "F:\\big.mp4");
			//result = video.sliceUploadFile(bucketName, "/sdk/big.mp4", "F:\\big.mp4", "test file attr", "test title","test desc",512 * 1024);
            long end = System.currentTimeMillis();
            System.out.println("总用时:" + (end - start) + "毫秒");
			System.out.println("The End!");
		}
		catch(Exception e){
			System.out.println(e.getMessage());
		}
	}
}

mvs-java-sdk's People

Contributors

csky2013 avatar wmiao1 avatar degangliu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.