Problem with android streaming with RTSP
I am developing an application that can do some streaming. After searching on the internet, I used the standard code:
VideoView mVideoView = new VideoView(this);
mVideoView.setVideoURI(Uri.parse(videoURL));
Medi开发者_如何学编程aController mc = new MediaController(this);
mVideoView.setMediaController(mc);
mVideoView.start();
The thing is the app works fine with videoURLs like http://.....3gp
, or http://...mp3
. But when I use an URL like rtsp://...3gp
it only works if I connect to the internet with the SIM data connection, but it doesn't work if I use the wireless connection.
At first I thought I could be related to the firewall, or the router, that had the rtsp protocol disabled or it was simply loosing udp packages. Then I tried the standard android YouTube application and it works fine through both connections (SIM data and wireless).
My question is, if both YouTube and my App use RTSP, why one works with WIFI but the other one doesn't?
I am testing on device, version 2.2.2
Many Thanks
It seems your carrier might be blocking access to RTSP. Youtube works because it is a popular service and it is bound to be allowed in your carrier's proxy.
I have developed applications that can access RTSP server over Wifi or 3G without problems on Android. Nonetheless we know our carrier sets no restrictions and our phone are unlocked.
Is your phone locked to a particular carrier? Is your APN configured to use a proxy? You could use alternative SIM/APN settings to override this.
精彩评论