Without internet access, can I play a selection of video files from my local hard disc on TW5?

216 views
Skip to first unread message

JWHoneycutt

unread,
Jun 9, 2017, 4:04:22 PM6/9/17
to TiddlyWiki
How do I call up a local video?

Mark S.

unread,
Jun 9, 2017, 7:06:02 PM6/9/17
to TiddlyWiki
If your browser can play them, then there's a chance you can play them inside of TW. At least in windows, do a right click on the file name and "Open with" and select your browser.

If that works, then you might be able to set up a tiddler by setting the _canonical_uri field (point to video) and content type. For the mp4 I tested, the content type was video/mp4, but you might have to look for mime type if you have a different type.

If you can't figure out the mime type, or it doesn't seem to work, you might still be able to use an iframe. e.g.:

<iframe src="path_to_videos/my_video_name.mp6" width="90%" height="500px"></iframe>

For ease of use, you might consider trying Mat's Ricklinks (http://richlinks.tiddlyspot.com/)

Good luck,
Mark

Mark Kerrigan

unread,
Jun 9, 2017, 11:38:48 PM6/9/17
to TiddlyWiki
I use transclusion. My solution for me on OS X is the following.

First I create a new tiddler and name it video. The body of the tiddler is as follows

\define videoLink()
file:///Users/Mark/Desktop/Training Material/videos/$(currentTiddler)$
\end
<html>
<video controls=controls>
<source src=<<videoLink>> >
</video>
</html>

I define the folder where all of my videos will be located and it uses the tiddler name to build the path to the video.

I then fill in a generic HTML5 video template, that places the path to the video in the source tag.

I then create a new tiddler, I name it.

example.mp4

For the body of the tiddler, I enter

{{!!title||video}}

The braces indicate we are transcluding a tiddler. The double exclamation points mean we are transcluding a specific field of a tiddler, in this case the title. The double pipes is specifically used for a template tiddler. The template tiddler is simply called 'video'.

When I use it in a tiddler, I simply write

{{example.mp4}}

and it shows the video.

Note this solution is not the best way to make custom video sizes or use poster images. I also rip all my videos through Handbrake to mp4 format.

Thanks
Mark Kerrigan

JWHoneycutt

unread,
Jun 11, 2017, 1:42:10 AM6/11/17
to TiddlyWiki
Thank you Mark S and Mark Kerrigan!
I am on macOS, so I am trying Mark Kerrigan's transclusion example.

My pilot video is at: `///Users/jwh/Movies/video.mp4`

So I created a tiddler: 

!!title: 
`video` (but I have also tried `video.mp4`)

!!body:
`\define videoLink()
file:///Users/jwh/Movies/$(currentTiddler)$
\end
<html>
<video controls=controls>
<source src=<<videoLink>> >
</video>
</html>`

''I assume the `$(currentTiddler)$` was literal''

!!content type:
`left blank`

''I don't understand this next instruction: "I then fill in a generic HTML5 video template, that places the path to the video in the source tag."''

*What is a "generic HTML5 video template" - is that a "Type:" that doesn't pop up in the pick list?

*By "path to the video in the source tag" - should I create a tag pill with the video path as its name? Put that long tagname into one of the following tiddlers?

Then I create a tiddler title: `example.mp4`, body: `{{!!title||video}}`

Then I create another tiddler title:`play it already`, body: `{{example.mp4}}`

I get a tantalizing little black video box that does not respond to clicking the play button.

I feel like I am getting close

Mat

unread,
Jun 11, 2017, 8:04:16 AM6/11/17
to TiddlyWiki
Maybe you can use the direct html <video> tag, as used in RichLinks, basically:

<video src="...link..." controls preload="auto" class="richlink-video">
<p>Your browser doesn't support HTML5 video.<br>Instead, go directly to <<link>></p> 
</video>

<:-)

Mark S.

unread,
Jun 11, 2017, 12:25:18 PM6/11/17
to TiddlyWiki
As I mentioned, you should start by testing if your browser can play the particular file. If your browser can't play it, there's no TW magic that will change that. Once you have determined that the file will play in your browser, you can cut the address out of the url line and hard-code it into the <video> tag.

For me the video tag didn't work. A frame would form, but the movie wouldn't play. The iframe approach seemed to be more reliable. You can wrap the iframe as a tiddler template or as a macro, depending how you plan to process your movie's (e.g. as tiddlers with same name as the movie, or as tiddlers with a field with the name of the movie, etc.)

Good luck,
Mark

Greg Davis

unread,
Jun 14, 2017, 5:36:53 PM6/14/17
to TiddlyWiki
Hopefully you found your answer, haven't been keeping up with the group. You might try an example of an alternative:

https://groups.google.com/d/msg/TiddlyWiki/TL8N40F0DVQ/B0NlKmA9FAAJ

example: http://kpoplibrary.tiddlyspot.com

I think all recent OSs and browsers support MP4 though there were some holdouts that required WEBM or OGV. The examples supported all three but you could remove the lines related to codecs you don't use. The cover picture is not necessary but it helps show it is probably the right video.

Good Luck,
Greg

JWHoneycutt

unread,
Jun 25, 2017, 9:42:12 PM6/25/17
to TiddlyWiki


Thank you, Greg

you could remove the lines related to codecs you don't use. The cover picture is not necessary...

I really struggle with relative paths and can't make the basic connection to a MP4 video in the same directory as the TW5 file.

So I am removing everything that might be complicating the most basic function:

<center><video width="568" height="320"
controls preload="none">
<source src="video.mp4" type="video/mp4">
</video></center>

I also tried to play "video.mp4" in a video subdirectory under Dropbox by replacing this line:

<source src="../Dropbox/video/video.mp4" type="video/mp4">

Maybe this code only works for TW Classic? That seems to always be the answer when I 'm stuck...
Reply all
Reply to author
Forward
0 new messages