Answer the question
In order to leave comments, you need to log in
Why is uppod player not working inside vue component?
Hello to all. I'm already tired of setting up the video inside the component. Uppod player HTML5 works great on the main DOM. And uppod js-api apparently doesn't see the element(id) inside the component. Here is the code:
Vue.component('modal', {
...
components: {
...
player: {
template: '<div class="player" style="float: left;"><div class="video" id="videoplayerinside"></div></div>',
props:["dirFilesComputed"],
created: function(){
this.player = new Uppod({m:"video",uid:"videoplayerinside",
"pl":{
"playlist":[
{"comment":"name","file":"http://portal.tggroup.kz/media/files/Number_1.mp4"},
]
},st:"uppodvideo"
});
},
//ready:function(){
// $("#myVideo").on('contextmenu', function(e) {
// e.preventDefault();
// });
//},
delimiters: ['']
},
...
},
...
delimiters: ['']
})
<div class="video" id="videoplayerinside"></div>
Answer the question
In order to leave comments, you need to log in
created
is called at a time when the component is not yet in the DOM - well, the uppod obviously does not find an element with that id. Try mounted .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question