android-eye icon indicating copy to clipboard operation
android-eye copied to clipboard

How to stream video not just in a local network ?

Open guypld opened this issue 11 years ago • 2 comments

I'm trying to open a connection to a given IP that is not related to local network (WIFI), but it won't work. What is the problem? Thanks.

guypld avatar Jun 26 '13 20:06 guypld

It does work for me!!!

if you are not on a local network than probably you don't have a public ip, because usually phones companies do not provides one to customers; so you are under a NAT and the browser cannot see the device.

i tried many sim cards, and so far only italian Telecom gives you a public ip, and on that connection i can see the video playing; but very slowly.

another trick is to change the timeout of the refreshing of the page in droideye.js line 38: with a small timeout the video will be smoother, for me with 50 ms the video in the browser it's quite similar to the android camera one (on a wifi).
But if your connection is not fast enough to support the refreshing rate(every refreshing is a new image downloaded) than you will see a black screen on your browser (as i experienced on sim card data connection). So in the last case maybe you should higher the timeout; I got the best performances with setTimeout(refreshLive, 50); on a wifi network and setTimeout(refreshLive, 500); on my simcard.

remeber also to have a look to the MainActivity class line 68: you should try different values for "final int maxVideoNumber = 2;" frames are stored in an array of that dimension when i lower the refreshing timeout i have to set maxVideoNumber to 10 or 15.

pastissolo avatar Jul 03 '13 15:07 pastissolo

In version 2.3 the application shows an error message both if using only phone internet access and if acting as hotspot. Allowing internet access should be user-configurable, and refreshLive parameter too.

narcisgarcia avatar Feb 03 '15 08:02 narcisgarcia