mojs-player
mojs-player copied to clipboard
Check if element '#icon' already is created
Currently mojs-player creates an element in the top of body that looks like this:
<div id="icons">
<svg ...>
<path id="play-icon-shape" d="...">
...
</svg>
</div>
This is for using svg elements as icons in the player controller.
Problem When using mulitple instances of mojs-player on the same page, we get dublicates of these elements.
Solution Should be easy to check if the element already excist in the dom before creating it again.
Nice catch! I already noticed this behavior when I use the player last time 😉