-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
The Problem
On Tizen devices, when an <audio> element has finished playing (i.e., after the ended event), setting currentTime programmatically causes the audio to start playing again—even if both loop and autoplay are false.
Reproducible Example
<audio id="a" src="your-audio.mp3"></audio>
<script>
const audio = document.getElementById('a');
audio.addEventListener('ended', () => {
// Expect: seek only, remain paused
audio.currentTime = 0; // On Tizen, this triggers playback
});
</script>Reproduction Steps
- Render an audio element with
loopandautoplaydisabled. - Let it play to completion (so
endedfires). - In the
endedhandler (or immediately after), setaudio.currentTime = 0(or any value).
Expected Behavior
Setting currentTime after playback ends should only seek. The element should remain paused until play() is explicitly called.
Actual Behavior
On Tizen, the audio immediately starts playing again after currentTime is set post-ended.
Environment
- Platform: Tizen (Smart TV)
- Tizen Version: 8.0
- Device Model: 2024
- Browser/WebView: *e.g., Tizen Web Browser
- Reproducibility on other platforms: Not observed on Chrome/Firefox/Safari
Possible Solution
Avoid seeking to 0 on Tizen immediately after ended. For example, in a stop function:
// Inside stop():
} else if (!isNaN(sound._node.duration) || sound._node.duration === Infinity) {
// Platform guard: Some Tizen TVs auto-replay when seeking to 0 after 'ended'.
if (!this.isTizen()) {
sound._node.currentTime = sound._start || 0;
}
sound._node.pause();
// If this is a live stream, stop download once the audio is stopped.
if (sound._node.duration === Infinity) {
self._clearSound(sound._node);
}
}Platform detection helper:
// Platform guard: Tizen TVs
isTizen: function () {
if (typeof window === 'undefined') return false;
if (typeof window.tizen !== 'undefined') return true;
var ua = (typeof navigator !== 'undefined' && navigator.userAgent) ? navigator.userAgent : '';
return ua.indexOf('Tizen') !== -1 || ua.indexOf('SamsungTV') !== -1 || ua.indexOf('TizenTV') !== -1;
},Context
Only happens on real TVs (e.g., Samsung 2024 models).
Howler.js Version
2.2.4
Affected Browser(s)/Version(s)
Tizen Smart TV browser (2024 series)