Pandora(TTSDK)

TTSDK of Bytedance

License

License

GroupId

GroupId

com.bytedanceapi
ArtifactId

ArtifactId

ttlicense
Last Version

Last Version

1.4.0.3
Release Date

Release Date

Type

Type

aar
Description

Description

Pandora(TTSDK)
TTSDK of Bytedance
Project URL

Project URL

https://open.bytedance.com/
Source Code Management

Source Code Management

https://github.com/TTvcloud/vcloud-sdk-java

Download ttlicense

How to add to project

<!-- https://jarcasting.com/artifacts/com.bytedanceapi/ttlicense/ -->
<dependency>
    <groupId>com.bytedanceapi</groupId>
    <artifactId>ttlicense</artifactId>
    <version>1.4.0.3</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.bytedanceapi/ttlicense/
implementation 'com.bytedanceapi:ttlicense:1.4.0.3'
// https://jarcasting.com/artifacts/com.bytedanceapi/ttlicense/
implementation ("com.bytedanceapi:ttlicense:1.4.0.3")
'com.bytedanceapi:ttlicense:aar:1.4.0.3'
<dependency org="com.bytedanceapi" name="ttlicense" rev="1.4.0.3">
  <artifact name="ttlicense" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.bytedanceapi', module='ttlicense', version='1.4.0.3')
)
libraryDependencies += "com.bytedanceapi" % "ttlicense" % "1.4.0.3"
[com.bytedanceapi/ttlicense "1.4.0.3"]

Dependencies

compile (1)

Group / Artifact Type Version
com.bytedanceapi : ttcommon jar 1.4.0.3

Project Modules

There are no modules declared in this project.

TTVcloud SDK for Java

- Maven依赖

<dependency>
    <groupId>com.bytedanceapi</groupId>
    <artifactId>vcloud-sdk-java</artifactId>
    <version>0.0.6</version>
</dependency>

AK/SK设置

  • 在代码里显示调用VodService的方法setAccessKey/setSecretKey

  • 在当前环境变量中分别设置 VCLOUD_ACCESSKEY="your ak" VCLOUD_SECRETKEY = "your sk"

  • json格式放在~/.vcloud/config中,格式为:{"ak":"your ak","sk":"your sk"}

以上优先级依次降低,建议在代码里显示设置,以便问题排查

地域Region设置

  • 目前已开放三个地域设置,分别为
    - cn-north-1 (默认)
    - ap-singapore-1
    - us-east-1
    
  • 默认为cn-north-1,如果需要调用其它地域服务,请在初始化函数getInstance中传入指定地域region,例如:
    IVodService vodService = VodServiceImpl.getInstance('us-east-1');
    
  • 注意:IAM模块目前只开放cn-north-1区域

API

上传

  • 通过指定url地址上传

uploadMediaByUrl

  • 服务端直接上传

上传视频包括 applyUploadcommitUpload 两步

上传封面图包括 applyUploadmodifyVideoInfo 两步

为方便用户使用,封装方法 uploadVideo 和 uploadPoster, 一步上传

转码

startTranscode

发布

setVideoPublishStatus

播放

getPlayInfo

getOriginVideoPlayInfo

getRedirectPlay

封面图

getPosterUrl

token相关

getUploadAuthToken

getPlayAuthToken

PS: 上述两个接口和 getRedirectPlay 接口中均含有 X-Amz-Expires 这个参数

关于这个参数的解释为:设置返回的playAuthToken或uploadToken或follow 302地址的有效期,目前服务端默认该参数为15min(900s),如果用户认为该有效期过长,可以传递该参数来控制过期时间 。

更多示例参见

src/test/java/com/bytedanceapi/example

Versions

Version
1.4.0.3
1.0.0.4