mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
feat(youtube): add Youtube video player plugin support (#496)
This commit is contained in:
parent
94a7dae863
commit
0cf7d6aca1
@ -103,6 +103,7 @@ import { Vibration } from './plugins/vibration';
|
|||||||
import { VideoEditor } from './plugins/video-editor';
|
import { VideoEditor } from './plugins/video-editor';
|
||||||
import { VideoPlayer } from './plugins/video-player';
|
import { VideoPlayer } from './plugins/video-player';
|
||||||
import { WebIntent } from './plugins/webintent';
|
import { WebIntent } from './plugins/webintent';
|
||||||
|
import { YoutubeVideoPlayer } from './plugins/youtube-video-player';
|
||||||
import { Zip } from './plugins/zip';
|
import { Zip } from './plugins/zip';
|
||||||
export * from './plugins/3dtouch';
|
export * from './plugins/3dtouch';
|
||||||
export * from './plugins/background-geolocation';
|
export * from './plugins/background-geolocation';
|
||||||
@ -207,6 +208,7 @@ Transfer,
|
|||||||
TextToSpeech,
|
TextToSpeech,
|
||||||
Vibration,
|
Vibration,
|
||||||
WebIntent,
|
WebIntent,
|
||||||
|
YoutubeVideoPlayer,
|
||||||
Zip
|
Zip
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,6 +314,7 @@ window['IonicNative'] = {
|
|||||||
VideoPlayer: VideoPlayer,
|
VideoPlayer: VideoPlayer,
|
||||||
Vibration: Vibration,
|
Vibration: Vibration,
|
||||||
WebIntent: WebIntent,
|
WebIntent: WebIntent,
|
||||||
|
YoutubeVideoPlayer: YoutubeVideoPlayer,
|
||||||
Zip: Zip
|
Zip: Zip
|
||||||
};
|
};
|
||||||
|
|
||||||
|
28
src/plugins/youtube-video-player.ts
Normal file
28
src/plugins/youtube-video-player.ts
Normal file
@ -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 { }
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user