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 Details

    • 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
  • Constructor Details

    • AwsMediaConvertServiceImpl

      public AwsMediaConvertServiceImpl()
  • Method Details

    • 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 of AmazonS3 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 of AWSMediaConvert 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, org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException, SiteNotFoundException
      Uploads a file to S3 and creates a transcoding job using the specified profile.
      Specified by:
      uploadVideo in interface AwsMediaConvertService
      Parameters:
      site - name of the site
      inputProfileId - id of the profile for uploads
      outputProfileId - id of the s3 profile for downloads
      filename - name of the file
      content - content of the file
      Returns:
      the result of the transcoding job
      Throws:
      AwsException - if the upload or transcoding job creation fails
      org.craftercms.commons.config.profiles.ConfigurationProfileNotFoundException - if the profile is not found
      SiteNotFoundException - 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

      protected void addUrl(List<String> urls, String outputProfileId, String destination, String originalName, String modifier, String extension)
    • createUrl

      protected String createUrl(String profileId, String fullUri)
      Builds a remote-asset url using the given profile and S3 URI