Skip to content

Commit f330845

Browse files
author
liyan.90210
committed
feat auto update sdk
1 parent 2dcc723 commit f330845

53 files changed

Lines changed: 5912 additions & 1379 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Change log
22

3+
2026-04-23 Bumped to version v1.0.268
4+
- Updated apis for livesaas/vod
5+
36
2026-04-16 Bumped to version v1.0.267
47
- Updated apis for live/livesaas
58

README.EN.MD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,7 @@ iamService.destroy()
119119
## Other resources
120120

121121
Examples are available under [example](./example)
122+
123+
## Security and privacy
124+
This project takes security seriously.
125+
For vulnerability reporting and supported versions, see [SECURITY.md](SECURITY.md)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,7 @@ iamService.destroy()
9898
##其它资源
9999
示例参见[example](./example)
100100

101+
## Security and privacy
102+
This project takes security seriously.
103+
For vulnerability reporting and supported versions, see [SECURITY.md](SECURITY.md)
104+

SECURITY.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Security and privacy
2+
3+
If you discover potential security issues in the project, or believe you may have found a security issue, please notify the ByteDance security team through our [security center](https://security.bytedance.com/src/) or [vulnerability reporting email](mailto:src@bytedance.com). Please do not create public GitHub Issues.
4+
5+
We will assess the vulnerability based on the Common Vulnerability Scoring System (CVSS 3.1). The security team will keep you updated on key progress and may request further information or guidance from you. You are welcome to contact us via the email or website mentioned above to ask questions or discuss disclosure matters.
6+
7+
To protect the security of our customers, ByteDance requests that you do not publish or share information regarding the vulnerability in any public forum, nor publish or share data involving users, until the vulnerability has been remediated and our users have been notified. Please understand that the time required for remediation depends on the severity of the vulnerability and the scope of the impact.
8+
9+
Individuals, companies, and security teams may wish to publish security advisories on their own websites or other forums. Please contact us via the email or website mentioned above prior to publication to discuss the information that can be disclosed and to coordinate the disclosure timeline.
10+
11+
## Bug Bounty Reward
12+
13+
[For the policy of bug bounty reward](https://bytedance.larkoffice.com/docx/ZstQd7bbooDctqxBCAmcFasOngd), if you have any questions about the rules, please contact [https://src.bytedance.com/home](https://src.bytedance.com/home) for consultation.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
package com.volcengine.example.vod.upload;
2+
3+
import com.alibaba.fastjson.JSON;
4+
import com.volcengine.helper.VodUploadMediaProcessListener;
5+
import com.volcengine.helper.VodUploadProgressListener;
6+
import com.volcengine.model.beans.Functions;
7+
import com.volcengine.model.beans.FunctionsWorkflowTemplate;
8+
import com.volcengine.service.vod.IVodService;
9+
import com.volcengine.service.vod.impl.VodServiceImpl;
10+
import com.volcengine.service.vod.model.request.VodUploadMediaRequest;
11+
import com.volcengine.service.vod.model.response.VodCommitUploadInfoResponse;
12+
13+
import java.util.ArrayList;
14+
import java.util.List;
15+
16+
public class VodUploadLocalM3u8WithManifestDemo {
17+
18+
public static void main(String[] args) {
19+
// Create a VOD instance in the specified region.
20+
// IVodService vodService = VodServiceImpl.getInstance("cn-north-1");
21+
IVodService vodService = VodServiceImpl.getInstance();
22+
23+
// Configure your Access Key ID (AK) and Secret Access Key (SK) in the
24+
// environment variables or in the local ~/.volc/config file. For detailed
25+
// instructions, see https://www.volcengine.com/docs/4/65641.
26+
// The SDK will automatically fetch the AK and SK from the environment variables
27+
// or the ~/.volc/config file as needed.
28+
// During testing, you may use the following code snippet. However, do not store
29+
// the AK and SK directly in your project code to prevent potential leakage and
30+
// safeguard the security of all resources associated with your account.
31+
// vodService.setAccessKey("your ak");
32+
// vodService.setSecretKey("your sk");
33+
34+
String space = "your space name";
35+
String filePath = "/path/to/your/video.m3u8";
36+
37+
// 以下为示例functions,根据实际情况添加
38+
List<Functions> functionsList = new ArrayList<>();
39+
Functions getMetaFunc = Functions.GetMetaFunction();
40+
functionsList.add(getMetaFunc);
41+
42+
Functions snapShotFunc = Functions.SnapShotFunction(2.3);
43+
functionsList.add(snapShotFunc);
44+
45+
Functions addOptionInfo = Functions.AddOptionInfoFunction("hls测试视频", "test", "素材测试,视频文件", 0, false);
46+
functionsList.add(addOptionInfo);
47+
48+
List<String> impTemplateIds = new ArrayList<>();
49+
impTemplateIds.add("imp template id");
50+
FunctionsWorkflowTemplate impTemplate = new FunctionsWorkflowTemplate(impTemplateIds, "imp");
51+
52+
List<String> transcodeTemplateIds = new ArrayList<>();
53+
transcodeTemplateIds.add("transcode template id");
54+
FunctionsWorkflowTemplate transcodeTemplate = new FunctionsWorkflowTemplate(transcodeTemplateIds,
55+
"transcode");
56+
57+
List<FunctionsWorkflowTemplate> templates = new ArrayList<>();
58+
templates.add(impTemplate);
59+
templates.add(transcodeTemplate);
60+
Functions workflowFunc = Functions.StartWorkFlowFunction(templates);
61+
functionsList.add(workflowFunc);
62+
63+
VodUploadMediaRequest vodUploadMediaRequest = VodUploadMediaRequest.newBuilder()
64+
.setSpaceName(space)
65+
.setFilePath(filePath)
66+
.setFileName("your/path/to/video.m3u8") // 上传后的存储路径,为避免ts文件路径覆盖,建议指定前缀路径
67+
.setFunctions(JSON.toJSONString(functionsList))
68+
.setSupportParseManifest(true)
69+
.setStorageClass(0)
70+
.build();
71+
// 需要进度条功能时添加相应 listener,如无需求,传 null 值即可
72+
VodUploadProgressListener listener = new VodUploadMediaProcessListener();
73+
74+
try {
75+
VodCommitUploadInfoResponse vodCommitUploadInfoResponse = vodService.uploadMedia(vodUploadMediaRequest,
76+
listener);
77+
if (vodCommitUploadInfoResponse.getResponseMetadata().hasError()) {
78+
System.out.println(vodCommitUploadInfoResponse.getResponseMetadata().getError());
79+
System.exit(-1);
80+
}
81+
System.out.println(vodCommitUploadInfoResponse.toString());
82+
System.out.println(vodCommitUploadInfoResponse.getResult().getData().getVid());
83+
System.out.println(vodCommitUploadInfoResponse.getResponseMetadata().getRequestId());
84+
} catch (Exception e) {
85+
e.printStackTrace();
86+
}
87+
}
88+
}

volc-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.volcengine</groupId>
7-
<version>1.0.267</version>
7+
<version>1.0.268</version>
88
<artifactId>volc-sdk-java</artifactId>
99

1010
<name>volc-sdk-java</name>

volc-sdk-java/src/main/java/com/volcengine/helper/Const.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,15 @@ public class Const {
708708
public static final String GetActivityBanUsers = "GetActivityBanUsers";
709709
public static final String UpdateActivityIpBanStatus = "UpdateActivityIpBanStatus";
710710
public static final String GetActivityBanIps = "GetActivityBanIps";
711+
712+
public static final String CreateActivityQuestionnaire = "CreateActivityQuestionnaire";
713+
public static final String UpdateActivityQuestionnaire = "UpdateActivityQuestionnaire";
714+
public static final String DeleteActivityQuestionnaire = "DeleteActivityQuestionnaire";
715+
public static final String GetActivityQuestionnaire = "GetActivityQuestionnaire";
716+
public static final String ListActivityQuestionnaire = "ListActivityQuestionnaire";
717+
public static final String CopyActivityQuestionnaire = "CopyActivityQuestionnaire";
718+
public static final String PublishActivityQuestionnaire = "PublishActivityQuestionnaire";
719+
public static final String OfflineActivityQuestionnaire = "OfflineActivityQuestionnaire";
711720
public static final String ListAreaConfig = "ListAreaConfig";
712721
public static final String CreateAreaConfig = "CreateAreaConfig";
713722
public static final String UpdateAreaConfig = "UpdateAreaConfig";

volc-sdk-java/src/main/java/com/volcengine/helper/VodUploadMediaProcessListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public void progressChanged(VodUploadProgressEvent progressEvent) {
1919
// 文件总大小通知
2020
case FILE_SIZE_EVENT:
2121
this.fileSize = bytes;
22+
this.bytesUploaded = 0;
2223
// business logic ....
2324
System.out.println("file size is " + this.fileSize);
2425
break;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.volcengine.model.beans.livesaas;
2+
3+
import com.alibaba.fastjson.annotation.JSONField;
4+
import lombok.Data;
5+
6+
@Data
7+
public class OptionAPI {
8+
@JSONField(name = "OptionName")
9+
String OptionName;
10+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.volcengine.model.beans.livesaas;
2+
3+
import com.alibaba.fastjson.annotation.JSONField;
4+
import lombok.Data;
5+
6+
import java.util.List;
7+
8+
@Data
9+
public class QuestionAPI {
10+
@JSONField(name = "Question")
11+
String Question;
12+
@JSONField(name = "IsRequire")
13+
Integer IsRequire;
14+
@JSONField(name = "QuestionTag")
15+
String QuestionTag;
16+
@JSONField(name = "QuestionSubTag")
17+
String QuestionSubTag;
18+
@JSONField(name = "Options")
19+
List<OptionAPI> Options;
20+
}

0 commit comments

Comments
 (0)