Skip to content

Commit a14ace2

Browse files
authored
fix: HTML5 tech with audio tag shouldn't use requestVideoFrameCallback (#7778)
1 parent 75ea699 commit a14ace2

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/js/tech/html5.js

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ class Html5 extends Tech {
114114
// into a `fullscreenchange` event
115115
this.proxyWebkitFullscreen_();
116116

117+
this.featuresVideoFrameCallback = this.featuresVideoFrameCallback && this.el_.tagName === 'VIDEO';
118+
117119
this.triggerReady();
118120
}
119121

test/unit/tech/html5.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -1032,3 +1032,12 @@ QUnit.test('supports getting available media playback quality metrics', function
10321032
window.performance = origPerformance;
10331033
window.Date = origDate;
10341034
});
1035+
1036+
QUnit.test('featuresVideoFrameCallback is false for audio elements', function(assert) {
1037+
const el = document.createElement('audio');
1038+
const audioTech = new Html5({el});
1039+
1040+
assert.strictEqual(audioTech.featuresVideoFrameCallback, false, 'Html5 with audio element should not support rvf');
1041+
1042+
audioTech.dispose();
1043+
});

0 commit comments

Comments
 (0)