discourse/app/services/video_conversion/adapter_factory.rb
Blake Erickson af3abb54e3
FEATURE: Add support for aws MediaConvert (#33092)
When enabled this will convert uploaded videos to a standard format that should
be playable on all devices and browsers.

The goal of this feature is to prevent codec playback issues that
sometimes can occur with video uploads.

It uses an adapter pattern, so that other services for video conversion
could be easily added in the future.
2025-07-23 11:58:33 -06:00

16 lines
435 B
Ruby

# frozen_string_literal: true
module VideoConversion
class AdapterFactory
def self.get_adapter(upload, options = {})
adapter_type = options[:adapter_type] || SiteSetting.video_conversion_service
case adapter_type
when "aws_mediaconvert"
AwsMediaConvertAdapter.new(upload, options)
else
raise ArgumentError, "Unknown video conversion service: #{adapter_type}"
end
end
end
end