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

Add workaround for Firefox video play performance issue #4210

Merged
merged 1 commit into from
May 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/components/media-views.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,16 @@ AFRAME.registerComponent("media-video", {
texture.minFilter = THREE.LinearFilter;
texture.encoding = THREE.sRGBEncoding;

// Firefox seems to have video play (or decode) performance issue.
// Somehow setting RGBA format improves the performance very well.
// Some tickets have been opened for the performance issue but
// I don't think it will be fixed soon. So we set RGBA format for Firefox
// as workaround so far.
// See https://github.com/mozilla/hubs/issues/3470
if (/firefox/i.test(navigator.userAgent)) {
texture.format = THREE.RGBAFormat;
}

isReady = () => {
if (texture.hls && texture.hls.streamController.audioOnly) {
audioEl = videoEl;
Expand Down