Module: MultiVideoStreaming
- Defined in:
- lib/multi_video_streaming.rb,
lib/multi_video_streaming/version.rb,
lib/multi_video_streaming/response.rb,
lib/multi_video_streaming/drivers/s3.rb,
lib/multi_video_streaming/drivers/bunny.rb,
lib/multi_video_streaming/drivers/vimeo.rb,
lib/multi_video_streaming/services/https.rb,
lib/multi_video_streaming/factories/drive.rb,
lib/multi_video_streaming/protocols/https.rb,
lib/multi_video_streaming/platforms_support.rb,
lib/multi_video_streaming/protocols/platform.rb,
lib/multi_video_streaming/protocols/interface.rb,
lib/multi_video_streaming/errors/missing_param.rb,
lib/multi_video_streaming/errors/invalid_platform_name.rb,
lib/multi_video_streaming/errors/invalid_s3_method_name.rb,
lib/multi_video_streaming/utils/s3/generate_presign_url.rb,
lib/multi_video_streaming/errors/invalid_platforms_param.rb,
lib/multi_video_streaming/errors/duplicated_platform_name.rb,
lib/multi_video_streaming/errors/s3_is_not_valid_to_upload.rb,
lib/multi_video_streaming/utils/s3/create_multipart_upload.rb,
lib/multi_video_streaming/helpers/get_default_error_message.rb,
lib/multi_video_streaming/helpers/sort_files_array_by_label.rb,
lib/multi_video_streaming/utils/s3/complete_multipart_upload.rb,
lib/multi_video_streaming/utils/s3/generate_presign_part_url.rb,
lib/multi_video_streaming/validators/platform_name_validator.rb,
lib/multi_video_streaming/validators/platforms_hash_validator.rb,
lib/multi_video_streaming/validators/platforms_array_validator.rb,
lib/multi_video_streaming/validators/required_fields_validator.rb,
lib/multi_video_streaming/validators/platforms_position_validator.rb
Defined Under Namespace
Modules: Drivers, Errors, Factories, Helpers, Protocols, Services, Utils, Validators
Classes: DriverResponse, FinalResponse, Response
Constant Summary
collapse
- VERSION =
"1.1.0"
- PLATFORMS_SUPPORT =
["vimeo", "bunny", "s3"]
Class Method Summary
collapse
Class Method Details
.delete(*platforms) ⇒ Object
.get(*platforms) ⇒ Object
.upload(url, title, *platforms) ⇒ Object
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/multi_video_streaming.rb', line 22
def self.upload(url, title, *platforms)
MultiVideoStreaming::Validators::PlatformsArrayValidator.validate(platforms_array: platforms)
MultiVideoStreaming::Validators::PlatformsHashValidator.validate(platforms_hash: platforms, method: :create, number_of_platforms: platforms.length)
response_instance = MultiVideoStreaming::Response.new
required_fields_validator_instance = MultiVideoStreaming::Validators::RequiredFieldsValidator
https_service_instance = MultiVideoStreaming::Services::Https.new
platforms.each do |platform|
platform_instance = MultiVideoStreaming::Factories::Drive.get_platform_instance(
platform_name: platform[:platform_name],
dependency_params: platform[:dependency_params],
response_instance: response_instance,
required_fields_validator_instance: required_fields_validator_instance,
https_service_instance: https_service_instance
)
if !platform_instance.is_a?(MultiVideoStreaming::Drivers::S3)
platform_instance.upload_video(url: url, title: title)
end
end
response_instance.get_all_response
end
|