brightcove / player-loader

An asynchronous script loader and embed generator for the Brightcove Player.
Other
28 stars 15 forks source link

ERROR Error: Could not initialize the Brightcove Player #74

Open subhojit-cn opened 3 years ago

subhojit-cn commented 3 years ago

I created a player the first time on page load it's working fine. Then on some button click, I removed all the "video-js" related HTML from the "refNode" container div. Then I again run

brightcovePlayerLoader({
        refNode: <PLACE_HOLDER>,
        accountId: <PLACE_HOLDER>,
        playerId: <PLACE_HOLDER>,
        videoId: <PLACE_HOLDER>,
        embedOptions: {
          tagName: brightcovePlayerLoader.EMBED_TAG_NAME_VIDEO,
        },
        onSuccess(success) {
          console.log(success)
        },
       onFailure(err) {
          console.log(err)
       }
})

But on that time that throws below error

ERROR Error: Could not initialize the Brightcove Player.
    at initPlayer (brightcove-player-loader.es.js:1001)
    at loadPlayer (brightcove-player-loader.es.js:1048)
    at brightcovePlayerLoader (brightcove-player-loader.es.js:1091)
    at buildPlayer (BrightcoveVideoGallery.vue:75)
    at Proxy.thumbClick (BrightcoveVideoGallery.vue:124)
    at onClick (BrightcoveVideoGallery.vue:15)
    at callWithErrorHandling (runtime-core.esm-bundler.js:154)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:163)
    at HTMLDivElement.invoker (runtime-dom.esm-bundler.js:308)

Note: If I click the button a third time then we can able to enter into the success block. Really can't able to find a solution to this weird issue.

Please suggest some solutions.