Feat: Video Chapter Management
Pull Request: Add JSON Import for Video Section Management
This pull request introduces a new feature that allows users to import a JSON file to define video sections, such as “Introduction”, “Chapter 1”, and other custom sections. This enhancement streamlines the organization of video content by enabling users to upload pre-structured data rather than manually entering sections.
New Features
1. JSON Import Functionality
- Users can upload a JSON file via the user interface.
- The JSON file must adhere to a predefined schema (detailed below).
- Upon successful import, the sections are automatically mapped and displayed in the video editor interface.
2. Validation
- Robust validation mechanisms for uploaded files:
- Ensures the uploaded file is of the JSON format.
- Verifies the structure of the JSON content against the predefined schema.
- Provides error messages for invalid files or malformed content.
3. UI Updates
- Added an “Import JSON” button in the Video Section Manager.
- Enhanced error handling with user-friendly alerts for validation issues.
4. Schema Definition
The imported JSON file must follow this structure:
[
{"title": "Introduction", "timestamp": 0},
{"title": "Chapter 1", "timestamp": 60000},
{"title": "Chapter 2", "timestamp": 120000},
{"title": "Conclusion", "timestamp": 180000}
]
Screenshots/Demo
This feature simplifies workflow and ensures consistency in video section management for users.
Hey @mazen-salah, this feature looks interesting! Regarding the JSON schema you used in the PR, is it a standard that's also used by any other apps, or is it something you came up with?
Hi @anilbeesetti,
Thank you for the feedback! I came up with the JSON schema specifically to align with the needs of this feature, ensuring simplicity and ease of use for managing video sections.
Interestingly, I also developed a user script that extracts chapters from YouTube videos in the same JSON format used in this feature. This ensures consistency and makes the schema practical for users who may already be familiar with it or who want to manage video chapters across different platforms.
You can check out this user script and test its functionality here: YouTube Chapters to JSON.
I hope this adds value to the feature and provides additional context for its utility!
Looking forward to your thoughts.
Also I’m working on a new feature to add bookmarks that can be exported in the same JSON schema for easy import or sharing.
@anilbeesetti I’m also working on streaming YouTube videos directly within the player to leverage its features and integrate them with the sections functionality. I’m exploring ways to automate this process so the JSON file won’t need to be imported manually.
https://github.com/user-attachments/assets/242313a9-1766-4e1f-86f1-be3ff2fcd444
I’ve attached a video demonstrating the progress so far.
Hey @mazen-salah, this looks very interesting! I’m looking forward to seeing it completed. Just a heads-up: I’m currently working on migrating the player UI from XML to Jetpack Compose, so please avoid making any significant UI changes for now.
Hi @anilbeesetti,
I’ve finished the current section feature, so feel free to test and merge this pull request. The YouTube streaming feature is already being developed in a separate branch, so this pull request can be considered completed. I will be opening the YouTube feature pull request soon.
@anilbeesetti,
Just to update you, the YouTube streaming feature has already been written using Jetpack Compose. I’ll be opening the pull request for that soon as well.
Let me know if you need any further details!
Do the "Sections" [0:08 in the video] actually respect the theme ?, because it looks like that dialog is always in white, despite the player/app being in dark theme...
Hey @drogga, thank you for making me notice.
Hi can I get a apk of this nextplayer