Progress
new MediaAttachment video style :playable for mp4 to make videojs work with multiple files, hiding albums, hiding bookmark collections. may need tweaks on mediaattachment for mov and other formats : todo :
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
class REST::MediaAttachmentSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :id, :type, :url, :preview_url,
|
||||
attributes :id, :type, :url, :preview_url, :source_mp4,
|
||||
:remote_url, :text_url, :meta,
|
||||
:description, :blurhash, :file_content_type
|
||||
|
||||
@@ -33,6 +33,18 @@ class REST::MediaAttachmentSerializer < ActiveModel::Serializer
|
||||
end
|
||||
end
|
||||
|
||||
def source_mp4
|
||||
if object.type == "image" || object.type == "gifv" || object.type == "unknown"
|
||||
return nil
|
||||
else
|
||||
if object.needs_redownload?
|
||||
media_proxy_url(object.id, :playable)
|
||||
else
|
||||
full_asset_url(object.file.url(:playable))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def remote_url
|
||||
object.remote_url.presence
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user