I'm new to Pythonista and really like it. I'm trying to play .mp4 videos in ui.WebView(), but I cannot set the video to autoplay with playback controls hidden. The goal is to (1) program the video to start playing by itself and (2) disable/hide the playback control, so that it looks like background video.
I tried two approaches. First by load_html() :
webview = ui.WebView()
html = TEMPLATE.replace('{{FPATH}}', absfilepath)
webview.load_html(html)
webview.present()
The html has the following lines:
<video autoplay>
<source src="{{FPATH}}" type="video/mp4">
</video>
The video does not play when I set it to autoplay, It only plays when I use <video autoplay controls>, but in this case, I need to click the play button to start playing.
It looks like the iOS WebKit now allows autoplay for videos without soundtrack. https://webkit.org/blog/6784/new-video-policies-for-ios/
However, my video does not contain soundtrack, but it still cannot autoplay, even after I use <video muted autoplay>.
Is there any solution to this?
The second approach I tried is load_url()
I tried webview.load_url(absfilepath) to load the .mp4 files directly onto WebView. It works and autoplays, but it always comes with playback controls. The video can be stopped by tapping on the screen and does not look like background video. Is there any way to hide the playback controls?
Thanks!