Youtube Video Player
Plays YouTube videos in Native YouTube App
Repo: https://github.com/ihadeed/CordovaYoutubeVideoPlayer
Installation
- 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
- Add this plugin to your app's module
Supported platforms
- Android
- iOS
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 |