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 of
AwsMediaConvertService- Since:
- 3.1.1
- Author:
- joseross
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe extension used by DASH ISO filesprotected StringThe delimiter for S3 pathsprotected StringThe extension used by Apple HLS filesprotected intThe part size used for S3 uploadsprotected StringThe extension used by MS Smooth filesprotected StringThe URL pattern for the generated filesFields inherited from class org.craftercms.studio.api.v1.service.aws.AbstractAwsService
profileLoader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddUrl(List<String> urls, String outputProfileId, String destination, String originalName, String modifier, String extension) protected MediaConvertResultbuildResult(com.amazonaws.services.mediaconvert.model.JobTemplate jobTemplate, com.amazonaws.services.mediaconvert.model.CreateJobResult createJobResult, String outputProfileId, String originalName) protected StringBuilds a remote-asset url using the given profile and S3 URIprotected com.amazonaws.services.mediaconvert.AWSMediaConvertgetMediaConvertClient(MediaConvertProfile profile) Creates an instance ofAWSMediaConvertto start the transcoding jobs.protected com.amazonaws.services.s3.AmazonS3getS3Client(MediaConvertProfile profile) Creates an instance ofAmazonS3to upload the files.voidsetDashExtension(String dashExtension) voidsetDelimiter(String delimiter) voidsetHlsExtension(String hlsExtension) voidsetPartSize(int partSize) voidsetSmoothExtension(String smoothExtension) voidsetUrlPattern(String urlPattern) 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 Details
-
partSize
protected int partSizeThe part size used for S3 uploads -
delimiter
The delimiter for S3 paths -
urlPattern
The URL pattern for the generated files -
hlsExtension
The extension used by Apple HLS files -
dashExtension
The extension used by DASH ISO files -
smoothExtension
The extension used by MS Smooth files
-
-
Constructor Details
-
AwsMediaConvertServiceImpl
public AwsMediaConvertServiceImpl()
-
-
Method Details
-
setPartSize
public void setPartSize(int partSize) -
setDelimiter
-
setUrlPattern
-
setHlsExtension
-
setDashExtension
-
setSmoothExtension
-
getS3Client
Creates an instance ofAmazonS3to upload the files.- Parameters:
profile- AWS profile- Returns:
- an S3 client
-
getMediaConvertClient
protected com.amazonaws.services.mediaconvert.AWSMediaConvert getMediaConvertClient(MediaConvertProfile profile) Creates an instance ofAWSMediaConvertto 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, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException, SiteNotFoundException Uploads a file to S3 and creates a transcoding job using the specified profile.- Specified by:
uploadVideoin 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 failsorg.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException- if the profile is not foundSiteNotFoundException- if the site is not found
-
buildResult
protected MediaConvertResult buildResult(com.amazonaws.services.mediaconvert.model.JobTemplate jobTemplate, com.amazonaws.services.mediaconvert.model.CreateJobResult createJobResult, String outputProfileId, String originalName) -
addUrl
-
createUrl
Builds a remote-asset url using the given profile and S3 URI
-