summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsyeopite <70992037+syeopite@users.noreply.github.com>2021-09-10 07:42:39 +0000
committerGitHub <noreply@github.com>2021-09-10 07:42:39 +0000
commit50c8afb525429dcdb5a9b9bb4cf798ee9f62da2a (patch)
tree9d8159cc3dbd8f7d75966f69befa9b8ffe69099d /src
parenta539de4f9729594bc2a8a18cc9eed642582b7d67 (diff)
downloadinvidious-50c8afb525429dcdb5a9b9bb4cf798ee9f62da2a.tar.gz
invidious-50c8afb525429dcdb5a9b9bb4cf798ee9f62da2a.tar.bz2
invidious-50c8afb525429dcdb5a9b9bb4cf798ee9f62da2a.zip
Handle equirectangular projections for VR (#2379)
Diffstat (limited to 'src')
-rw-r--r--src/invidious/videos.cr7
-rw-r--r--src/invidious/views/watch.ecr3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr
index 27d85b92..d9c07142 100644
--- a/src/invidious/videos.cr
+++ b/src/invidious/videos.cr
@@ -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
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr
index aeb0f476..68e7eb80 100644
--- a/src/invidious/views/watch.ecr
+++ b/src/invidious/views/watch.ecr
@@ -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>