Use video element for listener MSE playback

This commit is contained in:
3nd3r
2026-01-02 22:13:13 -06:00
parent a5223a01fc
commit af76717871

View File

@@ -2107,12 +2107,17 @@ function initListenerMode() {
audio.load(); // Reset the element audio.load(); // Reset the element
} }
} else { } else {
// Create a new hidden audio element // Create a new hidden media element.
audio = new Audio(); // Note: MSE (MediaSource) support is often more reliable on <video> than <audio>.
audio = document.createElement('video');
audio.autoplay = false; // Don't autoplay - we use the Enable Audio button audio.autoplay = false; // Don't autoplay - we use the Enable Audio button
audio.hidden = true; audio.muted = false;
audio.controls = false;
audio.playsInline = true;
audio.setAttribute('playsinline', '');
audio.style.display = 'none';
document.body.appendChild(audio); document.body.appendChild(audio);
console.log('🆕 Created new audio element'); console.log('🆕 Created new media element (video) for listener');
// AudioContext will be created later on user interaction // AudioContext will be created later on user interaction
} }