jsmediatags icon indicating copy to clipboard operation
jsmediatags copied to clipboard

'Unresolved variable jsmediatags' when using window.jsmediatags

Open Android789515 opened this issue 3 years ago • 1 comments

Not really understanding the usage instructions, I need a bit of help.

I have a script tag:

<script
    src='https://cdnjs.cloudflare.com/ajax/libs/jsmediatags/3.9.5/jsmediatags.min.js'
    integrity='sha512-YsR46MmyChktsyMMou+Bs74oCa/CDdwft7rJ5wlnmDzMj1mzqncsfJamEEf99Nk7IB0JpTMo5hS8rxB49FUktQ=='
    crossorigin='anonymous'
    referrerpolicy='no-referrer'
>
</script>

however when I try to use it: Screenshot 2022-02-19 174739

Android789515 avatar Feb 19 '22 23:02 Android789515

I'm not exactly sure what your dev stack is like for your use case, but I currently have a workaround to use jsmediatags as an ES Module exclusively, in the browser (Relating to the issue I opened that you also commented on recently).

First, I load the <script> tag into the window like JS MediaTags currently supports. Then, I essentially create my own wrapper module that contains the jsmediatags object from the window, Lastly, to tidy things up a little, I remove it from the window object so it is only accessible by using import with my wrapper module.

My Project - Librar.io

Offroaders123 avatar Feb 20 '22 09:02 Offroaders123