Bug 934053 - log media element events for debugging. r=cpearce

This commit is contained in:
JW Wang 2015-02-01 18:25:00 +01:00
parent 2806379310
commit f3dd53ea1d

View File

@ -39,6 +39,19 @@ function playElement(e) {
function loadedAll(elementList) {
elements = elementList;
// Log events for debugging.
var events = ["suspend", "play", "canplay", "canplaythrough", "loadstart", "loadedmetadata",
"loadeddata", "playing", "ended", "error", "stalled", "emptied", "abort",
"waiting", "pause"];
function logEvent(e) {
info(e.target._name + ": got " + e.type);
}
elementList.forEach(function(element) {
events.forEach(function(evt) {
element.addEventListener(evt, logEvent, false);
});
});
// Blow away the subframe
document.body.removeChild(document.getElementById("frame"));