B4J Question Video on Webview

Douglas Farias

Expert
Licensed User
Longtime User
Hi all, i m trying to put a video to run on a webview.

i have put the webview size
B4X:
web.SetLeftAndRight(0%x,100%x)
web.SetTopAndBottom(0%y,100%y)

but the video stay on center, dont go to 100% screen.

how can i change the size of the player on webview to put the video 100% of screen?

filme.jpg


Any way to put this 100%? css etc?
 
Last edited:

Douglas Farias

Expert
Licensed User
Longtime User
i have try with this 2 codes
B4X:
wv.LoadUrl("http://www.dailymotion.com/video/x2oa18s_une-video-amateur-montre-le-moment-ou-le-seisme-a-frappe-le-tibet_news")

'
wv.LoadHtml($"<iframe frameborder="0" width="480" height="270" src="http://www.dailymotion.com/embed/video/x2bi11w" allowfullscreen></iframe><br /><a href="http://www.dailymotion.com/video/x2bi11w_un-sinkhole-engloutit-une-voiture-sur-une-route-de-chine_news" target="_blank">Un &quot;sinkhole&quot; engloutit une voiture sur une...</a> <i>by <a href="http://www.dailymotion.com/lemondefr" target="_blank">lemondefr</a></i>"$)

i m try to change de width and height of 2° example but dont work.
this 2 options show like the image on center
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
with this
B4X:
    Dim sb As StringBuilder

    sb.Initialize
    sb.Append("<video width='100%' height='100%' controls>")
    sb.Append("<source src='http://sample-videos.com/video/mp4/720/big_buck_bunny_720p_30mb.mp4' Type='video/mp4'/>")
    sb.Append("</video>")

show the same on center
filme (1).jpg


very strange i have put 100%
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
This code does fill the entire WebView here:
B4X:
  sb.Initialize
  sb.Append("<video width='100%' height='100%' controls>")
  sb.Append("<source src='http://sample-videos.com/video/mp4/720/big_buck_bunny_720p_30mb.mp4' Type='video/mp4'/>")
  sb.Append("</video>")
   WebView1.LoadHtml(sb.ToString)
I guess that it depends on the display driver.
 
Upvote 0
Top