Need help upgrading to Ionic Framework 4.0? Get assistance with our Enterprise Migration Services EXPLORE NOW

Youtube Video Player

Improve this doc

Plays YouTube videos in Native YouTube App

Repo: https://github.com/ihadeed/CordovaYoutubeVideoPlayer

Installation

  1. Install the Cordova and Ionic Native plugins:
    $ ionic cordova plugin add cordova-plugin-youtube-video-player
    $ npm install --save @ionic-native/youtube-video-player@4
    
  2. Add this plugin to your app's module

Supported platforms

Usage

For Android 5.0+ you will need to add the following to config.xml

<preference name="YouTubeDataApiKey" value="[YOUR YOUTUBE API]" />

For more information: https://developers.google.com/youtube/v3/getting-started

import { YoutubeVideoPlayer } from '@ionic-native/youtube-video-player';

constructor(private youtube: YoutubeVideoPlayer) { }

...


this.youtube.openVideo('myvideoid');

Instance Members

openVideo(videoId)

Plays a YouTube video

Param Type Details
videoId string

Video ID

API

Native

General