Hello,
I would like to know how to call kaltura-player-js from Vue.js.
I tried as follow, but I got error and unable to use the library.
Could somebody tell me what is wrong and how to solve the issue?
What I tried :
・Added kaltura-player-js to node_modules
・Import KalturaPlayer to vue file and call setup method as follow
Source code :
<script>
import { KalturaPlayer } from 'kaltura-player-js'
export default {
name: 'Player',
components: {
'remote-js': {
render() {
return h('script', {attrs: {type: 'text/javascript', src: this.src}});
},
props: {
src: {type: String, required: true}
}
}
},
data() {
return {
kaltura: "cdnapisec.kaltura.com url is here",
config: {
targetId: 'target id is here',
provider: {
partnerId: partnerId is here,
uiConfId: uiConfId is here
}
}
}
},
created() {
this.importKaltura()
},
methods: {
importKaltura: function() {
var kalturaPlayer = KalturaPlayer.setup(this.config)
kalturaPlayer.loadMedia({entryId: 'entryId is here'})
},
}
}
</script>
Error :
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘setup’)
Thank you for your help.
5 posts - 2 participants