summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-04-12 11:19:54 -0500
committerOmar Roth <omarroth@hotmail.com>2019-04-12 11:19:54 -0500
commitca9ea109c62c8b3a576c27106dbf5855af7933ee (patch)
treec0898eb3cc738dd112c37cdc091e0dc2ecbe663b /src
parent2a33a746f0a9bbac11e7d5d68ec40a0ebf65c427 (diff)
downloadinvidious-ca9ea109c62c8b3a576c27106dbf5855af7933ee.tar.gz
invidious-ca9ea109c62c8b3a576c27106dbf5855af7933ee.tar.bz2
invidious-ca9ea109c62c8b3a576c27106dbf5855af7933ee.zip
Add id to AdaptationSets
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 67d70734..bf552b42 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -4134,8 +4134,10 @@ get "/api/manifest/dash/id/:id" do |env|
"profiles": "urn:mpeg:dash:profile:isoff-live:2011", minBufferTime: "PT1.5S", type: "static",
mediaPresentationDuration: "PT#{video.info["length_seconds"]}S") do
xml.element("Period") do
+ i = 0
+
{"audio/mp4", "audio/webm"}.each do |mime_type|
- xml.element("AdaptationSet", mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true) do
+ xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true) do
audio_streams.select { |stream| stream["type"].starts_with? mime_type }.each do |fmt|
codecs = fmt["type"].split("codecs=")[1].strip('"')
bandwidth = fmt["bitrate"]
@@ -4152,11 +4154,12 @@ get "/api/manifest/dash/id/:id" do |env|
end
end
end
+
+ i += 1
end
{"video/mp4", "video/webm"}.each do |mime_type|
- xml.element("AdaptationSet", mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true,
- scanType: "progressive") do
+ xml.element("AdaptationSet", id: i, mimeType: mime_type, startWithSAP: 1, subsegmentAlignment: true, scanType: "progressive") do
video_streams.select { |stream| stream["type"].starts_with? mime_type }.each do |fmt|
codecs = fmt["type"].split("codecs=")[1].strip('"')
bandwidth = fmt["bitrate"]
@@ -4174,6 +4177,8 @@ get "/api/manifest/dash/id/:id" do |env|
end
end
end
+
+ i += 1
end
end
end