lib/ddr/models.rb in ddr-models-2.8.0 vs lib/ddr/models.rb in ddr-models-2.9.0.rc1
- old
+ new
@@ -35,10 +35,11 @@
extend ActiveSupport::Autoload
autoload :AdminSet
autoload :Base
autoload :Cache
+ autoload :Captionable
autoload :ChecksumInvalid, 'ddr/models/error'
autoload :Contact
autoload :ContentModelError, 'ddr/models/error'
autoload :DerivativeGenerationFailure, 'ddr/models/error'
autoload :Describable
@@ -132,18 +133,39 @@
end
# Maps file extensions to preferred media types
mattr_accessor :preferred_media_types do
{
- '.mp4' => 'video/mp4',
- '.flv' => 'video/flv',
- '.webm' => 'video/webm',
'.aac' => 'audio/mp4',
- '.m4a' => 'audio/mp4',
'.f4a' => 'audio/mp4',
+ '.flv' => 'video/flv',
+ '.m4a' => 'audio/mp4',
+ '.mov' => 'video/quicktime',
'.mp3' => 'audio/mpeg',
- '.ogg' => 'audio/ogg',
+ '.mp4' => 'video/mp4',
'.oga' => 'audio/ogg',
+ '.ogg' => 'audio/ogg',
+ '.srt' => 'text/plain',
+ '.vtt' => 'text/vtt',
+ '.wav' => 'audio/wav',
+ '.webm' => 'video/webm',
+ '.zip' => 'application/zip'
+ }
+ end
+
+ # Maps media types to preferred file extensions
+ mattr_accessor :preferred_file_extensions do
+ {
+ 'application/zip' => 'zip',
+ 'audio/mp4' => 'm4a',
+ 'audio/mpeg' => 'mp3',
+ 'audio/ogg' => 'ogg',
+ 'audio/wav' => 'wav',
+ 'text/vtt' => 'vtt',
+ 'video/flv' => 'flv',
+ 'video/mp4' => 'mp4',
+ 'video/quicktime' => 'mov',
+ 'video/webm' => 'webm'
}
end
# Yields an object with module configuration accessors
def self.configure