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

Feat: Video Chapter Management #1146

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

mazen-salah
Copy link

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

  1. Screenshot 1
  2. Screenshot 2

This feature simplifies workflow and ensures consistency in video section management for users.

@mazen-salah mazen-salah changed the title Add Feature to Import JSON File for Video Section Management Feat: Add Feature to Import JSON File for Video Section Management Dec 4, 2024
@mazen-salah mazen-salah changed the title Feat: Add Feature to Import JSON File for Video Section Management Feat: Video Chapter Management Dec 4, 2024
@anilbeesetti
Copy link
Owner

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?

@mazen-salah
Copy link
Author

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.

@mazen-salah
Copy link
Author

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.

@mazen-salah
Copy link
Author

Screenshot 2024-12-08 at 7 34 18 AM Screenshot 2024-12-08 at 7 34 55 AM Screenshot 2024-12-08 at 7 36 13 AM

@mazen-salah
Copy link
Author

@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.

Screen_Recording_20241208_075716_Video.Player_1.mp4

I’ve attached a video demonstrating the progress so far.

@anilbeesetti
Copy link
Owner

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.

@mazen-salah
Copy link
Author

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.

@mazen-salah
Copy link
Author

@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!

@drogga
Copy link

drogga commented Dec 8, 2024

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...

@mazen-salah
Copy link
Author

Hey @drogga, thank you for making me notice.

Screenshot_20241208_121740_Next Player Debug.jpg

Screenshot_20241208_121755_Next Player Debug.jpg

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.

3 participants