UNPKG

2.45 kBJavaScriptView Raw
1"use strict";
2var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6 return c > 3 && r && Object.defineProperty(target, key, r), r;
7};
8var plugin_1 = require('./plugin');
9/**
10 * @name VideoPlayer
11 * @description
12 * A Codova plugin that simply allows you to immediately play a video in fullscreen mode.
13 *
14 * Requires Cordova plugin: `com.moust.cordova.videoplayer`. For more info, please see the [VideoPlayer plugin docs](https://github.com/moust/cordova-plugin-videoplayer).
15 *
16 * @usage
17 * ```typescript
18 * import { VideoPlayer } from 'ionic-native';
19 *
20 *
21 * // Playing a video.
22 * VideoPlayer.play("file:///android_asset/www/movie.mp4").then(() => {
23 * console.log('video completed');
24 * }).catch(err => {
25 * console.log(err);
26 * });
27 *
28 * ```
29 * @interfaces
30 * VideoOptions
31 */
32var VideoPlayer = (function () {
33 function VideoPlayer() {
34 }
35 /**
36 * Plays the video from the passed url.
37 * @param fileUrl {string} File url to the video.
38 * @param options {VideoOptions?} Optional video playback settings. See options above.
39 * @returns {Promise<any>} Resolves promise when the video was played successfully.
40 */
41 VideoPlayer.play = function (fileUrl, options) { return; };
42 /**
43 * Stops the video playback immediatly.
44 */
45 VideoPlayer.close = function () { };
46 __decorate([
47 plugin_1.Cordova()
48 ], VideoPlayer, "play", null);
49 __decorate([
50 plugin_1.Cordova({ sync: true })
51 ], VideoPlayer, "close", null);
52 VideoPlayer = __decorate([
53 plugin_1.Plugin({
54 pluginName: 'VideoPlayer',
55 plugin: 'https://github.com/moust/cordova-plugin-videoplayer',
56 pluginRef: 'VideoPlayer',
57 repo: 'https://github.com/moust/cordova-plugin-videoplayer',
58 platforms: ['Android']
59 })
60 ], VideoPlayer);
61 return VideoPlayer;
62}());
63exports.VideoPlayer = VideoPlayer;
64//# sourceMappingURL=video-player.js.map
\No newline at end of file