These are chat archives for AxisCommunications/locomote-video-player
ifs which increases the cyclomatic complexity of the function which totally screws readability and also increases the risk of bugs.
document.getElementById('tag')otherwise just store
tag. Then do
tag.parentNode.removeChild(tag)(rather than just setting the innerHTML to null - which might remove other elements the user put there which have nothing to do with the player).
git diff --check. Getting a lot of white-space errors.
git diff 73116d4~1..73116d4 --check(the changes in your commit), Git will tell you about the whitespace errors.
Since you're doing
document.getElementById, if the DOM element is not available in the
document it's gonna fail.
var el = document.createElement('div'); // Creates a new element el.setAttribute('id', 'myId'); // doing `document.getElementById('myId')` will not work here as it is not in the `document` yet. var p = new Locomote(el); // Locomote will now attach to `el` but nothing will be visible as `el` is not displayed in the document. p.destroy(); // This should remove the embedded player regardless if it exists in the DOM or not document.body.appendChild(el); // Now it exists in the dom,