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: Add Subtitle Support for Native Player in Fullscreen Mode #64

Open
wants to merge 11 commits into
base: 2U/develop
Choose a base branch
from

Conversation

HamzaIsrar12
Copy link

Description

  • Added CC (Closed Caption) button in fullscreen mode for subtitle control in the native player
  • Subtitle selection persists across orientation changes
  • Subtitles are downloaded and removed in sync with videos
  • Subtitles available for offline playback
  • Different languages supported for subtitles inside and outside the player

Technical Changes:

  • Updated database with migration for subtitle data. Test app by updating from a previous version with downloaded videos to ensure smooth migration.

Comment on lines 71 to +76
if (viewModel.isPlaying == null) {
viewModel.isPlaying = requireArguments().getBoolean(ARG_IS_PLAYING)
}
viewModel.transcripts = stringToObject<Map<String, String>>(
requireArguments().getString(ARG_TRANSCRIPTS, "")
) ?: emptyMap()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As parameters are parsing from the bundle, better to move in the constructor. (Optional improvement)

Comment on lines +29 to +33
val transcriptUrls: String,
@ColumnInfo("transcriptPaths")
val transcriptPaths: String,
@ColumnInfo("transcriptDownloadedStatus")
val transcriptDownloadedStatus: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transcriptPaths stores the downloaded transcript's local storage path right?

IMO, we can store Empty_String | null in the transcriptPaths to check whether the transcripts have been downloaded.

Comment on lines +29 to +31
val transcriptUrls: String,
@ColumnInfo("transcriptPaths")
val transcriptPaths: String,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to perform the stress testing on these Columns.

downloadDao.updateDownloadModel(
DownloadModelEntity.createFrom(
downloadTask.copy(
transcriptDownloadedStatus = TranscriptsDownloadedState.DOWNLOADED
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usecase to mark the Transcripts downloaded when transcriptUrls list is empty.

@@ -32,7 +32,7 @@ ext {
fragment_version = "1.6.2"
constraintlayout_version = "2.1.4"
viewpager2_version = "1.0.0"
media3_version = "1.1.1"
media3_version = "1.4.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use-case to update the library version?

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