Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reload player with new videoId #69

Open
9thstudio opened this issue Oct 11, 2020 · 0 comments
Open

How to reload player with new videoId #69

9thstudio opened this issue Oct 11, 2020 · 0 comments

Comments

@9thstudio
Copy link

I am loading player in angular app with couple of links to load another video on same page when clicked as below code. It works fine when on first video but when user click another link the second video never load.

loadVidPlayer(vidId){
    brightcovePlayerLoader({
      refNode: this.vidFrame.nativeElement,
      accountId: 'xxxxx',
      videoId: vidId,
      playerId: 'xxxx',
      embedId: 'default',
      options: {
        aspectRatio: '16:9'
      },
      onSuccess: (success) => {
        success.ref.play();
        brightcovePlayerLoader.reset();
      },
      onFailure: (error) => {
        // Player creation failed!
      }
    });
  }

Above function is called on different links with new videoId
Also I get below error on brightcovePlayerLoader.reset();

core.js:4197 ERROR TypeError: Cannot read property 'parentNode' of null
    at ye (index.min.js:1)
    at n.e [as trigger] (index.min.js:1)
    at e (index.min.js:1)
    at Object.callback (index.min.js:1)
    at i (index.min.js:1)
    at XMLHttpRequest.s [as __zone_symbol__ON_PROPERTYload] (index.min.js:1)
    at XMLHttpRequest.wrapFn (zone.js:1270)
    at ZoneDelegate.invokeTask (zone.js:421)
    at Object.onInvokeTask (core.js:27425)
    at ZoneDelegate.invokeTask (zone.js:420)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant