1 | export interface StreamingVideoOptions {
|
2 | successCallback?: Function;
|
3 | errorCallback?: Function;
|
4 | orientation?: string;
|
5 | }
|
6 | export interface StreamingAudioOptions {
|
7 | bgColor?: string;
|
8 | bgImage?: string;
|
9 | bgImageScale?: string;
|
10 | initFullscreen?: boolean;
|
11 | successCallback?: Function;
|
12 | errorCallback?: Function;
|
13 | }
|
14 | /**
|
15 | * @name StreamingMedia
|
16 | * @description
|
17 | * This plugin allows you to stream audio and video in a fullscreen, native player on iOS and Android.
|
18 | *
|
19 | * @usage
|
20 | * ```
|
21 | * import {StreamingMedia, StreamingVideoOptions} from 'ionic-native';
|
22 | *
|
23 | * let options: StreamingVideoOptions = {
|
24 | * successCallback: () => { console.log('Video played') },
|
25 | * errorCallback: (e) => { console.log('Error streaming') },
|
26 | * orientation: 'landscape'
|
27 | * };
|
28 | *
|
29 | * StreamingMedia.playVideo('https://path/to/video/stream', options);
|
30 | *
|
31 | * ```
|
32 | * @interfaces
|
33 | * StreamingVideoOptions
|
34 | * StreamingAudioOptions
|
35 | */
|
36 | export declare class StreamingMedia {
|
37 | /**
|
38 | * Streams a video
|
39 | * @param videoUrl {string} The URL of the video
|
40 | * @param options {StreamingVideoOptions} Options
|
41 | */
|
42 | static playVideo(videoUrl: string, options?: StreamingVideoOptions): void;
|
43 | /**
|
44 | * Streams an audio
|
45 | * @param audioUrl {string} The URL of the audio stream
|
46 | * @param options {StreamingAudioOptions} Options
|
47 | */
|
48 | static playAudio(audioUrl: string, options?: StreamingAudioOptions): void;
|
49 | /**
|
50 | * Stops streaming audio
|
51 | */
|
52 | static stopAudio(): void;
|
53 | /**
|
54 | * Pauses streaming audio
|
55 | */
|
56 | static pauseAudio(): void;
|
57 | /**
|
58 | * Resumes streaming audio
|
59 | */
|
60 | static resumeAudio(): void;
|
61 | }
|