Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mediaplayer error (1, -1004)

 
Maykel John
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have a problem with my mediaplayer application. The purpose of this application is to read a video stream from an ip camera. For the moment I'm trying to read a video streamed with VLC in HTTP and RTSP and it doesn't work. But I can read a local video without trouble (sound + video). When I try to read an HTTP stream (on ports 80 and 8080) I get the following error :
MediaPlayer Error (1, -1004)


The previous posts I saw seem to indicate a network error. But the fact is that I'm trying to access the stream from the emulator launched on my computer *. And VLC is launched on my computer too. So I tried to get the stream with another instance of VLC and it perfectly works, HTTP and RTSP are OK. I even tried from my mobile with VLC beta and it's good.

I thought it was a network problem but totally accidentally, before posting this message, I realized that when the application tried to connect to an inexistang stream I still had this error 1004 (after a reboot VLC was not launch and so couldn't stream, and I saw the same error).

But here is what I did before realizing that :

Internet permission is declared in the manifest, and I can access a webpage from my app. I pinged my computer from a terminal and it's ok. One told me it could be firewall related and I gave access to my app. I'm working with windows 7, so I'have followed this tuto and I also did it manually, configuring input and output rules, allowing everything for my emulator. I also have disactivated my firewall and but there, my application doesn't even access the VLC stream. I have an unknown mediaplayer error for every temptative (HTTP and RTSP).



*I precise that I'm using Genymotion which is the best solution I have found for the moment. Eclipse ADT and Bluestacks didn't show the video


Here is my code :




PS : I have the same case with Phonegap, when trying to read a video. Local works, stream fails.



My configuration :
Windows 7
Eclipse ADT
Genymotion
-> Galaxy Nexus with Android 4.3
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I can read a local video without trouble (sound + video).
What does this mean - what is "local video"?

When I try to read an HTTP stream (on ports 80 and 8080)

So the app running on the emulator tries to connect to ports 80 and 8080 on localhost? Are you using 10.0.2.2 as the IP address? That's how the emulator gets to localhost.
 
Maykel John
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:What does this mean - what is "local video"?

It's a video uploaded on the sdcard. Or in raw file ;)

So the app running on the emulator tries to connect to ports 80 and 8080 on localhost? Are you using 10.0.2.2 as the IP address? That's how the emulator gets to localhost.

No it wasn't. I have tried with but didn't work. The basic URL is http://192.168.1.86:80/manofsteel. This is the one I use with VLC. I replaced 192.168.1.86 with 10.0.2.2 without success. I suppose it isn't correctly used.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic