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
Родитель 96d001f3d4
Коммит bcc2cfe8c4
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -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"));