本示例介绍使用Alibaba Cloud SDK for Java调用DeleteLivePullStreamInfoConfig接口删除拉流信息。
前提条件
请在pom.xml文件中增加以下依赖,准确的SDK版本号,参见 阿里云开发工具包(SDK)。
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>java.demo</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-core -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>4.4.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-live -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-live</artifactId>
<version>3.7.5</version>
</dependency>
</dependencies>
</project>
示例代码
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.live.model.v20161101.DeleteLivePullStreamInfoConfigRequest;
import com.aliyuncs.live.model.v20161101.DeleteLivePullStreamInfoConfigResponse;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.google.gson.Gson;
/**
* 删除拉流信息。
*/
public class TestDeleteLivePullStreamInfoConfig {
public static void main(String[] args) {
IClientProfile profile = DefaultProfile.getProfile(
"<your-region-id>", // 地域ID
"<your-access-key-id>", // 您的AccessKey ID
"<your-access-key-secret>" ); // 您的AccessKey Secret
IAcsClient client = new DefaultAcsClient(profile);
DeleteLivePullStreamInfoConfigRequest request = new DeleteLivePullStreamInfoConfigRequest();
// 直播流所属应用名称。
request.setAppName("testApp");
// 您的拉流域名为用户的播放域名。
request.setDomainName("www.yourdomain.com");
// 直播流名。
request.setStreamName("testStream");
try {
DeleteLivePullStreamInfoConfigResponse response = client.getAcsResponse(request);
System.out.println(new Gson().toJson(response));
} catch (ClientException e) {
System.out.println("ErrCode:" + e.getErrCode());
System.out.println("ErrMsg:" + e.getErrMsg());
System.out.println("RequestId:" + e.getRequestId());
}
}
}
在文档使用中是否遇到以下问题
更多建议
匿名提交