Answer the question
In order to leave comments, you need to log in
What event happens when the HTML5 audio player is silenced on bad internet????
The description says - waiting - occurs when the video playback is paused to load the next portion of data from a multimedia file; but it occurs only 1 time at the very beginning and that's it. How to catch an event when the player is silenced to load data?
Answer the question
In order to leave comments, you need to log in
What, really, Maxim Doshi?
Here are the events:
var events = [
'emptied',
'loadedmetadata',
'loadeddata',
'canplay',
'canplaythrough',
'playing',
'ended',
'waiting',
'ended',
'durationchange',
'timeupdate',
'play',
'pause',
'ratechange',
'volumechange'
];
_.each(events, function(type) {
player.addEventListener(type, onEvent, false);
});
function onEvent(e) {
console.log(e.type);
}
Я у себя сделал вот так: на событие timeupdate повесил обработчик который при наступлении события (и в случае если плеер играет) перезапускает отложенный вызов функции (через clearTimeout / setTimeout) в которой я запускаю отображение индикатора загрузки данных.
На мой взгляд работает как и должно.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question