This example uses the addEventListener() method to attach a "loadedmetadata" event to a video element.

Video courtesy of Big Buck Bunny.