Android Question VideoView and HTTP does not work

crimson ghost

Member
Licensed User
Longtime User
I was looking at playing a video located on my computer.
I did this in the manifest editor:
AddPermission("android.permission.INTERNET")

in the program I put this line:
VidPlayer.LoadVideo("http", "http://192.168.1.12/cookies07.mp4")

The file plays fine when loaded to android. When I do the HTTP thing I get "Can't play this video".
Is there something else I should be doing to make this work? The file is located at C:, should it really be put somewhere else? I can't find anything about where "192.168.1.12" points to on my computer. I don't know if this means anything, but I get this same error no matter what I put in for the file name. Just to point out, I have used SMB for PC access and have had no trouble.

I have searched for an answer but others seem to have done this and it works fine for them. So I hope someone can point out what I need to do to make this work. I have tried two different computers and both real devices and the bluestacks emulator. Same error.
 

crimson ghost

Member
Licensed User
Longtime User
Thank you, I will try that. I just went back and re-read the articl I used as a reference and overlooked the fact that in the question it was mentioned that he had written a small server program on his PC. In the answer I thought they were implying that you didn't need a server and that all you needed was VideoView. I was trying this because KODI does it and I had to do nothing on my computer for it to work. Does B4A have anything that will allow me to do what KODI does?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I was trying this because KODI does it and I had to do nothing on my computer for it to work.
So i guess you are running the KODI App on your PC? In this case KODI has direct Access to the HDD and can Access the Files there.

If you want to access the Files from outside your PC (or even from Mobile) you need to have a Server-Software running. You Firewall needs to be configured as well.
 
Upvote 0

crimson ghost

Member
Licensed User
Longtime User
Many thanks. That worked perfectly and was easy to set up. Maybe you know something about an earlier question I asked. I read somewhere that XOM could be used to stream video and I tried it but all I got was some sore of permission denied error and could go no further since I was sharing everything I was aware of and I could access my computer from android in a couple of different ways already. Unfortunately I was just searching for that article and can't find it plus I deleted the code. Anyway, do you know anything about XOM?
 
Upvote 0

crimson ghost

Member
Licensed User
Longtime User
KODI is running on an android box connected to a TV. It is networked directly to a router by cable. KODI came installed on the android box and all you have to do is type in the network address of network shared folders and it connects to them and works perfectly. I was just wondering if there is someway to do this same thing using b4a.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…