Module: SamveraHls::FileSetBehavior

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/samvera_hls/file_set_behavior.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.audio_mime_typesObject



9
10
11
# File 'app/models/concerns/samvera_hls/file_set_behavior.rb', line 9

def self.audio_mime_types
  ['audio/mp3', 'audio/mpeg', 'audio/wav', 'audio/x-wave', 'audio/x-wav', 'audio/ogg', 'audio/flac','audio/x-flac', 'audio/x-aiff', 'audio/aiff', ]
end

.video_mime_typesObject



13
14
15
# File 'app/models/concerns/samvera_hls/file_set_behavior.rb', line 13

def self.video_mime_types
  ['video/mp4']
end

Instance Method Details

#create_hls_derivatives(filename) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'app/models/concerns/samvera_hls/file_set_behavior.rb', line 17

def create_hls_derivatives(filename)
  case mime_type
  when *audio_mime_types
    create_hls_audio_derivatives filename
  when *video_mime_types
    create_hls_video_derivatives filename
  else
    return false
  end
end