awesome-cordova-plugins/src/@ionic-native/plugins/youtube-video-player/index.ts
Daniel Sogl 70c9558d2b docs(youtube-video-player): update repo (#1496)
* refactor(YoutubeVideoPlayer): updated repo

fix #1352

* Update index.ts

* Update index.ts

* Update index.ts
2017-05-09 17:32:47 -04:00

44 lines
1.1 KiB
TypeScript

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
* <preference name="YouTubeDataApiKey" value="[YOUR YOUTUBE API]" />
* ```
* 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 { }
}