Class: Helios::Videos::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/helios/videos/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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.

Raises:

  • (NotImplementedError)


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.

Raises:

  • (NotImplementedError)


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.

Raises:

  • (NotImplementedError)


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.

Raises:

  • (NotImplementedError)


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.

Raises:

  • (NotImplementedError)


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).

Raises:

  • (NotImplementedError)


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