Skip to content

Commit

Permalink
feat(youtube): add Youtube video player plugin support (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihadeed authored Aug 27, 2016
1 parent 94a7dae commit 0cf7d6a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ import { Vibration } from './plugins/vibration';
import { VideoEditor } from './plugins/video-editor';
import { VideoPlayer } from './plugins/video-player';
import { WebIntent } from './plugins/webintent';
import { YoutubeVideoPlayer } from './plugins/youtube-video-player';
import { Zip } from './plugins/zip';
export * from './plugins/3dtouch';
export * from './plugins/background-geolocation';
Expand Down Expand Up @@ -207,6 +208,7 @@ Transfer,
TextToSpeech,
Vibration,
WebIntent,
YoutubeVideoPlayer,
Zip
}

Expand Down Expand Up @@ -312,6 +314,7 @@ window['IonicNative'] = {
VideoPlayer: VideoPlayer,
Vibration: Vibration,
WebIntent: WebIntent,
YoutubeVideoPlayer: YoutubeVideoPlayer,
Zip: Zip
};

Expand Down
28 changes: 28 additions & 0 deletions src/plugins/youtube-video-player.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {Plugin, Cordova} from './plugin';
/**
* @name YoutubeVideoPlayer
* @description
* Plays YouTube videos in Native YouTube App
*
* @usage
* ```
* import {YoutubeVideoPlayer} from 'ionic-native';
*
* YouTubeVideoPlayer.openVideo('myvideoid');
*
* ```
*/
@Plugin({
plugin: 'https://github.com/Glitchbone/CordovaYoutubeVideoPlayer.git',
pluginRef: 'YoutubeVideoPlayer',
repo: 'https://github.com/Glitchbone/CordovaYoutubeVideoPlayer',
platforms: ['Android', 'iOS']
})
export class YoutubeVideoPlayer {
/**
* Plays a YouTube video
* @param videoId {string} Video ID
*/
@Cordova({sync: true})
static openVideo(videoId: string): void { }
}

0 comments on commit 0cf7d6a

Please sign in to comment.