Dim nview As Int = 0
For Each id As Int In listaVideos.Keys
Dim datos As Map = listaVideos.Get(id)
Dim videoID As Int = datos.Get("idvideo") ' Cambiar para usar claves del Map
Dim videoDESCRIPCION As String = datos.Get("descripcion")
Dim videoREFERENCIA As String = datos.Get("referencia")
Dim videoPROVEEDOR As String = datos.Get("proveedor")
Dim embedURL As String = $"https://player.vimeo.com/video/${videoREFERENCIA}?autoplay=0&controls=1&loop=0"$
Dim vidWebview As WebView
vidWebview.Initialize($"vidWebview_${nview}"$)
vidWebview.LoadUrl(embedURL)
vidWebview.JavaScriptEnabled = True
svVideosEntrenamiento.Panel.AddView(vidWebview, vidLeft, vidTop, vidWidth, vidHeight)
svVideosEntrenamiento.Panel.GetView(nview).Background = vidBackground
vidTop = vidTop + 60%y
nview = nview + 1
Next
Hello, i have this code, and it works when try to load the video into the webview, but when i play the video there is a 'V' link, the V from Vimeo that redirect the video to a new url from vimeo web. I try to capture this event but not works. I use JavaScriptEnabled = True, but do not recognize the event click in the V letter.
I tried tu capture the event because i donn't want that de url change and only show the video
Sorry, drgottjr,I haven't explained myself well, if someone clicks on the letter V that represents the Vimeo logo, when you are viewing the video, the webview changes the url and shows another page that is no longer the video.
What I would like is to prevent the webview from leaving the video, but it seems that the click event in the Vimeo player control is not detected.
site has a CSP in effect. it may be difficult to inject javascript. it will take a lot of trial and error to get it right (unless you're lucky early on). the site's policy appears to leave a few doors open, but you will have to know what you're doing or wait until the collaborative minds of our javascript mavens find the correct statement. "event.preventDefault();" is the usual statement to cause a click on an <a> link to be ignored, but in this case, the CSP doesn't allow you to get that far. i hope this is clear.
here; this works for me. see if you can work it into your project.
1) load and run the project
2) wait until log says "page loaded"
3) tap "inject" button
4) make sure you see "injection done" in log
5) tap on "V"
6) "V" is blocked