-
Notifications
You must be signed in to change notification settings - Fork 65
feat: Add Title and Summary to video overlay of playing video #512
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -400,6 +400,14 @@ class ExoplayerVideoActivity : | |
| } | ||
| } | ||
|
|
||
| override fun setVideoInfo(title: String?, summary: String?) { | ||
| val videoTitle = playerView.findViewById<TextView>(R.id.video_title) | ||
| val videoSummary = playerView.findViewById<TextView>(R.id.video_summary) | ||
|
|
||
| videoTitle?.text = title | ||
| videoSummary?.text = summary | ||
| } | ||
|
Comment on lines
+403
to
+409
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Replace This Activity should avoid direct ♻️ Suggested change (within this method)- val videoTitle = playerView.findViewById<TextView>(R.id.video_title)
- val videoSummary = playerView.findViewById<TextView>(R.id.video_summary)
-
- videoTitle?.text = title
- videoSummary?.text = summary
+ val controlsBinding = ExoPlayerControlViewBinding.bind(
+ playerView.findViewById(R.id.exo_controller)
+ )
+ controlsBinding.videoTitle.text = title
+ controlsBinding.videoSummary.text = summary🤖 Prompt for AI Agents |
||
|
|
||
| class SubtitleTrackNameProvider(val resources: Resources) : TrackNameProvider { | ||
| override fun getTrackName(format: Format): String { | ||
| val lang = format.language | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,13 +190,17 @@ class ExoplayerPresenterTest : InjectingTest() { | |
| videoContentInfo.videoCodec = "h264" | ||
| videoContentInfo.audioCodec = "ac3" | ||
| videoContentInfo.directPlayUrl = "http://direct.url" | ||
| videoContentInfo.seriesTitle = null | ||
| videoContentInfo.setTitle("Title") | ||
| videoContentInfo.setSummary("Summary") | ||
| presenter.video = videoContentInfo | ||
|
|
||
| every { presenter.isDirectPlaySupportedForContainer(any()) } returns false | ||
| every { mockSerenityClient.createTranscodeUrl(any(), any()) } returns "http://transcode.url" | ||
|
|
||
| presenter.playVideo() | ||
|
|
||
| verify { mockView.setVideoInfo("Title", "Summary") } | ||
| verify { mockView.updateSerenityDebugInfo(true, "h264", "ac3", 0) } | ||
| verify { mockView.initializePlayer("http://transcode.url", 0) } | ||
|
Comment on lines
+193
to
205
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add coverage for the series-title formatting branch. Current tests only cover 🤖 Prompt for AI Agents |
||
| } | ||
|
|
@@ -207,12 +211,15 @@ class ExoplayerPresenterTest : InjectingTest() { | |
| videoContentInfo.videoCodec = "h264" | ||
| videoContentInfo.audioCodec = "ac3" | ||
| videoContentInfo.directPlayUrl = "http://direct.url" | ||
| videoContentInfo.setTitle("Title") | ||
| videoContentInfo.setSummary("Summary") | ||
| presenter.video = videoContentInfo | ||
|
|
||
| every { presenter.isDirectPlaySupportedForContainer(any()) } returns true | ||
|
|
||
| presenter.playVideo() | ||
|
|
||
| verify { mockView.setVideoInfo("Title", "Summary") } | ||
| verify { mockView.updateSerenityDebugInfo(false, "h264", "ac3", 0) } | ||
| verify { mockView.initializePlayer("http://direct.url", 0) } | ||
| } | ||
|
|
||
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.
Avoid displaying literal
"null"or stray newline in the title.If
video.getTitle()is null (or blank), the current interpolation can render"null"or an empty line. Consider normalizing title/series values before building the display string.🔧 Suggested fix
🤖 Prompt for AI Agents