Skip to content

Error: self.context.openVideo is not a function #31

Description

@caike08

Hello guys,

I've been trying to use this plugin but somehow it isn't working. When I try to call the function "openVideo" it says: self.context.openVideo is not a function. Am I doing something wrong?

HTML:

  <ion-row>
      <ion-col>
        <button ion-button (click)="openVideo('X3z1KF2s8Sc')">
          <ion-icon name="play"></ion-icon>
        </button>
      </ion-col>
    </ion-row>

TS:

  playVideo(videoId) {
    YoutubeVideoPlayer.openVideo(videoId);
  }

Error:

TypeError: self.context.openVideo is not a function
    at DebugAppView.View_LearnPage0.handleEvent_41 (component.ngfactory.js:388)
    at DebugAppView.<anonymous> (view.js:408)
    at HTMLButtonElement.<anonymous> (dom_renderer.js:276)
    at t.invokeTask (polyfills.js:3)
    at Object.onInvokeTask (ng_zone.js:227)
    at t.invokeTask (polyfills.js:3)
    at e.runTask (polyfills.js:3)
    at HTMLButtonElement.invoke (polyfills.js:3)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions