Ionic 3 | How to Add YouTube Video Player Native Plugin in Ionic 3.x Native Applications

In this tutorial, we will create an Ionic 3/4 application to demonstrate How to Add YouTube Video Player. We will Install the Cordova plugin and Ionic Native Wrapper to add functionality in Ionic 3/4 Application by using which YouTube’s Player can be opened to Play any YouTube video right from the Ionic application itself. To play a Video we need to provide the ID of video which we want to play.

Let’s start with implementation and create an application to play YouTube Videos from Ionic 3/4 Application.

Before we start with application make sure that your system is having updated version of NodeJS installed.

Create a new Ionic Application

Install latest version of Ionic and Cordova CLI.

Select the version of Ionic3 or Ionic 4:

Installation Tutorial for Ionic 3 Version

Now we will create a new blank application

After the application is created, go to the root using the CD command

If your system is having Visual Studio code(VS Code) installed, use  $ code .  command to open the project in VS Code

Install the Cordova and Ionic Native plugins

We will install YouTube Video Player Cordova plugin and Ionic Native Wrapper to support plugin in our Angular application.

Add preference in config.xml with YouTube Data V3 API

In config.xml we need to add a preference configuration variable with the API key

Click here to know more on How to get API key?

Import Ionic Native Plugin in the Main Module

Now we will import YouTube Video Player native plugin in app.module.ts and add in providers array

Add method in Home Component

Import plugin then add in contractor list to use in the home component. Replace below code in home.ts


Add Button in Home HTML to Open Video

In home.html, we will add a button to call openVideo method which we added above in home.html

Installation Tutorial for Ionic 4 Version

UPDATE: Please check this link for Ionic 4 tutorial


Create New Ionic 4 Application


Install the Cordova and Ionic Native plugins


Add preference for YouTube API KEY in config.xml file. See How to Get API Key?


Import plugin in app.module.ts file

Add button HTML in file

Now add this method in


After adding this HTML app will look like this image

Leave a Reply

2 Comment threads
1 Thread replies
Most reacted comment
Hottest comment thread
3 Comment authors
shaileshJolly.exegaston coroleu Recent comment authors
newest oldest most voted
Notify of
gaston coroleu
gaston coroleu

Hi, how can i play this live stream url with your code?


thanks a lot jollly..made my day!