Attaches an "error" event listener to a media element (img, video, audio) to handle server fallbacks.
Supports two modes:
Blossom URIs: If the element's src is a blossom: URI, parses it and resolves server URLs
from xs hints, author hints (via getServers), and builds a fallback chain automatically.
HTTP URLs: Extracts the blob hash from the URL, walks the DOM for a data-pubkey attribute,
and uses the getServers callback to find alternative servers.
Parameters
element: MediaElement
The media element (img, video, or audio)
getServers: GetServersMethod
An async method to get an ordered list of servers for a pubkey
OptionaloverridePubkey: string
An optional pubkey to use instead of walking the DOM
Attaches an "error" event listener to a media element (img, video, audio) to handle server fallbacks.
Supports two modes:
srcis ablossom:URI, parses it and resolves server URLs from xs hints, author hints (via getServers), and builds a fallback chain automatically.data-pubkeyattribute, and uses the getServers callback to find alternative servers.