fix detecting video on plex (#434)

This commit is contained in:
fent
2019-02-27 00:12:25 -05:00
committed by Ilya Grigorik
parent 5e401d673f
commit f11a257de3

View File

@@ -206,7 +206,6 @@
var fragment = document.createDocumentFragment();
fragment.appendChild(wrapper);
this.video.classList.add('vsc-initialized');
this.video.dataset['vscid'] = this.id;
switch (true) {
@@ -342,13 +341,12 @@
if (added) {
new tc.videoController(node, parent);
} else {
if (node.classList.contains('vsc-initialized')) {
let id = node.dataset['vscid'];
if (id) {
let ctrl = document.querySelector(`div[data-vscid="${id}"]`)
if (ctrl) {
ctrl.remove();
}
node.classList.remove('vsc-initialized');
delete node.dataset['vscid'];
}
}