Is it possible to create an editor toolbar button to embed local videos file at cursor position?

How to create an editor toolbar button to embed a local mp4 video file at the cursor position of a tiddler using relative path in html video format as shown below

<video width="400" height="400" controls>
  <source src="./media/Videos/Radiology/MSK/ssstwitter.com_1692362637604.mp4" type="video/mp4">
</video>

You could use the stamp tool for the video tag in which then past the address.

Or clone the link tool on which you can paste a link. Try it. Now modify your clone to instead wrap it in the video tag.

There are many other ways to assist in this for example we can drop an image file on the editor to import it. Perhaps there could be a mp4 version.

Personaly I would set a field such as video-link and have a view template that detects and uses the link in a video tag.

I think you guys misunderstood my question.

I wanted the relative path of the video file to be added as src in the html video code automatically on selecting the file. File selection window should pop up on pressing this button. For that I need a button similar to the import page control button.

I have a method for doing this using tiddlyclip. I will use that method if its not possible to have editor toolbar button.

Perhaps we have but I think we need to remember that the file open dialogue allows you to select and “import a file” however for security reasons the full path is not made avaiulable to the wiki, which could be a website containing malware (and you would be giving it information about your local file system).

Try copying the image path to the clipboard, then invoke the Link button in the editor toobar and paste you link to see the result.

  • You could craft a button to set a source field or parameter to the pasted link.

I personaly use windows explorer and r-click “copy as path” on an existing file or link, you can also use the file save and file open (or import) to see local files and “copy as path”. This allows me to past the path into my wiki. Something similar can be done with copy link, or from the address bar in browsers.