Wait for external resources

Posted 2 years ago by bart

Hey guys,

I want to build a Vue component that handles flowplayer videos. Sounds pretty simple and I'm sure it is, but I don't know how to solve the "DOM ready" stuff in Vue.

I currently have the following (example):

    <div id="video"></div>

    export default {
        mounted() {

When I do this I'm getting something like flowplayer is not defined. How can I wait for the external JS script to be ready? I already tried this.$nextTick() {} but it didn't work, too. Maybe I can try window.onload = function () {}; but that does not feel right to me. What do you think? What's the best solution here?

Thanks and best regards.

Please sign in or create an account to participate in this conversation.