Skip to content

feat(asset): support external video sources with Notion-style rendering #651

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

qixing-jk
Copy link

Description

Notion Test Page ID

17d00a962bac80728f9fd83e078285d6

Known Issues

Solution
Implement rendering using the same method as the Notion website.

Final Result
Clip_20250714_155757

- add display_source handling for video blocks
- implement iframe rendering for external video sources
- add link_title support in block format
- adjust video rendering based on display_source presence
- Introduce new utility functions `setUrlParams` and `deleteUrlParams`
- Replace manual URL parameter handling with utility function calls
- Update affected components (asset, file, audio) to use new utility
- import deleteUrlParams utility function
- modify conditional logic for displaySource handling
- clean up URL parameters when displaying source
Copy link

vercel bot commented Jul 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-notion-x ✅ Ready (Inspect) Visit Preview Jul 14, 2025 8:15am
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview Jul 14, 2025 8:15am

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
- change const to let for displaySource variable
- update displaySource assignment instead of deletion
- Fix typo in `asset.tsx` where `vidoeTitle` was incorrectly spelled
The setUrlParams function was not assigning its result to the source variable
in asset, file, and audio components. This change ensures the modified URL with
spaceId parameter is properly stored and used in subsequent operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant