Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Autodetect 360 stereo projection (#2635)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and bluemarvin committed Jan 14, 2020
1 parent e219b81 commit 3f50729
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/src/main/assets/web_extensions/webcompat_vimeo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ try {
if (newObjData.name === 'window.vimeo.clip_page_config') {
if (configObj.clip.canvas === 1 || configObj.clip.is_spatial === true) {
is360 = true;
// Detect 360 stereo videos
if (configObj.clip.title.toLowerCase().indexOf('stereo') >= 0) {
QS_DEFAULTS.mozVideoProjection = "360s_auto";
}
}

configObj.clip.canvas = 1;
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/assets/web_extensions/webcompat_youtube/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ class YoutubeExtension {
document.querySelector(YT_SELECTORS.disclaimer),
document.querySelector(YT_SELECTORS.embedTitle)
];
let is360 = targets.some((node) => node && node.textContent.includes('360'));
const is360 = targets.some((node) => node && node.textContent.includes('360'));
if (is360) {
qs.set('mozVideoProjection', '360_auto');
const stereo = targets.some((node) => node && node.textContent.toLowerCase().includes('stereo'));
qs.set('mozVideoProjection', stereo ? '360s_auto' : '360_auto');
this.updateURL(qs);
this.updateVideoStyle();
logDebug(`Video projection set to: ${qs.get(VIDEO_PROJECTION_PARAM)}`);
Expand Down

0 comments on commit 3f50729

Please sign in to comment.