VideoView and HTTP credentials

blong

Active Member
Licensed User
Longtime User
I want to use VideoView to access files on my local server
Like this

vv.loadvideo("http","http://192.168.1.50/PublicMovies/abcdef.mp4")

however my server requires a username and password.

if I type the line into my PC on the same network

http://192.168.1.50/PublicMovies/abcdef.mp4

I get sent to a login page.

can I somehow use HttpUtils to do login ?

Help appreciated.
 

moster67

Expert
Licensed User
Longtime User
Have you already tried inserting user and password before the ip-address?

Like this:

vv.loadvideo("http","http://username:password@192.168.1.50/PublicMovies/abcdef.mp4")
 
Last edited:
Upvote 0

blong

Active Member
Licensed User
Longtime User
Did not work :-(

Moster67

Tried as you suggested and did not work.

Have you ever used that sort of login to a server ???

The box that I am developing is running Android 2.2 ... could that have some bearing on problem ??

Also VideoView always just has a message "Sorry cannot play video"

This message occurs if file not found, codec not available etc etc .. would be nice if error was more specific.

Erel .. thanks for reply. Downloading file not an option ... is 1.5 gigs .. can not do this each time I want to watch a movie ...

The actual box is able to use its software to stream from my server .... frustrated that I can not do it ! The first time I try this you have to supply login credentials which it remembers and then will stream movie(s) fine. it sets up a shortcut to the server which I feel is something like a "mapped network drive" in Windows.

In fact "mapping a network drive" would be my goal and creating a mount point. Possible ??
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Also VideoView always just has a message "Sorry cannot play video"
The problem is that this error happens inside the native VideoView. Checking the unfiltered logs will sometime yield more information.

In fact "mapping a network drive" would be my goal and creating a mount point. Possible ??
There is no simple way to map a network drive in Android.

Does it work if you remove the authentication requirement?
 
Upvote 0

blong

Active Member
Licensed User
Longtime User
More....

Erel

It does not work when I remove authentication.

Basically even though the NAS drive directory I want is marked as PUBLIC, the NAS wants a login for access. When I use Windows I still must supply credentials to get a "mapped drive"...

Most NAS servers would require authentication I would think. Guess I could investigate a DUMB server which requires no authentication ??

Sad one can't make "mapped drives" in Android. Now there's a project !
 
Upvote 0
Top