How to embed YouTube player?


#1

Hi I’m still exploring ionic 2 and my goal is to embed a YouTube video onto the page.


I saw there is a plugin named “YoutubeVideoPlayer” in ionic-native, but it just didn’t work…
It said “YoutubeVideoPlayer is not defined”.
I’ve imported the class in the ts file and I used CLI to add the plugin so config.xml has been modifed, as shown below:
<plugin name="com.bunkerpalace.cordova.YoutubeVideoPlayer" spec="https://github.com/Glitchbone/CordovaYoutubeVideoPlayer.git" />

Anyone know what issue is it?

In fact, I’ve tried another approach on ionic 1, simply using iframe and it works properly.
So I want to try this on ionic 2 as well, but how should I import external js library to ionic 2 project??


#2

The YoutubeVideoPlayer still doesn’t work in Ionic2.
There is no update from Ionic team so far.
I didn’t find any solution in Stackoverflow either.


#3

check this link


working fine for me :slight_smile: