forked from computertech/techdj
Use video element for listener MSE playback
This commit is contained in:
13
script.js
13
script.js
@@ -2107,12 +2107,17 @@ function initListenerMode() {
|
||||
audio.load(); // Reset the element
|
||||
}
|
||||
} else {
|
||||
// Create a new hidden audio element
|
||||
audio = new Audio();
|
||||
// Create a new hidden media element.
|
||||
// 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.hidden = true;
|
||||
audio.muted = false;
|
||||
audio.controls = false;
|
||||
audio.playsInline = true;
|
||||
audio.setAttribute('playsinline', '');
|
||||
audio.style.display = 'none';
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user