Forum Discussion
5 Replies
- RokuJoelBinge WatcherYou will need to create a custom UI using roScreen (best) or roImageCanvas (less favorable, but possibly easier to create) and include an Arabic True Type Font or Open Type Font.
- Joel - ramakanthVisitorCan we use the arabic true type font with respect to roVideoScreen? our main problem is with respect to subtitles in the video as majority of our users are arabic origin we want to provide them with the arabic subtitles.
As far as i know here is the working example for english subtitles, if i give arabic subtitle .srt file the system doesn't understand the format and display square boxe for each char. can you please guide me with a snippet to achieve the arabic subtitles with respect to .srt file.
video = CreateObject("roVideoScreen")
videoclip = CreateObject("roAssociativeArray")
videoclip.StreamBitrates = bitrates
videoclip.StreamUrls = urls
videoclip.StreamQualities = qualities
videoclip.StreamFormat = streamformat
videoclip.Title = title
print "srt = ";srt
if srt <> invalid and srt <> "" then
videoclip.SubtitleUrl = srt
end if
video.SetContent(videoclip)
video.show()
Thanks,
Ramakanth.G - RokuJoelBinge WatcherI believe you can, using the roCaptionRenderer component, in conjunction with roScreen and roVideoPlayer componenets:
http://sdkdocs.roku.com/display/sdkdoc/roCaptionRenderer
Look at the example on that page where a font is loaded. You should be able to load any TTF or OTF font. I would suggest trying to find font files that are small in file size if possible.
- Joel - ramakanthVisitorHi Joel,
Thanks for guiding me in the right direction. I have used couple of arabic ttf files, right now i am using arial.ttf for testing the arabic subtitles, I am able to render the arabic subtitles for the movie i am streaming which is good news, but it has two major issues.
1. first is as i see the roku firmware is not able to handle the carriage return in arabic subtitle files and it is showing as box please find the attached image over drive for your reference.
https://drive.google.com/file/d/0B9SpvR ... sp=sharing
2. Need to reverse all the text which I am rendering now, arabic people read from right to left, I have raised separate thread for that hopefully you will guide me in proper direction for that. here is the link to that post.
viewtopic.php?f=34&t=88951
here is the link for the screen shots of the carriage return mishandling in subtitles:
https://drive.google.com/file/d/0B9SpvR ... sp=sharing
here is the link for the project which i made for testing the arabic subtitle support.
https://drive.google.com/file/d/0B9SpvR ... sp=sharing
Movie conversation start's after 2 minutes, so please wait until that time to see subtitles, i didn't implement fastforward functionality. will be waiting for the proper approach/solutions for this problems
Thanks,
Ramakanth.G - RokuJoelBinge WatcherFor the carriage return, I would attempt to identify what that character actually is, and replace it with a chr(10) or replace it with a space. See: ifStringOps Others have already discussed the string-reversal issue. If I were you I would do all of that including the string reversal on my server (if possible) and then deliver the content with the strings ordered the way you want them, with the carriage returns replaced or stripped out.
- Joel