Browse Source

fix video

release_toaliyun_real
xiaohanzi 5 years ago
parent
commit
eb8ae29fed
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      mallinkVideo/src/main/java/com/iformall/video/aliyun/sdk/server/AliyunVedioServer.java

+ 7
- 4
mallinkVideo/src/main/java/com/iformall/video/aliyun/sdk/server/AliyunVedioServer.java View File

@@ -73,6 +73,9 @@ public class AliyunVedioServer {
return client.getAcsResponse(request);
}
private static String toLanEndpoint(String bucket) {
return bucket.replace(".aliyuncs.com", "-internal.aliyuncs.com");
}
private static OssUploadClient initOssClient(CreateUploadVideoResponse response) throws UnsupportedEncodingException {
final Base64.Decoder decoder = Base64.getDecoder();
String uploadAddressStr = new String(decoder.decode(response.getUploadAddress().getBytes("UTF-8")));
@@ -85,8 +88,8 @@ public class AliyunVedioServer {
String accessKeyId = uploadAuth.getString("AccessKeyId");
String accessKeySecret = uploadAuth.getString("AccessKeySecret");
String securityToken = uploadAuth.getString("SecurityToken");
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret,securityToken);
return new OssUploadClient(bucket, endpoint, fileName, client);
OSS client = new OSSClientBuilder().build(toLanEndpoint(endpoint), accessKeyId, accessKeySecret,securityToken);
return new OssUploadClient(bucket, toLanEndpoint(endpoint), fileName, client);
}
private static OssUploadClient initOssClient(RefreshUploadVideoResponse response) throws UnsupportedEncodingException {
@@ -101,8 +104,8 @@ public class AliyunVedioServer {
String accessKeyId = uploadAuth.getString("AccessKeyId");
String accessKeySecret = uploadAuth.getString("AccessKeySecret");
String securityToken = uploadAuth.getString("SecurityToken");
OSS client = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret,securityToken);
return new OssUploadClient(bucket, endpoint, fileName, client);
OSS client = new OSSClientBuilder().build(toLanEndpoint(endpoint), accessKeyId, accessKeySecret,securityToken);
return new OssUploadClient(bucket, toLanEndpoint(endpoint), fileName, client);
}
public static void uploadVideo(AliyunVideoConfig config,CreateUploadVideoResponse response,String localFile,RedisTemplate<String, Object> redisTemplate) throws UnsupportedEncodingException {


Loading…
Cancel
Save