I use a single file TW on a linux laptop but also on Android devices.
Android users may be aware of difficulties accessing locally stored media files referenced by a link from a locally stored TW html file.
There are workarounds, for instance I use the RCX server for video files stored in a local directory on the Android device, this works because HTML offers the facility to add several file paths for one video, the browser picks the first one that works on that browser.
For image files I consider too large to import into my TW I place those image files in a specific directory and use the canonical URI method to load the external image file which seems to be the standard way and works fine on my laptop.
However it is not obvious how to elegantly get this working on Android where locally stored files cannot be accessed due to the OS ( security? or design?).
It struck me that it would be handy if a tiddler containing the ‘canonical URI’ field was processed with the ability to handle a list of “canonical URIs” in a cascade fashion so that the first ‘canonical URI’ that resolved to a retrievable file was used.
This would make the TW “canonical URI” tiddler have a similar (not not identical) behaviour to the way HTML5 handles video file choices - but cascading one a simpler condition, namely if the file can be retrieved. In my case of course the file does actually exist but can only be accessed through the local RCX server.
For illustration here is my video code, it uses a method to select the poster image for the video choosing between directly going to the nominated directory (laptop) OR accessing through the RCX server (Android), the trigger being the word ‘content’. This method is not required for the actual video file since HTML5 already anticipates a list of video options from which it will select the file it prefers and trivially disregards anything that cannot be accessed.
I am not seeking to change the method for video - it works fine, but I would like to use an enhanced “canonical URI” feature for external images, perhaps also pdfs so that on Android these come though the RCX server. Of course I could simply choose to access everything through RCX regardless of platform but I would prefer to limit workarounds to the devices that depend on them.
<html><video width='80%'
poster={{{ [{$:/info/url/protocol}prefix[content]then[http://127.0.0.1:8080/videos/Futuris.jpg]]:else[[videos/Futuris.jpg]] }}}
controls preload='none'>
<source src='http://127.0.0.1:8080/videos/Futuris.webm' type='video/webm'>
<source src='videos/Futuris.webm' type='video/webm'>
Your browser does not support the HTML 5 video tag.
</video></html>