Closed molnarm closed 1 year ago
Thanks, I'll review it in the next few days
Edit: Looks good, I'll get a new version out this weekend.
Added in 1.1.7.
I did remove the iframe listener because it's not as simple to implement as the others. If users need to add their own logic for iframes, it can be done with onOpen
or onUpdate
.
Added a callback for error handling, e.g. to display a message instead of the failed item (that's what I'm using it for in our app).
Will get called for
error
events on:img
tags: will happen if image fails to load or decode (unknown format). Note that the preloading will fail silently, because the error will be thrown again when displaying, and it makes more sense to handle it when the item is expected to be displayed.source
tags in audio or video items: if the media item fails to load or play (unknown format)iframe
tags: any error. I didn't test this one.The callback gets
container
andactiveItem
like all the others already present, plus the error itself.I'm using Windows so I didn't commit the build outputs because they are different from yours (backslashes etc.). Let me know if I should change something else.