iandevlin / iandevlin.github.io

GNU Affero General Public License v3.0
228 stars 437 forks source link

Hebrew subtitles #2

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi! first of all, thank you for this awesome player. I've got some issue: when I try to play Hebrew subtitles, It shows only "???" instead of text (for example: "טקסט לדוגמה" - translation from hebrew: "Example Text") I tried to change the page charset to WINDOWS-1255 but still "???" and even tried to convert the hebrew into unicode and then it showed as &#[...];

How can I fix this? can you help me?

Thanks again, this is really awesome! :+1:

iandevlin commented 8 years ago

Hmm, I would have thought that UTF-8 is the way to go, but I admit that I have never tried a language such as Hebrew. I will have a look.

iandevlin commented 8 years ago

I did a quick test, and have a quick example working here: https://iandevlin.com/html5/track/index-hebrew-test.html I saved the VTT file as UTF-8, same with the HTML file. I didn't do anything special.

I would love to add a Hebrew example, if you had the translated text?

ghost commented 8 years ago

I can translate it to hebrew, If that's what you mean (I can send a link to pastebin when i'll finish) It seem to work only if you use Arial font (not with webfonts, and for me arial is really ugly for hebrew - i'm using "alef" instead. for me it worked with windows-1255 charset) and also, you can't add new line in hebrew with vtt, it probably turns second lines into comments for some reason and then not showing it at all, for example if you use: "שורה ראשונה שורה שנייה" (Translation: first line, second line) then it shows only the first line. some web converters just remove the second line and leaving the first one, others encoding hebrew into gibbrish or ascii characters

by the way, please excuse my english because sometimes I have misspellings. feel free to fix me if I wrote something incorrect! p.s. I have to admit that I really try to write it right - I even checked it few times with hebrew-english dictionary (morfix) but if you still found anything incorrect with my spelling please let me know

thank you for answering and again, for this really great thing that you've made! =]

ghost commented 8 years ago

Hi, I've translated it (you can find it here / raw ("test" in hebrew is actually "בדיקה" but you can also say it as "ניסיון" like "try" - trying to see if it works, there's not much difference and hebrew speakers/readers will understand but you can change it to "בדיקה" if you want to. i usually write "ניסיון" instead of "בדיקה" - never really used it, but it's just me)) (note: If you'll try to convert it with this converter you'll get latin ascii characters instead of hebrew, if you'll try with this one some lines will be removed automatically) feel free to download it, change it, do whatever you want =] and if you will find any solution for the second line issue (line break issue) please let me know!

and, if you want to learn how to say those words I wrote in hebrew so, read it like this: בדיקה = bdika ניסיון = nisayon שורה = shura(h) ראשונה = rishona שניה\שנייה = shniya (ל)דוגמה = (Le)dugma

the (Le) \ (ל) is in brackets because its optional, you can say דוגמה = example or לדוגמה = for example

טקסט sounds exactly like text

iandevlin commented 8 years ago

Ok cool, thanks. I will have a look at it when I have a moment. I can imagine that the font does have some issues, I don't know the alef font, but I assume it is specifically for Hebrew? I have not looked into how WebVTT works with fonts, so that is something interesting. I have no idea why the line breaks are not working, that is also weird! I sense that I will be testing all this and writing an article!

Oh and your English is excellent, so please do not worry about that! :D

ghost commented 8 years ago

yes this font is specifically for hebrew, but there is also english letters. I tried to use this font through css (::cue - font-family after embedding @font-face), but it didn't work, when I changed it to "Arial" then it worked about the line breaks - for some reason when there is only one break in the file it ruins the entire file and not showing captions at all

thank you again! =]

iandevlin commented 8 years ago

I suspect the line break in Hebrew might be adding some weird invalid character or something. Yes, it doesn't surprise me that a font-face font wouldn't work with subtitles. I am not sure they implemented that, but it's a good question nonetheless and something to test.

iandevlin commented 8 years ago

Hmm, what browser are you having difficulties in? I have just tried it with the Alef font (from Google fonts) and it works fine in Chrome. Line breaks are also not a problem. Strange.

ghost commented 8 years ago

Firefox can you show me what you do to make it work? maybe I did something wrong / changed something

thank you

iandevlin commented 8 years ago

Will do, when I am at home.

ghost commented 8 years ago

Okay thank you again! =]

iandevlin commented 8 years ago

Apologies for the delay. It is online at https://iandevlin.com/html5/track/hebrew/. But, Firefox ignores the Google Font, as it ignores the ::cue selector I believe, but it does display in Arial.

ghost commented 8 years ago

Hi! it's alright you don't need to apologize - everything is fine. I really appreciate this, thank you very much! I didn't knew that the ::cue selector should be in the vtt. I tried it through the css file. I didn't knew also that it works in chrome better than in firefox. I'll try to do it as you did, I'll update here how it goes.

iandevlin commented 8 years ago

Apparently the styles can also be in the VTT file so I was trying both in case one worked in Firefox, but neither do sadly.

ghost commented 8 years ago

I was wrong, I didn't encoded the file to UTF-8 and also forgot to replace the comma in the time milliseconds to period. anyway you've helped a lot, thank you so much! =]

iandevlin commented 8 years ago

No worries, happy to help! I would be interested to see what you are using it for!

ghost commented 8 years ago

I am actually using it to learn HTML5 and CSS3 (change stuff here and there to learn some basics or advanced things) and now I wanted to learn how can I make my own media player and I found yours in this mozilla website and I really loved it and it helps me learn how to use video tag for example (and the thing with the vtt that is really new to me cause I haven't learn about it before this)

It's currently on localhost because I don't have any website but if I will ever have one I'll share with you (and with the internet) the things I have learned including the web media player so you will be able to see it (I will also credit you and mozilla and thank you). but right now it's just for learning only and I don't think I will ever make my own site, maybe blog or something, I'll need an idea for that lol

again, thanks! =]

iandevlin commented 8 years ago

Ah cool, glad to hear it. Well I wish you all the best, and if you have any questions you feel like asking, feel free to email me at ian@iandevlin.com

Good luck with it all!

Ian Devlin iandevlin.com http://www.iandevlin.com @iandevlin http://www.twitter.com/iandevlin

skype: idevlin

On 10 June 2016 at 18:17, natanelg97 notifications@github.com wrote:

I am actually using it to learn HTML5 and CSS3 (change stuff here and there to learn some basics or advanced things) and now I wanted to learn how can I make my own media player and I found yours in this mozilla website and I really loved it and it helps me learn how to use video tag for example

It's currently on localhost because I don't have any website but if I will ever have one I'll share with you (and with the internet) the things I have learned including the web media player so you will be able to see it (I will also credit you and thank you). but right now it's just for learning only and I don't think I will ever make my own site, maybe blog or something, I'll need an idea for that lol

again, thanks! =]

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/iandevlin/iandevlin.github.io/issues/2#issuecomment-225227749, or mute the thread https://github.com/notifications/unsubscribe/AAh1VuoT31S6Q8pYXr22BN7cQQdNreVgks5qKY4ZgaJpZM4IuVEB .