The onstalled attribute handles the media stalled event. It fires when the browser is trying to fetch media data, but data is unexpectedly not forthcoming.
Use it on <video> or <audio> to show a network warning. Related: onwaiting (playback needs data), onsuspend (download intentionally paused), onprogress. Prefer addEventListener("stalled", …).
Baseline · Widely available.
Stable across modern browsers since about July 2015. Not deprecated. Not cancelable; does not bubble.
Hard to force on fast networks.
Cached or local files rarely stall. Real stalls need a slow or interrupted fetch. The live preview includes a Simulate option for studying the handler.
Inline handlers discouraged.
MDN: prefer addEventListener over inline on* attributes. Study onstalled to recognize it in markup.
Syntax
HTML Syntax
syntax.html
<video onstalled="script">
script runs when media fetch stalls. Same idea on <audio>. Preferred: element.addEventListener("stalled", handler).
Most confusion is mixing stalled with waiting or expecting it on every load.
network
Not guaranteed on every load
Healthy, fast, or cached media may never fire stalled. That is normal.
vs wait
stalled ≠ waiting
waiting is about playback needing data. stalled is about the fetch not delivering.
vs suspend
stalled ≠ suspend
suspend means the UA stopped downloading on purpose. stalled means it is still trying.
target
Listen on the media element
Does not bubble. Put the handler on <video> / <audio>.
style
Prefer listeners
Inline on* attributes mix concerns. Use addEventListener in production code.
Compatibility
Browser Support
onstalled is a media event handler for unexpected media fetch stalls. Prefer addEventListener in apps.
✓ Baseline · Widely available
onstalled
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support the media stalled event.
97%Global support (approx.)
Google ChromeAll
Full support
Mozilla FirefoxAll
Full support
Apple SafariAll
Full support
Microsoft EdgeAll
Full support
OperaAll
Full support
Samsung InternetAll
Full support
Internet Explorer9+
Supported*
stalledWidely supported
Bottom line: *Safe on modern browsers. When demos do not stall, simulate the event to study the handler.
Remember
Key Takeaways
Role: media fetch is trying, but data is not arriving.
Compare:waiting (playback) / suspend (stopped on purpose).
Target:<video> / <audio> (no bubbling).
Demos: may need Simulate on fast/cached media.
One line:onstalled means the media fetch is stuck waiting for data — show a network hint, and do not confuse it with waiting or suspend.
Frequently Asked Questions
It is an event handler for the stalled event on media elements. That event fires when the browser is trying to fetch media data, but data is unexpectedly not forthcoming.
stalled is about the download/fetch not delivering data as expected. waiting fires when playback pauses because it needs more data. They often appear in related network-delay situations, but answer different questions.
suspend means the browser intentionally stopped downloading (for example enough data is buffered). stalled means the agent is still trying, but data is not arriving.
Fast or cached files rarely stall. Real stalls need a slow, interrupted, or hanging network response. Use Simulate in the live preview to practice the handler.
No. It is not cancelable and does not bubble. Listen on the <video> or <audio> element itself.
Prefer addEventListener("stalled", handler). MDN discourages inline HTML event handler attributes.