mirror of
https://github.com/iv-org/invidious.git
synced 2025-05-31 14:11:54 +05:30
Handle equirectangular projections for VR (#2379)
This commit is contained in:
@@ -762,7 +762,12 @@ struct Video
|
||||
end
|
||||
|
||||
def is_vr : Bool?
|
||||
info.dig?("streamingData", "adaptiveFormats", 0, "projectionType").try &.as_s == "MESH"
|
||||
projection_type = info.dig?("streamingData", "adaptiveFormats", 0, "projectionType").try &.as_s
|
||||
return {"EQUIRECTANGULAR", "MESH"}.includes? projection_type
|
||||
end
|
||||
|
||||
def projection_type : String?
|
||||
return info.dig?("streamingData", "adaptiveFormats", 0, "projectionType").try &.as_s
|
||||
end
|
||||
|
||||
def wilson_score : Float64
|
||||
|
@@ -63,7 +63,8 @@ we're going to need to do it here in order to allow for translations.
|
||||
"params" => params,
|
||||
"preferences" => preferences,
|
||||
"premiere_timestamp" => video.premiere_timestamp.try &.to_unix,
|
||||
"vr" => video.is_vr
|
||||
"vr" => video.is_vr,
|
||||
"projection_type" => video.projection_type
|
||||
}.to_pretty_json
|
||||
%>
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user