You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
On tv app is subtitles is too small
because the setting for the string attribute is not applied
Describe the solution you'd like
Need update SubtitlePart.text to NSMutableAttributedString
Create propery var textAttribute: [NSAttributedString.Key : Any] = [:] in VideoPlayerView
in method ``updateSrt()configure textAttributetextAttribute = [.font: SubtitleModel.textFont]```
and then update patrs:
if srtControl.subtitle(currentTime: currentTime) {
if let part = srtControl.parts.first {
subtitleBackView.image = part.image
if let lenght = part.text?.length {
part.text?.addAttributes(textAttribute,
range: NSRange(location: 0,
length: lenght))
}
subtitleLabel.attributedText = part.text
subtitleBackView.isHidden = false
} else {
subtitleBackView.image = nil
subtitleLabel.attributedText = nil
subtitleBackView.isHidden = true
}
}
Additional context
and need update SubtitleModel.Size for tvOS:
public enum Size {
case smaller
case standard
case large
public var rawValue: CGFloat {
switch self {
case .smaller:
#if os(tvOS)
return 48
#elseif os(macOS)
return 20
#else
return 12
#endif
case .standard:
#if os(tvOS)
return 58
#elseif os(macOS)
return 26
#else
return 16
#endif
case .large:
#if os(tvOS)
return 68
#elseif os(macOS)
return 32
#else
return 20
#endif
}
}
}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
On tv app is subtitles is too small
because the setting for the string attribute is not applied
Describe the solution you'd like
Need update
SubtitlePart.text
to NSMutableAttributedStringCreate propery
var textAttribute: [NSAttributedString.Key : Any] = [:]
in VideoPlayerViewin method ``updateSrt()
configure textAttribute
textAttribute = [.font: SubtitleModel.textFont]```and then update patrs:
Additional context
and need update SubtitleModel.Size for tvOS:
The text was updated successfully, but these errors were encountered: