Much base work started
This commit is contained in:
19
app/models/concerns/streamable.rb
Normal file
19
app/models/concerns/streamable.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
module Streamable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def stream_url
|
||||
storage_location.adapter.stream_url(self)
|
||||
end
|
||||
|
||||
def streamable?
|
||||
duration.present? && storage_location.enabled? && storage_location.adapter.readable?
|
||||
end
|
||||
|
||||
def stream_type
|
||||
case source_type
|
||||
when "s3" then :presigned
|
||||
when "local" then :direct
|
||||
else :proxy
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user