Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Android: Stream RTSP using an intent

Hi,

I'm able to play RTSP video using the video player, but as there are bugs with seeking and RTSP I'm looking into playing video through an intent instead. I've not been able to get this working however: I've got the following code:

var intent = Ti.Android.createIntent({
    action: Ti.Android.ACTION_VIEW,
    type: 'video/*',
    data: movie.url
});

Ti.Android.currentActivity.startActivity(intent);

(movie.url is a URL in the style rtsp://some.url)

But I'm getting an exception when I run it:

No Activity found to handle Intent

I'm guessing this is because there's no video player on the device that is registered to support RTSP - is that the case, or have I configured the intent wrong? Has anyone got this working in the past and can recommend a way forward?

Cheers,
Craig

— asked November 9th 2011 by Craig Marvelley
  • android
  • intent
  • rtsp
  • video
0 Comments

1 Answer

  • Accepted Answer

    Your intent is created correctly and will work (I've tested it) if you have an RTSP player installed. Try installing the free "MoboPlayer" from the android market to test it out: https://market.android.com/details?id=com.clov4r.android.nil&hl=en

    — answered November 11th 2011 by Tony Lukasavage
    permalink
    3 Comments
    • Thanks Tony, MoboPlayer worked a charm.

      — commented November 18th 2011 by Craig Marvelley
    • is there a way where we can inform user to install the player if its not available. And also does it also play the mms and rtmp streams?

      — commented November 19th 2011 by Nikunj Sakhrelia
    • The easiest thing to do is this. When you attempt to open an intent list for which the device has no available intents, an exception will be thrown. Catch the exception, and in the catch, pop up an alert dialog that informs the user that they must have an appropriate player installed.

      — commented November 19th 2011 by Tony Lukasavage
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.