From a22cc27dc012a69f10dfa2915aec0275019c2503 Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Wed, 17 Jul 2019 18:42:14 +0200 Subject: [PATCH] Fix parsing of mozVideoProjection parameter (#1412) --- .../ui/widgets/VideoProjectionMenuWidget.java | 10 +++++----- .../assets/web_extensions/webcompat_youtube/main.js | 12 ++++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java index f616042a2..d8a2713d6 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java @@ -145,16 +145,16 @@ public void setSelectedProjection(@VideoProjectionFlags int aProjection) { autoEnter.set(projection.endsWith("_auto")); - if (projection.startsWith("360")) { - return VIDEO_PROJECTION_360; - } else if (projection.startsWith("360s")) { + if (projection.startsWith("360s")) { return VIDEO_PROJECTION_360_STEREO; - } else if (projection.startsWith("180")) { - return VIDEO_PROJECTION_180; + } else if (projection.startsWith("360")) { + return VIDEO_PROJECTION_360; } else if (projection.startsWith("180lr")) { return VIDEO_PROJECTION_180_STEREO_LEFT_RIGHT; } else if (projection.startsWith("180tb")) { return VIDEO_PROJECTION_180_STEREO_TOP_BOTTOM; + } else if (projection.startsWith("180")) { + return VIDEO_PROJECTION_180; } else if (projection.startsWith("3d")) { return VIDEO_PROJECTION_3D_SIDE_BY_SIDE; } diff --git a/app/src/main/assets/web_extensions/webcompat_youtube/main.js b/app/src/main/assets/web_extensions/webcompat_youtube/main.js index 9eead1051..5254e22d1 100644 --- a/app/src/main/assets/web_extensions/webcompat_youtube/main.js +++ b/app/src/main/assets/web_extensions/webcompat_youtube/main.js @@ -99,9 +99,17 @@ try { qs.delete('mozVideoProjection'); switch (currentProjection) { case '360': - qs.set('mozVideoProjection', '360'); - break; case '360_auto': + case '360s': + case '360s_auto': + case '180': + case '180_auto': + case '180lr': + case '180lr_auto': + case '180tb': + case '180tb_auto': + qs.set('mozVideoProjection', currentProjection); + break; default: qs.set('mozVideoProjection', auto ? '360_auto' : '360'); break;