Webview

dibesw

Active Member
Licensed User
Longtime User
Hi,
I hope someone can solve my problem about Webview
I would like to display my IP Cam from Webview control.
This is my url that I see through Google Crome:
android1.jpg

This is my code:
B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
End Sub

Sub Globals
   Dim webview1 As WebView
End Sub

Sub Activity_Create(FirstTime As Boolean) 
    webview1.Initialize("")
    webview1.Enabled=True
   Activity.LoadLayout("IP")
    webview1.LoadUrl("http://192.168.1.92/mjpg/1/video.mjpg")
    'webview1.LoadUrl("http://www.basic4android.com")
End Sub
Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)
   
End Sub

Sub WebView1_UserAndPasswordRequired (Host As String, Realm As String) As String()
   Return Array As String("admin", "1234")
End Sub
This is that I see from my android emulator:
android2.jpg
.

where is the error?
Thank you in advance:sign0085:
 

dibesw

Active Member
Licensed User
Longtime User
Thank you Erel,
but I have tested it from My Samsung Tab2 but the problem is the same.
Probably webview is not the correct way?
I tried also with LOADVIDEO
B4X:
vv.Initialize("vv")
   Activity.AddView(vv, 0, 0, 500, 500)
   vv.LoadVideo("http","http://192.168.1.92/mjpg/1/video.mjpg")
   Msgbox("Loading and buffering video","Loading")
   ToastMessageShow("loading streaming video....", True)
   vv.Play
but the error is
"Sorry, this video cannot be played"
(in the manifest editor there is android.permission.INTERNET).
I do not know what to do:sign0163:
please tell me if there another chance.
thanks
 
Upvote 0
Top