remove event listeners in destroy, add once method

This commit is contained in:
cky
2018-06-12 20:55:31 +08:00
parent 0b09b8ee6f
commit 87170ab460
8 changed files with 73 additions and 53 deletions

View File

@ -63,9 +63,8 @@ const html5 = {
// Restore time
const onLoadedMetaData = () => {
player.currentTime = currentTime;
player.off('loadedmetadata', onLoadedMetaData);
};
player.on('loadedmetadata', onLoadedMetaData);
player.once('loadedmetadata', onLoadedMetaData);
// Load new source
player.media.load();