Class AwsMediaConvertServiceImpl
- java.lang.Object
-
- org.craftercms.studio.api.v1.service.aws.AbstractAwsService<MediaConvertProfile>
-
- org.craftercms.studio.impl.v2.service.aws.mediaconvert.AwsMediaConvertServiceImpl
-
- All Implemented Interfaces:
AwsMediaConvertService
public class AwsMediaConvertServiceImpl extends AbstractAwsService<MediaConvertProfile> implements AwsMediaConvertService
Default implementation ofAwsMediaConvertService
- Since:
- 3.1.1
- Author:
- joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected String
dashExtension
The extension used by DASH ISO filesprotected String
delimiter
The delimiter for S3 pathsprotected String
hlsExtension
The extension used by Apple HLS filesprotected int
partSize
The part size used for S3 uploadsprotected String
smoothExtension
The extension used by MS Smooth filesprotected String
urlPattern
The URL pattern for the generated files-
Fields inherited from class org.craftercms.studio.api.v1.service.aws.AbstractAwsService
profileLoader
-
-
Constructor Summary
Constructors Constructor Description AwsMediaConvertServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addUrl(List<String> urls, String outputProfileId, String destination, String originalName, String modifier, String extension)
protected MediaConvertResult
buildResult(com.amazonaws.services.mediaconvert.model.JobTemplate jobTemplate, com.amazonaws.services.mediaconvert.model.CreateJobResult createJobResult, String outputProfileId, String originalName)
protected String
createUrl(String profileId, String fullUri)
Builds a remote-asset url using the given profile and S3 URIprotected com.amazonaws.services.mediaconvert.AWSMediaConvert
getMediaConvertClient(MediaConvertProfile profile)
Creates an instance ofAWSMediaConvert
to start the transcoding jobs.protected com.amazonaws.services.s3.AmazonS3
getS3Client(MediaConvertProfile profile)
Creates an instance ofAmazonS3
to upload the files.void
setDashExtension(String dashExtension)
void
setDelimiter(String delimiter)
void
setHlsExtension(String hlsExtension)
void
setPartSize(int partSize)
void
setSmoothExtension(String smoothExtension)
void
setUrlPattern(String urlPattern)
MediaConvertResult
uploadVideo(String site, String inputProfileId, String outputProfileId, String filename, InputStream content)
Uploads a file to S3 and creates a transcoding job using the specified profile.-
Methods inherited from class org.craftercms.studio.api.v1.service.aws.AbstractAwsService
getProfile, setProfileLoader
-
-
-
-
Field Detail
-
partSize
protected int partSize
The part size used for S3 uploads
-
delimiter
protected String delimiter
The delimiter for S3 paths
-
urlPattern
protected String urlPattern
The URL pattern for the generated files
-
hlsExtension
protected String hlsExtension
The extension used by Apple HLS files
-
dashExtension
protected String dashExtension
The extension used by DASH ISO files
-
smoothExtension
protected String smoothExtension
The extension used by MS Smooth files
-
-
Method Detail
-
setPartSize
public void setPartSize(int partSize)
-
setDelimiter
public void setDelimiter(String delimiter)
-
setUrlPattern
public void setUrlPattern(String urlPattern)
-
setHlsExtension
public void setHlsExtension(String hlsExtension)
-
setDashExtension
public void setDashExtension(String dashExtension)
-
setSmoothExtension
public void setSmoothExtension(String smoothExtension)
-
getS3Client
protected com.amazonaws.services.s3.AmazonS3 getS3Client(MediaConvertProfile profile)
Creates an instance ofAmazonS3
to upload the files.- Parameters:
profile
- AWS profile- Returns:
- an S3 client
-
getMediaConvertClient
protected com.amazonaws.services.mediaconvert.AWSMediaConvert getMediaConvertClient(MediaConvertProfile profile)
Creates an instance ofAWSMediaConvert
to start the transcoding jobs.- Parameters:
profile
- AWS profile- Returns:
- a MediaConvert client
-
uploadVideo
public MediaConvertResult uploadVideo(String site, String inputProfileId, String outputProfileId, String filename, InputStream content) throws AwsException
Uploads a file to S3 and creates a transcoding job using the specified profile.- Specified by:
uploadVideo
in interfaceAwsMediaConvertService
- Parameters:
site
- name of the siteinputProfileId
- id of the profile for uploadsoutputProfileId
- id of the s3 profile for downloadsfilename
- name of the filecontent
- content of the file- Returns:
- the result of the transcoding job
- Throws:
AwsException
- if the upload or transcoding job creation fails
-
buildResult
protected MediaConvertResult buildResult(com.amazonaws.services.mediaconvert.model.JobTemplate jobTemplate, com.amazonaws.services.mediaconvert.model.CreateJobResult createJobResult, String outputProfileId, String originalName)
-
addUrl
protected void addUrl(List<String> urls, String outputProfileId, String destination, String originalName, String modifier, String extension)
-
-