21 lines
527 B
Ruby
21 lines
527 B
Ruby
class Video < MediaFile
|
|
# Video-specific associations
|
|
has_many :video_assets, dependent: :destroy
|
|
|
|
# Video-specific metadata store
|
|
store :video_metadata, accessors: [:width, :height, :video_codec, :audio_codec, :frame_rate]
|
|
|
|
# Video-specific instance methods
|
|
def resolution_label
|
|
return "Unknown" unless height
|
|
case height
|
|
when 0..480 then "SD"
|
|
when 481..720 then "720p"
|
|
when 721..1080 then "1080p"
|
|
when 1081..1440 then "1440p"
|
|
when 1441..2160 then "4K"
|
|
else "8K+"
|
|
end
|
|
end
|
|
end
|