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
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user