-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Try to find the simplest way to implement this with not so many changes. If possible no extra dependencies, and use dependencies already used by frontend/
Problem
Github adds a link in the text when you upload a video like this:
https://github.com/user-attachments/assets/46b377f2-a949-4e6e-b82a-bf528e7fd42a
There's no markup around it, it just leave that text link when it's uploaded. When it renders, it renders as a html5 video player.
Solution
Find github user-attachments and render them with a player.
react-markdown provided CommonMark out of the box. https://commonmark.org/
This can be extended with GitHub Flavored Markdown https://github.github.com/gfm/ (https://github.com/remarkjs/remark-gfm)
The video player feature is not part of either standard 😅
GitHub the UI adds that on top of both standards.
GitHub includes a bunch of custom players https://github.com/orgs/remarkjs/discussions/932#discussioncomment-3437350
This would probably live as a rehype plugin https://unifiedjs.com/learn/
or as a custom a component to use the player you want to leverage https://github.com/remarkjs/react-markdown?tab=readme-ov-file#components