mirror of
https://github.com/iv-org/invidious.git
synced 2026-08-17 05:20:51 -05:00
Merge 9752768d586a4435ef385c0bb083115c05308ffc into d10f2a48021f1768f2d6ff3bd1b9f3de4e0b2d22
This commit is contained in:
commit
d7d10ee98c
@ -150,6 +150,26 @@ module Invidious::JSONify::APIv1
|
|||||||
json.field "audioSampleRate", fmt["audioSampleRate"].as_s.to_i if fmt.has_key?("audioSampleRate")
|
json.field "audioSampleRate", fmt["audioSampleRate"].as_s.to_i if fmt.has_key?("audioSampleRate")
|
||||||
json.field "audioChannels", fmt["audioChannels"] if fmt.has_key?("audioChannels")
|
json.field "audioChannels", fmt["audioChannels"] if fmt.has_key?("audioChannels")
|
||||||
|
|
||||||
|
# Multi-language audio. Only present when a video carries more than
|
||||||
|
# one audio track. The same data already drives the DASH manifest
|
||||||
|
# (see `Invidious::Routes::API::Manifest`), but was never exposed on
|
||||||
|
# the API, leaving clients to scrape `xtags` out of the stream URL.
|
||||||
|
if audio_track = fmt["audioTrack"]?.try &.as_h?
|
||||||
|
json.field "audioTrack" do
|
||||||
|
json.object do
|
||||||
|
if id = audio_track["id"]?
|
||||||
|
json.field "id", id
|
||||||
|
end
|
||||||
|
if display_name = audio_track["displayName"]?
|
||||||
|
json.field "displayName", display_name
|
||||||
|
end
|
||||||
|
if audio_is_default = audio_track["audioIsDefault"]?
|
||||||
|
json.field "audioIsDefault", audio_is_default
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Extra misc stuff
|
# Extra misc stuff
|
||||||
json.field "colorInfo", fmt["colorInfo"] if fmt.has_key?("colorInfo")
|
json.field "colorInfo", fmt["colorInfo"] if fmt.has_key?("colorInfo")
|
||||||
json.field "captionTrack", fmt["captionTrack"] if fmt.has_key?("captionTrack")
|
json.field "captionTrack", fmt["captionTrack"] if fmt.has_key?("captionTrack")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user