benjypng / logseq-localassets-plugin

MIT License
33 stars 7 forks source link

Issue with embedding audio and video files #12

Closed candideu closed 8 months ago

candideu commented 1 year ago

I ran into some issues when trying to embed audio and video files:

image

Currently, the script generates the links like this:

- [:video {:controls true :src "C:\Users\user\Downloads\video.mp4"}]  
- [:audio {:controls true :src "C:\Users\user\Music\Mix.mp3"}] 

However, it should generate them like this:

Method 1: Forward Slashes and file:

- [:video {:controls true :src "file:C:/Users/user/Downloads/video.mp4"}]  
- [:audio {:controls true :src "file:C:/Users/user/Music/Mix.mp3"}] 

OR

Method 2: ! Links

- ![](file:///C:/Users/user/Downloads/video.mp4)
- ![](file:///C:\Users\user\Music\Mix.mp3)

OR

Method 3: HTML Embed

- @@html:  <video controls> <source src="file:C:/Users/user/Downloads/video.mp4"> </video>@@
- @@html: <audio controls src="file:C:/Users/user/Music/Mix.mp3"></audio> @@
candideu commented 1 year ago

Solves: https://github.com/hkgnp/logseq-localassets-plugin/issues/9

benjypng commented 8 months ago

Fixed in v2.0.0.