当源改变时,如何释放用于存储视频的内存:
var video = document.querySelector('.video');
var nextButton = document.getElementById('next-button');
nextButton.addEventListener('click', function() {
video.src = videoQueue.shift();
});
答案 0 :(得分:0)
var video = document.querySelector('.video');
var nextButton = document.getElementById('next-button');
nextButton.addEventListener('click', function() {
video.removeAttribute("src");//This will clear memory
video.load();//Refresh
});
我希望这会有所帮助。