I need some help trying to figure out how to use the hls.js library in vuejs as it has no specific documentation of how to implement it with vue. The situation here is that I have to fetch the m3u8 from an api I'm able to make it work from a basic html with the tag and cdn but when I try to implement it with vuejs it doesn't work, any help is appreciated. I've tried 2 implementations and got the same error each time. These are what I've got so far:
First try: use cdn and include in it component
export default {
head() {
return {
script: [
{
src: 'https://cdn.jsdelivr.net/npm/hls.js@latest'
}
],
}
}}
with function in created()
checkHLS(){
console.log('in');
if (Hls.isSupported()) {
console.log('working')
}
},
Second Try install the package using npm
npm install --save hls.js
and i got this error
Hls is not defined
An error occurred while rendering the page. Check developer tools console for details.