You should let some time between the events (instead of putting DateTime.Now everywhere) and if it's a horizontal scroll you should keep the same horizontal position. But I don't say that will work as I have no idea of how a WebView behaves and what it expects. I never used one. Anyway, using GD for scrolling a view, is a bad idea IMHO.I tried what Informatix suggested, but sadly no succes. This code does not work:
B4X:Dim MEv As Object = GD.CreateMotionEvent(DateTime.Now, DateTime.Now, GD.ACTION_DOWN, 40%x, 90%y) GD.PassTouchEventTo(MEv, WebView1) Dim MEv As Object = GD.CreateMotionEvent(DateTime.Now, DateTime.Now, GD.ACTION_MOVE, 10%x, 10%y) GD.PassTouchEventTo(MEv, WebView1) Dim MEv As Object = GD.CreateMotionEvent(DateTime.Now, DateTime.Now, GD.ACTION_MOVE, 20%x, 20%y) GD.PassTouchEventTo(MEv, WebView1) Dim MEv As Object = GD.CreateMotionEvent(DateTime.Now, DateTime.Now, GD.ACTION_UP, 20%x, 20%y) GD.PassTouchEventTo(MEv, WebView1)
Thank you Martin for this detailed information. Could you maybe do me a big favour and investigate why strange things happen with my code (that is given in thread #22 above) when the full screen button in the bottom right corner of the video player is touched? In the regular Chrome Browser there is no problem with http://www.npo.nl/kassa/10-05-2014/VARA_101341883", but in my code in Post #22 things go wrong: The video freezes and full screen never happens. Thank you in advance!
Sub WebView1_PageFinished(Url As String)
Log("WebView1_PageFinished Url="&Url)
Select Url
Case "http://www.gemistvoornmt.nl/a.aspx/453063900/0"
Dim Javascript As String
' Javascript="B4A.CallSub('ProcessHTML', false, document.getElementById('playerID').src)"
Javascript="window.location.href=document.getElementById('playerID').src"
WebViewExtras1.executeJavascript(WebView1, Javascript)
End Select
End Sub
Under that, under controls it mentions that javascript can be used to control the player.autostart
Automatically start playing the video on page load. Can be true or false (default). Autostart does not work on mobile devices (iOS and Android). See Autostarting Videos for more info.
<object width="100%" height="100%" type="application/x-shockwave-flash" data="http://npoplayer.omroep.nl/media/jwplayer/6.5.3609/jwplayer.flash.swf" bgcolor="#000000" id="player" name="player" tabindex="0">
<param name="allowfullscreen" value="true">
<param name="allowscriptaccess" value="always">
<param name="seamlesstabbing" value="true">
<param name="wmode" value="opaque">
</object>
player.play(); // does this start playback of the video?
player.resize(320, 180); // does this resize the video player?