问题
Like my question states, how do i sent a rtmp stream address to an external media player?
Mx Player is able to play my stream but i'm unable to sent the address to it. I've tried this:
String videoUrl = "rtmp://mystream";
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse(videoUrl), "video/*");
startActivity(i);
but it only works with online videos, my rtmp gives me an application error.
回答1:
MX Video Player does not support the combination of the scheme rtmp
and MIME type video/*
. To successfully use it to open an RTMP URI, change your code as follows.
String videoUrl = "rtmp://mystream";
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.setData(Uri.parse(videoUrl));
startActivity(i);
The scheme alone will be enough for MX Video Player to capture the Intent
.
回答2:
What you wrote there won't work, there is no native support for RTMP streams on Android.
However, you can use RTSP, as it is supported since API level 1.
If you still want to use RTMP, you may try this external library: http://code.google.com/p/android-rtmp-client/
来源:https://stackoverflow.com/questions/9057080/android-how-to-send-a-rtmp-stream-address-to-an-external-videoplayer-e-g-mx-p