fix error when restarting player with same video

pull/129/head
simon 3 years ago
parent 88ebb6d648
commit bf0b07f3d7
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

@ -349,7 +349,10 @@ function removePlayer() {
if (playerElement.hasChildNodes()) {
var youtubeId = playerElement.childNodes[0].getAttribute("data-id");
var playedStatus = document.createDocumentFragment();
playedStatus.appendChild(document.getElementById(youtubeId));
var playedBox = document.getElementById(youtubeId);
if (playedBox) {
playedStatus.appendChild(playedBox);
};
playerElement.innerHTML = '';
// append played status
var videoInfo = document.getElementById('video-info-' + youtubeId);

Loading…
Cancel
Save