我无法在我的离子应用程序CordovaStreamingMedia,cordova-rtsp中播放合适的插件来播放rtsp视频,但没有成功。请帮忙
答案 0 :(得分:1)
在离子项目中安装此插件。
List<Integer> diffList = new ArrayList<>(CollectionUtils.subtract(NATURAL_MANDATORY, MandatoryList));
=========================== .ts ================== ===============
ionic cordova plugin add cordova-plugin-streaming-media
npm install --save @ionic-native/streaming-media
========================= HTML ===================== =
import { NavController, ToastController } from 'ionic-angular';
import { StreamingMedia, StreamingVideoOptions, StreamingAudioOptions } from '@ionic-native/streaming-media';
constructor(public navCtrl: NavController,
public toastCtrl: ToastController,
private streamingMedia: StreamingMedia) { }
startVideo(){
let options: StreamingVideoOptions = {
successCallback: () => { this.tost('Video played'); },
errorCallback: (e) => { this.tost(JSON.stringify(e)); },
orientation: 'landscape',
// orientation: 'portrait'
};
this.streamingMedia.playVideo(**'YOUR_LIVE_STREAMING_URL'**, options);
}
tost(message){
let toast = this.toastCtrl.create({
message: message,
duration: 3000
});
toast.present();
}