Search code examples
javascripthtml2canvas

What are all of the html2canvas callback events?


I'm trying to find all html2canvas callback events which can be passed in the optional options argument, but so far I only found one (onrendered). I'm pretty sure there are more, but I didn't find any in the documentation.

html2canvas(element, {
    onrendered: function(canvas) {
        // ...
    }
});

I need to find events that happen before and after render.


Solution

  • oncanplay - Script to be run when a file is ready to start playing (when it has buffered enough to begin)

    oncanplaythrough - Script to be run when a file can be played all the way to the end without pausing for buffering

    oncuechange - Script to be run when the cue changes in a element

    ondurationchange - Script to be run when the length of the media changes

    onemptied - Script to be run when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects)

    onended - Script to be run when the media has reach the end (a useful event for messages like "thanks for listening")

    onerror - Script to be run when an error occurs when the file is being loaded

    onloadeddata - Script to be run when media data is loaded

    onloadedmetadata - Script to be run when meta data (like dimensions and duration) are loaded

    onloadstart - Script to be run just as the file begins to load before anything is actually loaded

    onpause - Script to be run when the media is paused either by the user or programmatically

    for more look at w3school.xy