| @@ -23,6 +23,11 @@ | |||
| <artifactId>mallinkService</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.iformall</groupId> | |||
| <artifactId>mallinkVideo</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>commons-fileupload</groupId> | |||
| <artifactId>commons-fileupload</artifactId> | |||
| @@ -35,7 +35,10 @@ public class UserApplication { | |||
| private String uploadDir; | |||
| @Value("${fm.ocr_data}") | |||
| private String ocrData; | |||
| private String ocrData; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -61,6 +64,11 @@ public class UserApplication { | |||
| public String ocrData() { | |||
| return ocrData; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| SpringApplication.run(UserApplication.class, args); | |||
| @@ -0,0 +1,81 @@ | |||
| package com.iformall.controller.video; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxMallBuilding; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||
| import com.iformall.enums.EnumContractOperationType; | |||
| import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumFlowContractType; | |||
| import com.iformall.enums.EnumFlowKey; | |||
| import com.iformall.enums.EnumIsPreview; | |||
| import com.iformall.enums.EnumRentContractAppStatus; | |||
| import com.iformall.enums.EnumRentContractStatus; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumRentStartType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import com.iformall.service.WxMallBuildingService; | |||
| import com.iformall.service.WxMallFloorService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.video.VideoFactory; | |||
| import com.iformall.video.entity.VideUploadResult; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("video") | |||
| public class VideoController extends BaseController { | |||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| VideoFactory videoFactory; | |||
| @Autowired | |||
| String videoType; | |||
| @GetMapping("/upload") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "title", value = "页数", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData list(@ModelAttribute WxPropertyContract wxPropertyContract, String title) { | |||
| VideUploadResult result = videoFactory.getExcutor(videoType).uploadLocalVideo("123123213", "/root/111.mp4"); | |||
| return new ResultData(result); | |||
| } | |||
| } | |||
| @@ -179,6 +179,7 @@ fm: | |||
| open: true | |||
| upload_dir: /home/test/server/uploads/ | |||
| ocr_data: /root/ocr_data/ | |||
| videoType: aliyun | |||
| ueditor: | |||
| config: config.json | |||
| @@ -134,6 +134,7 @@ fm: | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| ocr_data: /root/ocr_data/ | |||
| videoType: aliyun | |||
| ueditor: | |||
| config: config.json | |||
| @@ -43,6 +43,9 @@ public class BApplication { | |||
| @Value("${pos.url}") | |||
| private String posUrl; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -84,6 +87,10 @@ public class BApplication { | |||
| return posUrl; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| SpringApplication.run(BApplication.class, args); | |||
| @@ -169,6 +169,7 @@ fm: | |||
| deploy: 1 | |||
| open: true | |||
| upload_dir: /home/test/server/uploads | |||
| videoType: aliyun | |||
| pos: | |||
| dev_id: fmpos | |||
| @@ -125,6 +125,7 @@ fm: | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| videoType: aliyun | |||
| pos: | |||
| dev_id: fmpos | |||
| @@ -35,6 +35,9 @@ public class CApplication { | |||
| @Value("${fm.ocr_data}") | |||
| private String ocrData; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -61,6 +64,10 @@ public class CApplication { | |||
| return ocrData; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| SpringApplication.run(CApplication.class, args); | |||
| @@ -170,6 +170,7 @@ fm: | |||
| open: true | |||
| upload_dir: /home/test/server/uploads/ | |||
| ocr_data: /root/ocr_data/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -125,6 +125,7 @@ fm: | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| ocr_data: /root/ocr_data/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -33,6 +33,9 @@ public class CallbackApplication { | |||
| @Value("${fm.upload_dir}") | |||
| private String uploadDir; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -53,6 +56,11 @@ public class CallbackApplication { | |||
| public String fmUploadDir() { | |||
| return uploadDir; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| SpringApplication.run(CallbackApplication.class, args); | |||
| @@ -175,6 +175,7 @@ fm: | |||
| deploy: 1 | |||
| open: true | |||
| upload_dir: /home/test/server/uploads/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -129,6 +129,7 @@ fm: | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -37,6 +37,9 @@ public class ConsumerApplication { | |||
| @Value("${fm.upload_dir}") | |||
| private String uploadDir; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -58,6 +61,10 @@ public class ConsumerApplication { | |||
| return uploadDir; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| ConfigurableApplicationContext context = SpringApplication.run(ConsumerApplication.class, args); | |||
| @@ -169,6 +169,7 @@ fm: | |||
| deploy: 1 | |||
| open: true | |||
| upload_dir: /home/test/server/uploads/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -124,6 +124,7 @@ fm: | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -29,6 +29,9 @@ public class PosApplication { | |||
| @Value("${fm.upload_dir}") | |||
| private String uploadDir; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -49,6 +52,11 @@ public class PosApplication { | |||
| public String fmUploadDir() { | |||
| return uploadDir; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| @@ -169,6 +169,7 @@ fm: | |||
| deploy: 1 | |||
| open: true | |||
| upload_dir: /home/test/server/uploads | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -123,6 +123,7 @@ fm: | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -32,6 +32,9 @@ public class PublicApiApplication { | |||
| @Value("${fm.upload_dir}") | |||
| private String uploadDir; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -52,6 +55,11 @@ public class PublicApiApplication { | |||
| public String fmUploadDir() { | |||
| return uploadDir; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| @@ -169,6 +169,7 @@ fm: | |||
| deploy: 1 | |||
| open: true | |||
| upload_dir: /home/test/server/uploads/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -124,6 +124,7 @@ fm: | |||
| deploy: 3 | |||
| open: true | |||
| upload_dir: /root/uploads/ | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -40,6 +40,9 @@ public class ScheduleApplication { | |||
| @Value("${fm.monitor_enable}") | |||
| private boolean fmMonitor; | |||
| @Value("${fm.videoType}") | |||
| private String videoType; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| @@ -71,7 +74,10 @@ public class ScheduleApplication { | |||
| return fmMonitor; | |||
| } | |||
| @Bean | |||
| public String videoType() { | |||
| return videoType; | |||
| } | |||
| public static void main(String[] args) { | |||
| SpringApplication.run(ScheduleApplication.class, args); | |||
| @@ -172,6 +172,7 @@ fm: | |||
| monitor_emails: houtaikaifa@iformall.com,xiaochengxufabu@iformall.com | |||
| monitor_enable: true | |||
| clear_data_before_msg_record: 1 | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -127,6 +127,7 @@ fm: | |||
| monitor_emails: houtaikaifa@iformall.com,xiaochengxufabu@iformall.com | |||
| monitor_enable: false | |||
| clear_data_before_msg_record: 1 | |||
| videoType: aliyun | |||
| logging: | |||
| level: | |||
| @@ -40,7 +40,7 @@ public class AliyunVideoExcutor implements VideoExcutor { | |||
| public VideUploadResult uploadLocalVideo(String title,String localFile) { | |||
| VideUploadResult result = new VideUploadResult(); | |||
| try { | |||
| UploadVideoResponse response =AliyunVedioUpload.uploadVideo(config.getAccessKeyId(), config.getAccessKeySecret(), title, localFile); | |||
| UploadVideoResponse response =AliyunVedioUpload.uploadVideo(config.getAccessKeyId(), config.getAccessKeySecret(),config.getRegionId(), title, localFile); | |||
| if (response.isSuccess()) { | |||
| result.setVideoId(response.getVideoId()); | |||
| result.setVideoUrl(getUrlByVeidoId(response.getVideoId())); | |||
| @@ -65,7 +65,7 @@ public class AliyunVideoExcutor implements VideoExcutor { | |||
| FileInputStream inputStream = null; | |||
| try { | |||
| inputStream = new FileInputStream(localFile); | |||
| response = AliyunVedioUpload.uploadStream(config.getAccessKeyId(), config.getAccessKeySecret(), title, localFile.getName(), inputStream); | |||
| response = AliyunVedioUpload.uploadStream(config.getAccessKeyId(), config.getAccessKeySecret(),config.getRegionId(), title, localFile.getName(), inputStream); | |||
| if (response.isSuccess()) { | |||
| result.setVideoId(response.getVideoId()); | |||
| result.setVideoUrl(getUrlByVeidoId(response.getVideoId())); | |||
| @@ -92,7 +92,7 @@ public class AliyunVideoExcutor implements VideoExcutor { | |||
| @Override | |||
| public VideUploadResult uploadNetVideo(String title,String url,String ext) { | |||
| VideUploadResult result = new VideUploadResult(); | |||
| UploadURLStreamResponse response = AliyunVedioUpload.uploadURLStream(config.getAccessKeyId(), config.getAccessKeySecret(), title, url, ext); | |||
| UploadURLStreamResponse response = AliyunVedioUpload.uploadURLStream(config.getAccessKeyId(), config.getAccessKeySecret(),config.getRegionId(), title, url, ext); | |||
| if (response.isSuccess()) { | |||
| result.setVideoId(response.getVideoId()); | |||
| result.setVideoUrl(getUrlByVeidoId(response.getVideoId())); | |||
| @@ -104,5 +104,4 @@ public class AliyunVideoExcutor implements VideoExcutor { | |||
| } | |||
| return result; | |||
| } | |||
| } | |||
| @@ -99,7 +99,7 @@ public class AliyunVedioUpload { | |||
| // 任何上传方式文件名必须包含扩展名 | |||
| String fileName = "/Users/test/video/test.mp4"; | |||
| // 本地文件上传 | |||
| uploadVideo(accessKeyId, accessKeySecret, title, fileName); | |||
| uploadVideo(accessKeyId, accessKeySecret,"cn-beijing", title, fileName); | |||
| // 待上传视频的网络流地址 | |||
| String url = "http://test.aliyun.com/video/test.mp4"; | |||
| @@ -107,7 +107,7 @@ public class AliyunVedioUpload { | |||
| // 2.网络流上传 | |||
| // 文件扩展名,当url中不包含扩展名时,需要设置该参数 | |||
| String fileExtension = "mp4"; | |||
| uploadURLStream(accessKeyId, accessKeySecret, title, url, fileExtension); | |||
| uploadURLStream(accessKeyId, accessKeySecret, "cn-beijing",title, url, fileExtension); | |||
| // 3.文件流上传 | |||
| // testUploadFileStream(accessKeyId, accessKeySecret, title, fileName); | |||
| @@ -126,7 +126,7 @@ public class AliyunVedioUpload { | |||
| } catch (IOException e) { | |||
| e.printStackTrace(); | |||
| } | |||
| uploadStream(accessKeyId, accessKeySecret, title, fileName, inputStream); | |||
| uploadStream(accessKeyId, accessKeySecret, "cn-beijing",title, fileName, inputStream); | |||
| // 二、图片上传 | |||
| @@ -139,9 +139,9 @@ public class AliyunVedioUpload { | |||
| // 三、m3u8文件上传 | |||
| // 1.上传本地m3u8音视频文件 | |||
| uploadLocalM3u8(accessKeyId, accessKeySecret); | |||
| uploadLocalM3u8(accessKeyId, accessKeySecret,"cn-beijing"); | |||
| // 2.上传网络m3u8音视频文件 | |||
| uploadWebM3u8(accessKeyId, accessKeySecret); | |||
| uploadWebM3u8(accessKeyId, accessKeySecret,"cn-beijing"); | |||
| // 四、辅助媒资上传 | |||
| // 辅助媒资-本地文件上传 | |||
| // testUploadAttachedMediaLocalFile(accessKeyId, accessKeySecret); | |||
| @@ -157,7 +157,7 @@ public class AliyunVedioUpload { | |||
| * @param title | |||
| * @param fileName | |||
| */ | |||
| public static UploadVideoResponse uploadVideo(String accessKeyId, String accessKeySecret, String title, String fileName) { | |||
| public static UploadVideoResponse uploadVideo(String accessKeyId, String accessKeySecret,String regionId, String title, String fileName) { | |||
| UploadVideoRequest request = new UploadVideoRequest(accessKeyId, accessKeySecret, title, fileName); | |||
| /* 可指定分片上传时每个分片的大小,默认为2M字节 */ | |||
| request.setPartSize(2 * 1024 * 1024L); | |||
| @@ -197,9 +197,9 @@ public class AliyunVedioUpload { | |||
| /* 设置应用ID*/ | |||
| //request.setAppId("app-1000000"); | |||
| /* 点播服务接入点 */ | |||
| //request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* ECS部署区域*/ | |||
| // request.setEcsRegionId("cn-shanghai"); | |||
| request.setEcsRegionId(regionId); | |||
| UploadVideoImpl uploader = new UploadVideoImpl(); | |||
| UploadVideoResponse response = uploader.uploadVideo(request); | |||
| return response; | |||
| @@ -215,7 +215,7 @@ public class AliyunVedioUpload { | |||
| * @param fileName | |||
| * @param url | |||
| */ | |||
| public static UploadURLStreamResponse uploadURLStream(String accessKeyId, String accessKeySecret, String title, String url, String fileExtension) { | |||
| public static UploadURLStreamResponse uploadURLStream(String accessKeyId, String accessKeySecret,String regionId, String title, String url, String fileExtension) { | |||
| UploadURLStreamRequest request = new UploadURLStreamRequest(accessKeyId, accessKeySecret, title, url); | |||
| /* 文件扩展名*/ | |||
| @@ -251,9 +251,9 @@ public class AliyunVedioUpload { | |||
| /* 设置应用ID*/ | |||
| //request.setAppId("app-1000000"); | |||
| /* 点播服务接入点 */ | |||
| //request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* ECS部署区域*/ | |||
| // request.setEcsRegionId("cn-shanghai"); | |||
| request.setEcsRegionId(regionId); | |||
| UploadVideoImpl uploader = new UploadVideoImpl(); | |||
| UploadURLStreamResponse response = uploader.uploadURLStream(request); | |||
| return response; | |||
| @@ -267,7 +267,7 @@ public class AliyunVedioUpload { | |||
| * @param title | |||
| * @param fileName | |||
| */ | |||
| private static void uploadFileStream(String accessKeyId, String accessKeySecret, String title, String fileName) { | |||
| private static void uploadFileStream(String accessKeyId, String accessKeySecret,String regionId, String title, String fileName) { | |||
| UploadFileStreamRequest request = new UploadFileStreamRequest(accessKeyId, accessKeySecret, title, fileName); | |||
| /* 是否使用默认水印(可选),指定模板组ID时,根据模板组配置确定是否使用默认水印*/ | |||
| //request.setShowWaterMark(true); | |||
| @@ -294,9 +294,9 @@ public class AliyunVedioUpload { | |||
| /* 设置应用ID*/ | |||
| //request.setAppId("app-1000000"); | |||
| /* 点播服务接入点 */ | |||
| //request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* ECS部署区域*/ | |||
| // request.setEcsRegionId("cn-shanghai"); | |||
| request.setEcsRegionId(regionId); | |||
| UploadVideoImpl uploader = new UploadVideoImpl(); | |||
| UploadFileStreamResponse response = uploader.uploadFileStream(request); | |||
| System.out.print("RequestId=" + response.getRequestId() + "\n"); //请求视频点播服务的请求ID | |||
| @@ -319,7 +319,7 @@ public class AliyunVedioUpload { | |||
| * @param fileName | |||
| * @param inputStream | |||
| */ | |||
| public static UploadStreamResponse uploadStream(String accessKeyId, String accessKeySecret, String title, String fileName, InputStream inputStream) { | |||
| public static UploadStreamResponse uploadStream(String accessKeyId, String accessKeySecret,String regionId, String title, String fileName, InputStream inputStream) { | |||
| UploadStreamRequest request = new UploadStreamRequest(accessKeyId, accessKeySecret, title, fileName, inputStream); | |||
| /* 是否使用默认水印(可选),指定模板组ID时,根据模板组配置确定是否使用默认水印*/ | |||
| //request.setShowWaterMark(true); | |||
| @@ -346,9 +346,9 @@ public class AliyunVedioUpload { | |||
| /* 设置应用ID*/ | |||
| //request.setAppId("app-1000000"); | |||
| /* 点播服务接入点 */ | |||
| //request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* ECS部署区域*/ | |||
| // request.setEcsRegionId("cn-shanghai"); | |||
| request.setEcsRegionId(regionId); | |||
| UploadVideoImpl uploader = new UploadVideoImpl(); | |||
| UploadStreamResponse response = uploader.uploadStream(request); | |||
| return response; | |||
| @@ -361,7 +361,7 @@ public class AliyunVedioUpload { | |||
| * @param accessKeyId | |||
| * @param accessKeySecret | |||
| */ | |||
| public static void uploadImageLocalFile(String accessKeyId, String accessKeySecret) { | |||
| public static void uploadImageLocalFile(String accessKeyId, String accessKeySecret,String regionId) { | |||
| /* 图片类型(必选)取值范围:default(默认),cover(封面),watermark(水印)*/ | |||
| String imageType = "cover"; | |||
| UploadImageRequest request = new UploadImageRequest(accessKeyId, accessKeySecret, imageType); | |||
| @@ -384,7 +384,7 @@ public class AliyunVedioUpload { | |||
| /* 设置应用ID*/ | |||
| //request.setAppId("app-1000000"); | |||
| /* 点播服务接入点 */ | |||
| //request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| UploadImageImpl uploadImage = new UploadImageImpl(); | |||
| UploadImageResponse response = uploadImage.upload(request); | |||
| System.out.print("RequestId=" + response.getRequestId() + "\n"); | |||
| @@ -405,7 +405,7 @@ public class AliyunVedioUpload { | |||
| * @param accessKeyId | |||
| * @param accessKeySecret | |||
| */ | |||
| public static void uploadImageStream(String accessKeyId, String accessKeySecret) { | |||
| public static void uploadImageStream(String accessKeyId, String accessKeySecret,String regionId) { | |||
| /* 图片类型(必选)取值范围:default(默认),cover(封面),watermark(水印)*/ | |||
| String imageType = "cover"; | |||
| UploadImageRequest request = new UploadImageRequest(accessKeyId, accessKeySecret, imageType); | |||
| @@ -458,7 +458,7 @@ public class AliyunVedioUpload { | |||
| * m3u8Filename: 本地m3u8索引文件的绝对路径,且m3u8文件的分片信息必须是相对路径,不能含有URL或本地绝对路径 | |||
| * sliceFilenames: ts分片文件的绝对路径列表,如指定则以此为准,若不指定,则自动解析 m3u8Filename 里的m3u8文件 | |||
| */ | |||
| public static void uploadLocalM3u8(String accessKeyId, String accessKeySecret) { | |||
| public static void uploadLocalM3u8(String accessKeyId, String accessKeySecret,String regionId) { | |||
| String title = "test_upload_local_m3u8"; | |||
| String m3u8Filename = "/Users/test/0e9ecfc6da934d1887ed7bdfc925ecf5/cc38da35c7b24de0abe58619cdd7a8-6479a12446b994719838e0307f6458-ld.m3u8"; | |||
| UploadLocalM3u8Request request = new UploadLocalM3u8Request(accessKeyId, accessKeySecret, title, m3u8Filename); | |||
| @@ -496,9 +496,9 @@ public class AliyunVedioUpload { | |||
| /* 设置应用ID*/ | |||
| // request.setAppId("app-1000000"); | |||
| /* 点播服务接入点 */ | |||
| // request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* ECS部署区域*/ | |||
| // request.setEcsRegionId("cn-shanghai"); | |||
| request.setEcsRegionId(regionId); | |||
| UploadM3u8FileImpl uploadM3u8File = new UploadM3u8FileImpl(); | |||
| UploadLocalM3u8Response uploadLocalM3u8Response = uploadM3u8File.uploadLocalM3u8(request); | |||
| System.out.println("code = " + uploadLocalM3u8Response.getCode()); | |||
| @@ -514,7 +514,7 @@ public class AliyunVedioUpload { | |||
| * m3u8FileURL: 网络m3u8索引文件的URL地址,且m3u8文件的分片信息必须是相对地址,不能含有URL或本地绝对路径 | |||
| * sliceFileURLs: ts分片文件的URL地址列表;需自行拼接ts分片的URL地址列表 | |||
| */ | |||
| public static void uploadWebM3u8(String accessKeyId, String accessKeySecret) { | |||
| public static void uploadWebM3u8(String accessKeyId, String accessKeySecret,String regionId) { | |||
| String title = "test_upload_web_m3u8"; | |||
| String m3u8FileURL = "http://test.aliyun.com/f0d644abc547129e957b386f772c72/a0e1e2817ab9425aa558fe67a90e717f-538087dcf2c201c31ce4324bf76af691-ld.m3u8"; | |||
| UploadWebM3u8Request request = new UploadWebM3u8Request(accessKeyId, accessKeySecret, title, m3u8FileURL); | |||
| @@ -554,9 +554,9 @@ public class AliyunVedioUpload { | |||
| /* 设置应用ID*/ | |||
| //request.setAppId("app-1000000"); | |||
| /* 点播服务接入点 */ | |||
| //request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* ECS部署区域*/ | |||
| // request.setEcsRegionId("cn-shanghai"); | |||
| request.setEcsRegionId(regionId); | |||
| UploadM3u8FileImpl uploadM3u8File = new UploadM3u8FileImpl(); | |||
| UploadWebM3u8Response uploadWebM3u8Response = uploadM3u8File.uploadWebM3u8(request); | |||
| System.out.println("code = " + uploadWebM3u8Response.getCode()); | |||
| @@ -572,7 +572,7 @@ public class AliyunVedioUpload { | |||
| * @param accessKeyId | |||
| * @param accessKeySecret | |||
| */ | |||
| public static void uploadAttachedMediaLocalFile(String accessKeyId, String accessKeySecret) { | |||
| public static void uploadAttachedMediaLocalFile(String accessKeyId, String accessKeySecret,String regionId) { | |||
| /* 业务类型 */ | |||
| String businessType = "watermark"; | |||
| /* 文件扩展名 */ | |||
| @@ -591,7 +591,7 @@ public class AliyunVedioUpload { | |||
| /* 存储区域(可选) */ | |||
| request.setStorageLocation("out-20170323225118266-5l3hs5gqwa.oss-cn-shanghai.aliyuncs.com"); | |||
| /* 点播服务接入点 */ | |||
| request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* 设置应用ID*/ | |||
| //request.setAppId("app-1000000"); | |||
| UploadAttachedMediaImpl uploader = new UploadAttachedMediaImpl(); | |||
| @@ -615,7 +615,7 @@ public class AliyunVedioUpload { | |||
| * @param accessKeyId | |||
| * @param accessKeySecret | |||
| */ | |||
| public static void uploadAttachedMediaStream(String accessKeyId, String accessKeySecret) { | |||
| public static void uploadAttachedMediaStream(String accessKeyId, String accessKeySecret,String regionId) { | |||
| /* 业务类型 */ | |||
| String businessType = "watermark"; | |||
| /* 文件扩展名 */ | |||
| @@ -644,7 +644,7 @@ public class AliyunVedioUpload { | |||
| /* 存储区域(可选) */ | |||
| request.setStorageLocation("out-20170323225118266-5l3****wa.oss-cn-shanghai.aliyuncs.com"); | |||
| /* 点播服务接入点 */ | |||
| request.setApiRegionId("cn-shanghai"); | |||
| request.setApiRegionId(regionId); | |||
| /* 设置应用ID*/ | |||
| // request.setAppId("app-1000000"); | |||
| // 开始上传 | |||
| @@ -0,0 +1,5 @@ | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| regionId: cn-beijing | |||
| @@ -0,0 +1,5 @@ | |||
| video: | |||
| aliyun: | |||
| accessKeyId: LTAI4G7ixY4AhvM35F8o3W3V | |||
| accessKeySecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||
| regionId: cn-beijing | |||
| @@ -14,6 +14,7 @@ | |||
| <module>mallinkOcr</module> | |||
| <module>mybatis-multi-tenancy</module> | |||
| <module>mallinkService</module> | |||
| <module>mallinkVideo</module> | |||
| <module>mallinkCallback</module> | |||
| <module>mallinkAdmin</module> | |||
| <module>mallinkCApi</module> | |||