-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Change subtitle renderer from Roku embedded to a custom task #982
Conversation
Crude subtitle renderer piggybacking on the JFVideo component
|
We should honor a user's closed captioning styles as set in the Roku global captionStyle: https://developer.roku.com/docs/references/scenegraph/media-playback-nodes/video.md#closed-caption-fields |
We can't include the font files, just 1 of them is larger than our max allowed app size. But, the API does provide us a method to transfer fonts from the server over to the client and store them in a temp folder. https://api.jellyfin.org/#tag/Subtitle/operation/GetFallbackFont |
That's all my notes for the first pass. Very cool enhancement! |
JFVideo updates playerState for captionTask Moved pkg:/fonts to pkg:/components/fonts
This is great! I had considered downloading it from the web on boot but this would be more bandwidth friendly |
This comment was marked as resolved.
This comment was marked as resolved.
Is it possible to change the position of the labels? If so, it would be nice to eventually extend this for full ssa/ass support as well. |
Ya it shouldn't be too hard. As it is, jellyfin server seems to convert SRT
to VTT before sending it to client. I'm not sure if that's the case for ASS
as well
…On Fri, 27 Jan 2023, 14:49 Austin Crandall, ***@***.***> wrote:
Is it possible to change the position of the labels? If so, it would be
nice to eventually extend this for full ssa/ass support as well.
—
Reply to this email directly, view it on GitHub
<#982 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM7RJUET7YCL2MJ5VNOQVA3WUQRFBANCNFSM6AAAAAAUIDPQPE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
We stan! |
The project should validate now
Now it downloads from the fallback folder if available. Defaults to LargeBoldSystemFont. Subtitles are displayed with an outline instead of a background rectangle TODO : take captionstyle into account
I selected a movie and within Roku settings enabled subtitles. It turned on the original subtitles, not the new ones. |
We should clear the displayed subtitle when the track changes. When I changed tracks it kept the original one until it updated several seconds later. |
Disable Roku subtitles on subtitle load Subtitles are cleared as soon as subtitle track changes
Subtitle now follows Roku config Subtitle now updates immediately when changing languages
The subtitles should clear instantly now. Subtitle visibility will now follow Roku's settings and will not overlap i.e. if Roku settings is always on, it will be always on |
Merge! Merge! Merge! |
Do you mind changing the name of your feature branch? It's causing git to act very funky due to your feature branch also being named unstable. |
Play movie, subtitles showing Console error: After several seconds, subtitles show |
If you click on a movie you've already watched part of and from the resume popup select |
Perhaps we can implement both : window settings for the rectangle and background settings for the outline (or vice versa) |
I suppose it's worth a shot, but at least on my Roku, that text outline looks bad. |
Hm in that case we can hold back on the outlines until a solution is found
… I suppose it's worth a shot, but at least on my Roku, that text outline
looks bad.
—
Reply to this email directly, view it on GitHub
<#982 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM7RJUELHYVSRQ3PSKZHG7TWWQJDVANCNFSM6AAAAAAUIDPQPE>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Remove text outline Add background rectangle
We are using background rectangles instead of outlines now. They can be adjusted with Background/* settings |
Is the expectation for this PR that this only work for external subtitle files, or should this work for subtitles that are part of the video file as well? I ask because it works for my videos with external files, but the files with encoded subtitles get the "old" build-in subtitle render that don't support the CJK font. |
The intent was to make it for external files only but we can probably handle encoded ones in a separate PR later! |
Excellent. Cuts my testing in half! I hope to have functional testing completed tonight and will do a code review pass after that. |
Functionality works great! Here are some updates we need to make for users.
|
components/JFVideo.brs
Outdated
|
||
sub toggleCaption() | ||
m.captionTask.playerState = m.top.state + m.top.globalCaptionMode | ||
if m.top.globalCaptionMode = "On" |
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.
if m.top.globalCaptionMode = "On" | |
if LCase(m.top.globalCaptionMode) = "on" |
String comparisons should always force a case.
components/JFVideo.brs
Outdated
end sub | ||
|
||
sub updateCaption () | ||
while m.captionGroup.removeChildIndex(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.
Instead of using a while loop to remove all the children, could we use the removechildrenindex function?
m.captionGroup.removeChildrenIndex(m.captionGroup.getChildCount(), 0)
components/JFVideo.brs
Outdated
if m.top.content.contenttype <> 4 | ||
m.top.unobserveField("position") | ||
end if | ||
' if m.top.content.contenttype <> 4 |
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.
Commented out code should just be removed
components/JFVideo.brs
Outdated
m.showNextEpisodeButtonAnimation.control = "start" | ||
m.nextEpisodeButton.setFocus(true) | ||
m.nextEpisodeButton.visible = true | ||
if m.top.content.contenttype = 4 |
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.
Instead of nesting this clause, let's just escape early.
At the top of showNextEpisodeButton() do if m.top.content.contenttype <> 4 then return
components/JFVideo.brs
Outdated
updateCount() | ||
return | ||
end if | ||
if m.top.content.contenttype = 4 |
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.
Same as above. Let's exit early.
if m.top.content.contenttype <> 4 then return
components/captionTask.brs
Outdated
end if | ||
end sub | ||
|
||
function newlabel(txt): |
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.
function newlabel(txt): | |
function newlabel(txt) |
components/captionTask.brs
Outdated
|
||
sub updateCaption () | ||
m.top.currentCaption = [] | ||
if m.top.playerState = "playingOn" |
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.
if m.top.playerState = "playingOn" | |
if LCase(m.top.playerState) = "playingon" |
String comparisons should force case
components/captionTask.brs
Outdated
lines = newLayoutGroup(labels) | ||
rect = newRect(lines) | ||
m.top.currentCaption = [rect, lines] | ||
else if right(m.top.playerState, 4) = "Wait" |
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.
else if right(m.top.playerState, 4) = "Wait" | |
else if LCase(right(m.top.playerState, 4)) = "wait" |
source/utils/Subtitles.brs
Outdated
@@ -87,6 +86,8 @@ function setupSubtitle(video, subtitles, subtitle_idx = -1) as integer | |||
|
|||
if selectedSubtitle.IsEncoded | |||
' With encoded subtitles, turn off captions | |||
?"Check2" |
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.
Debug code
source/utils/Subtitles.brs
Outdated
@@ -177,6 +178,7 @@ sub turnoffSubtitles() | |||
video = m.scene.focusedChild.focusedChild | |||
current = video.SelectedSubtitle | |||
video.SelectedSubtitle = -1 | |||
?"Check3" |
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.
Debug code
Custom subtitles can be enabled via * > Settings > Playback > Use Custom Subtitles Fallback font downloaded only if it is enabled in system settings Cleaned up various code
This and all of the change requests should be fixed now. Hope there aren't new bugs! |
@jkim2492 Double check the translations file. Github shows the entire file as modified. 42d3e5d#diff-0c39691ce17a12d65440b15c63dc5f7c12b526d1a105e0c99f568a5e9c2313bc |
Added en-US translations for custom subtitle option
@1hitsong Seems the line endings had changed for some reason. It should correctly show diffs now |
@jkim2492 Approved. Can you resolve the merge conflicts? |
@1hitsong Yup it should be good now |
Merged. For the follow up, please use a different name for the branch 😉 |
As a follow up simple ass support is implemented in #1075 |
Changes
Add an option to disable Roku's global captions and use custom captions renderer for CJK fonts
Issues
Related to issue #514