VIdeo : how to use CordovaYoutubeVideoPlayer?


#1

Hello

I 'm working with ionic v2. I try to display a youtube video with the plugin CordovaYoutubeVideoPlayer

But I don’t understand how it works.
They say :
Usage :
YoutubeVideoPlayer.openVideo(‘YOUTUBE_VIDEO_ID’, function(result) { console.log('YoutubeVideoPlayer result = ’ + result); });

But I don’t understand what to put in the Html part of my page ? What is the link between this “usage” and my html ?

Could someone help me to understand ?

Regards


#2

hey, according to the docs it says:

Plays YouTube videos in Native YouTube App

so you should have the YouTube app installed to watch the video

you can create in your .ts file a function with that does the following

openVideo(){
this.youtube.openVideo(‘myvideoid’);
}

and link it that function with a button in the view