Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodetect 360 stereo projection #2635

Merged
merged 1 commit into from Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/src/main/assets/web_extensions/webcompat_vimeo/main.js
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
Expand Up @@ -86,9 +86,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);
logDebug(`Video projection set to: ${qs.get(VIDEO_PROJECTION_PARAM)}`);
} else {
Expand Down