how to create js object in qml ?
-
How to create an object from this js file
https://cdn.jsdelivr.net/hls.js/latest/hls.min.jsit should work like this
import "hls.min.js" as HLSPlayer . . . Component.onCompleted: { var hls = new HLSPlayer(); hls.loadSource(streamUrl); hls.attachMedia(player); hls.on(HLSPlayer.Events.MANIFEST_PARSED,function() { player.play() }); }
but it says "TypeError: Type error" in this line "var hls = new HLSPlayer();"
is there any solution ?