Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (36 sloc) 1.167 kb
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML5 MediaElement - Events</title>
<script src="../build/jquery.js"></script>
<script src="../build/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="../build/mediaelementplayer.min.css" />
<h2>Events Demo</h2>
<video width="640" height="360" id="player1">
<source src="../media/echo-hereweare.mp4" type="video/mp4" title="mp4">
<source src="../media/echo-hereweare.webm" type="video/webm" title="webm">
<source src="../media/echo-hereweare.ogv" type="video/ogg" title="ogg">
<p>Your browser leaves much to be desired.</p>
<div id="output">
<span id="player1-mode"></span>
success: function(media, node, player) {
var events = ['loadstart', 'play','pause', 'ended'];
for (var i=0, il=events.length; i<il; i++) {
var eventName = events[i];
media.addEventListener(events[i], function(e) {
$('#output').append( $('<div>' + e.type + '</div>') );
Jump to Line
Something went wrong with that request. Please try again.