import { Injectable } from '@angular/core'; import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; /** * @name Youtube Video Player * @description * Plays YouTube videos in Native YouTube App * * @usage * For Android 5.0+ you will need to add the following to config.xml * ```xml * * ``` * For more information: https://developers.google.com/youtube/v3/getting-started * * * ```typescript * import { YoutubeVideoPlayer } from '@ionic-native/youtube-video-player'; * * constructor(private youtube: YoutubeVideoPlayer) { } * * ... * * * this.youtube.openVideo('myvideoid'); * * ``` */ @Plugin({ pluginName: 'YoutubeVideoPlayer', plugin: 'https://github.com/JonSmart/CordovaYoutubeVideoPlayer', pluginRef: 'YoutubeVideoPlayer', repo: 'https://github.com/JonSmart/CordovaYoutubeVideoPlayer', platforms: ['Android', 'iOS'] }) @Injectable() export class YoutubeVideoPlayer extends IonicNativePlugin { /** * Plays a YouTube video * @param videoId {string} Video ID */ @Cordova({ sync: true }) openVideo(videoId: string): void { } }