通过我的android混合应用程序(cordova/phonegap),我想启动媒体播放器并播放来自ip摄像头的rtsp流。
我首先确认播放器可以通过从adb启动它来播放流:
adb shell
am start -n com.android.gallery3d/.app.MovieActivity -d rtsp://root:1@10.253.253.2/axis-media/media.amp要让它在我的应用程序中运行,我认为这个插件可能会有所帮助……
https://github.com/lampaa/com.lampa.startapp
但我不知道如何将adb命令中出现的内容转换为此插件所需的内容。
我试过很多方法,包括……
// cordova plugin add https://github.com/lampaa/com.lampa.startapp.git
navigator.startApp.start(
["com.android.gallery3d/.app.MovieActivity",
["-d rtsp://root:1@10.253.253.2/axis-media/media.amp"]],
function(message) {
console.log("start: " + message);
},
function(error) {
console.log("start " + error);
});发布于 2015-11-26 17:50:34
试试这个:
navigator.startApp.start([
["com.android.gallery3d", "com.android.gallery3d.app.MovieActivity"],
["rtsp://root:1@10.253.253.2/axis-media/media.amp"]
], function(message) {
console.log(message); // => OK
},
function(error) { /* error */
console.log(error);
});https://stackoverflow.com/questions/31836599
复制相似问题