import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams } from ‘ionic-angular’;
import { StreamingMedia, StreamingVideoOptions } from ‘@ionic-native/streaming-media’;
@IonicPage()
@Component({
selector: ‘page-tv’,
templateUrl: ‘tv.html’,
})
export class TvPage {
constructor() {
// let options: StreamingVideoOptions = {
// successCallback: () => { console.log(‘Video played’) },
// errorCallback: (e) => { console.log(‘Error streaming’) },
// orientation: ‘landscape’,
// shouldAutoClose: true,
// controls: false
// };
// this.streamingMedia.playVideo(‘rtmp://103.130.188.26:1935/ntv/live/live1’, options);
}
start(){
alert(“start video”);
(<any>window).videoStreamer.streamRTMP(‘rtmp://103.130.188.26:1935/ntv/live/live1’,alert(‘success’), alert(‘failed’)).onConnectionSuccess((data)=>alert(data)).onError((data)=>alert(data));
}