-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add audio-extension
and video-extension
#17636
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for making a pull request to jupyterlab! |
3cc2335
to
bef281c
Compare
f191a37
to
bc533c9
Compare
Currently the two extensions have a very similar structure and approach, but it probably still makes sense to keep them separate. So they can be disabled separately, but also later to be able to add more features specific to audio or video, such as the ones mentioned in the top comment:
|
Co-authored-by: Michał Krassowski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds new audio and video viewer extensions to JupyterLab to support media file interactions directly in the UI. Key changes include:
- Adding new packages for audio and video extensions with related source code, configuration, and styling.
- Updating project configuration files (e.g., metapackage, labeler, dev_mode) and documentation to integrate the new extensions.
- Enhancing the document registry to include new file types and their associated icons for audio and video.
Reviewed Changes
Copilot reviewed 29 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/video-extension/* | New video viewer implementation and supporting configuration (TypeDoc, tsconfig, styles, source code, package definition). |
packages/audio-extension/* | New audio viewer implementation and supporting configuration (TypeDoc, tsconfig, styles, source code, package definition). |
packages/docregistry/src/registry.ts | Updated file type registry to support new audio and video file types. |
packages/metapackage/* | Updated references to include the new audio and video extensions. |
galata/test/documentation/* | New tests for both audio and video file opening behaviors. |
dev_mode/* and .github/labeler.yml | Updated configuration files to include the new extensions. |
OK I think the basic functionality should be in place. All CI is now all passing ✅ Marking as ready for review to encourage folks to try it, for example on Binder: https://mybinder.org/v2/gh/jtpio/jupyterlab/audio-video-extension?urlpath=lab Maybe it's in a good enough so that it can be available in an early JupyterLab 4.5 alpha release, to end users can try it too. Happy to iterate more on it if some things need to be fixed until the JupyterLab 4.5 final release. |
This works well with tabs, should it also work as output renderer? from IPython.display import display
from IPython.core.formatters import DisplayFormatter
video_path = './big_buck_bunny.mp4'
with open(video_path, 'rb') as f:
video_data = f.read()
mime_bundle = {'video/mp4': video_data}
# Display the MIME bundle
display(mime_bundle, raw=True) |
Yes it would likely make sense to support this too. For large files the amount of data to transfer from the kernel can be quite big, but we can also imagine this being useful for smaller files. |
I'll have a look next week. Unless folks are ok if we do that in a separate follow-up PR? |
References
Fixes #3860
Audio and video are taking a more significant part of AI workflows these days, for example for transcribing audio to text with tools like
whisper
.Code changes
@jupyterlab/audio-extension
and@jupyterlab/video-extension
User-facing changes
Users can double click on a video or audio file to open it in JupyterLab.
Before
jupyterlab-no-audio-video.mp4
After
jupyterlab-audio-video.mp4
To generate test files with
ffmpeg
:Backwards-incompatible changes
None
Ideas for possible follow-ups
<track>