Can anyone assist me with understanding how to utilize the hls.js library in vuejs? There isn't specific documentation on how to implement it with vue, and I'm struggling. My issue arises when trying to fetch the m3u8 from an api - while I can make it work with basic HTML using the tag and CDN, it fails when implementing it with Vuejs. Any help would be greatly appreciated. I've attempted two different implementations, but encountered the same error each time. Here's what I have tried so far:
First attempt: using CDNs and including it in the 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 Attempt: installing the package using npm
npm install --save hls.js
but then I received this error
Hls is not defined
An error occurred while rendering the page. Check developer tools console for details.