Class: Helios::Videos::Processor
- Inherits:
-
Object
- Object
- Helios::Videos::Processor
- Defined in:
- lib/helios/videos/processor.rb
Direct Known Subclasses
Helios::Videos::Processors::Cloudflare, Helios::Videos::Processors::Mux
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#delete!(video) ⇒ Object
Delete a video from the video service.
-
#download_thumbnail!(video, time: "3s") ⇒ Object
Download and store the video thumbnail.
-
#ingest!(video) ⇒ Object
Ingest a video from its ActiveStorage URL into the video service.
-
#initialize(config) ⇒ Processor
constructor
A new instance of Processor.
-
#playback_url(video, signed: false, expiration: 4.hours) ⇒ Object
Return the playback URL for a video.
-
#player_component(video, muted: false, expiration: 4.hours) ⇒ Object
Return an HTML player component for the video.
-
#signed_token(video, expiration: 4.hours) ⇒ Object
Generate a signed token for the video (if supported).
Constructor Details
#initialize(config) ⇒ Processor
Returns a new instance of Processor.
6 7 8 |
# File 'lib/helios/videos/processor.rb', line 6 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
4 5 6 |
# File 'lib/helios/videos/processor.rb', line 4 def config @config end |
Instance Method Details
#delete!(video) ⇒ Object
Delete a video from the video service.
17 18 19 |
# File 'lib/helios/videos/processor.rb', line 17 def delete!(video) raise NotImplementedError, "#{self.class}#delete! must be implemented" end |
#download_thumbnail!(video, time: "3s") ⇒ Object
Download and store the video thumbnail.
37 38 39 |
# File 'lib/helios/videos/processor.rb', line 37 def download_thumbnail!(video, time: "3s") raise NotImplementedError, "#{self.class}#download_thumbnail! must be implemented" end |
#ingest!(video) ⇒ Object
Ingest a video from its ActiveStorage URL into the video service. Should set video.key and video.playback_urls on success.
12 13 14 |
# File 'lib/helios/videos/processor.rb', line 12 def ingest!(video) raise NotImplementedError, "#{self.class}#ingest! must be implemented" end |
#playback_url(video, signed: false, expiration: 4.hours) ⇒ Object
Return the playback URL for a video.
22 23 24 |
# File 'lib/helios/videos/processor.rb', line 22 def playback_url(video, signed: false, expiration: 4.hours) raise NotImplementedError, "#{self.class}#playback_url must be implemented" end |
#player_component(video, muted: false, expiration: 4.hours) ⇒ Object
Return an HTML player component for the video.
27 28 29 |
# File 'lib/helios/videos/processor.rb', line 27 def player_component(video, muted: false, expiration: 4.hours) raise NotImplementedError, "#{self.class}#player_component must be implemented" end |
#signed_token(video, expiration: 4.hours) ⇒ Object
Generate a signed token for the video (if supported).
32 33 34 |
# File 'lib/helios/videos/processor.rb', line 32 def signed_token(video, expiration: 4.hours) raise NotImplementedError, "#{self.class}#signed_token must be implemented" end |