mirror of
https://github.com/algora-io/tv.git
synced 2025-03-17 20:17:45 +02:00
set content_type of stored media
This commit is contained in:
parent
2f73c9bd9c
commit
a11c6d638b
@ -95,7 +95,8 @@ defmodule Algora.Library do
|
||||
cb.(%{stage: :transmuxing, done: 1, total: 1})
|
||||
System.cmd("ffmpeg", ["-i", video.url, "-c", "copy", mp4_local_path])
|
||||
|
||||
Storage.upload_from_filename(mp4_local_path, mp4_remote_path, cb)
|
||||
Storage.upload_from_filename(mp4_local_path, mp4_remote_path, cb, content_type: "video/mp4")
|
||||
|
||||
mp4_video = Repo.insert!(mp4_video)
|
||||
|
||||
File.rm!(mp4_local_path)
|
||||
|
@ -41,7 +41,14 @@ defmodule Algora.Storage do
|
||||
end
|
||||
|
||||
defp upload_opts(%{type: :manifest} = _ctx) do
|
||||
[{:cache_control, "no-cache, no-store, private"}]
|
||||
[
|
||||
content_type: "application/x-mpegURL",
|
||||
cache_control: "no-cache, no-store, private"
|
||||
]
|
||||
end
|
||||
|
||||
defp upload_opts(%{type: :segment} = _ctx) do
|
||||
[content_type: "video/mp4"]
|
||||
end
|
||||
|
||||
defp upload_opts(_ctx), do: []
|
||||
|
Loading…
x
Reference in New Issue
Block a user