Y
Y
Yeldos Adetbekov2017-03-08 20:59:02
JavaScript
Yeldos Adetbekov, 2017-03-08 20:59:02

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: ['']
        })

If such a block is inserted somewhere in the visible zone (not templates), then the created function works with a bang. I tried using jquery clone() to copy this element into my component, but all in vain. It looks like the component is a VERY closed thing. Please help solve the problem. Even if it fails to implement (I think that this video architecture is not quite suitable for real-time-application) Are there any open source alternatives and that the video is at least a little protected (from obvious downloading) Thank you!
<div class="video" id="videoplayerinside"></div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Kitmanov, 2017-03-08
@dosya97

createdis 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 question

Ask a Question

731 491 924 answers to any question