Skip to content

Commit

Permalink
fix: HTML5 tech with audio tag shouldn't use requestVideoFrameCallback (
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben authored and edirub committed Jun 8, 2023
1 parent 74e5e34 commit 1884040
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class Html5 extends Tech {
// into a `fullscreenchange` event
this.proxyWebkitFullscreen_();

this.featuresVideoFrameCallback = this.featuresVideoFrameCallback && this.el_.tagName === 'VIDEO';

this.triggerReady();
}

Expand Down
9 changes: 9 additions & 0 deletions test/unit/tech/html5.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1032,3 +1032,12 @@ QUnit.test('supports getting available media playback quality metrics', function
window.performance = origPerformance;
window.Date = origDate;
});

QUnit.test('featuresVideoFrameCallback is false for audio elements', function(assert) {
const el = document.createElement('audio');
const audioTech = new Html5({el});

assert.strictEqual(audioTech.featuresVideoFrameCallback, false, 'Html5 with audio element should not support rvf');

audioTech.dispose();
});

0 comments on commit 1884040

Please sign in to comment.