Hi, I thought finally I would raise this one since it is a stubborn problem on my list of things I would like to get working properly on Tiddlywiki on my Android phone.
I use TiddlyDesktop on my laptop ( Linux Ubuntu ) and Tiddloid on my Android phone.
Quite a few of my tiddlers feature locally stored videos - often with my comments in the tiddler indicating items of interest at various timestamps in the video.
On both Deskstop and Android phone I store videos in a subdirectory called videos and images in a subdirectory called images.
Example code added to a regular tiddler
<html>
<video width='80%' poster='videos/poster.png' controls preload='none'>
<source src='videos/myvideo.webm' type='video/webm'>
Your browser does not support the HTML 5 video tag.
</video>
</html>
So I cannot play videos on Android - most internet sources suggest it is a security measure.
I have tried different video formats and many incantations for the source attribute - I have periodically returned to this issue over the last few years - for instance some advice has been to place videos on the SD Card and access them from there - so far nothing has worked. It seems that avenues such as using the SD Card work with some phone manufacturers and not others so the extent to which the security measure is enforced seems to be variable. My phone is Huawei.
Q/ So why can my Android browser show a local HTML file with images stored locally on my phone but not be able to show locally stored videos?
A/ The explanation seems to be that Javascript is required to show videos but not images and Javascript on android devices is limited in terms of file access for security reasons which seems reasonable.
Recent workarounds I have seen involve the user using an HTML file input so that the user has to select the video to be played - Javascript is allowed access to local files on an android device if the user has selected them in a file selector - again sensible since the user has made a decision.
See for instance…
But this is far too clunky for me.
There are also suggestions of using localhost but that involves creating a server on the phone which is very involved.
I don’t particularly want to have to host the videos online, I would prefer them as local files on Android just as with my desktop Tiddlywiki.
So after a fairly lengthy tussle with this issue I wondered if anyone out there had any ideas?
As mentioned I have already tried many of the “file// SDCard workarounds” and so on.
The issue also extends to locally stored pdf files but I have not tried as many solution attempts with them as I have with the video. I noted back in 2019 domor3000 confirmed this, I suspect the same root cause for the problem.
https://groups.google.com/g/TiddlyWikiDev/c/TNebCzX5d7Y
donmor3000 says “Sorry but I’m afraid webview cannot load pdf files. I tried pdf.js and strangely it only works with online urls.”
That would fit in with the Javascript security restrictions.
I suspect therefore this all boils down to an Android limitation outside of the domain of Tiddlywiki and perhaps of Tiddloid and to compound that different manufacturers have different levels of enforcement - some are more lax when the files are on the SD card - some not.
So before I end this apparently fruitless journey I thought I would ask the question to see if anyone had any new suggestions and also to document the issue so that people who later return to this have some answers.
Thanks Jon