Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Video display #118

Open
light-matters opened this issue Sep 17, 2024 · 2 comments
Open

Support Video display #118

light-matters opened this issue Sep 17, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@light-matters
Copy link
Contributor

Manipulating/creating a Wolfram Video returns a strange format that no visual tool knows how to interpret.

(w/VideoTrim [12 24])

Returns

(Video /home/ctw/Documents/Wolfram/Video/VideoTrim-5ef8ad95-051d-4e6f-a1b2-1f1e24b62217.mkv (-> Appearance Automatic) (-> AudioOutputDevice Automatic) (-> SoundVolume Automatic))

We should some implement some sort of 'kindly' support (e.g. metadata) that allows visual tools such as Clay and Clerk to display these outputs correctly.

@light-matters light-matters added the enhancement New feature or request label Sep 17, 2024
@holyjak
Copy link
Member

holyjak commented Sep 17, 2024

@daslu Does Clay/Kindly support metadata on return values to know how to display them? So that when we return (Video "/file/path/..") we could add some metadata to tell Clay to get the video path (i.e. second on the data structure) and display as a video? 🙏

I obviously cannot simply (with-meta '(Video "path..." #_...) {:kind/video true}) because that does not communicate that the value of interest is a local file path, and how to get it out of the data structure (here, a List). I don't know if :kindly/options could be leveraged? Currently, it seems from the Kindly Book that only embedded video from youtube are supported... Perhaps I should rather use hiccup of html and the video tag - but still need to instruct the viewer tool how to get from the actual value to that... Perhaps something like :kind/custom (fn [wolfram-video] ^:kind/hiccup [:video [:source {:src (second wolfram-video)}]]) ?

@daslu
Copy link
Member

daslu commented Sep 17, 2024

Hi.

I'm copying a few details from a private chat with @light-matters:

  • kind/video supports only youtube, and following your proposal, we will add support for local files.
  • kind/hiccup is supposed to support anything that HTML can do.
  • If you render through Quarto (incliding Reveal slideshows), you include in your markdown comments anything that Quarto supports: Videos.

If you are pointing to files, you need to put them under a directory which is copied by Clay under the target directory, as explained in Referring to files. Then, you can just refer to them with the path relative to the target directory.

There is also some support for custom functions, as you suggested: Functions

Does it seem to make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants