chinese-words-separator / chinese-words-separator.github.io

5 stars 1 forks source link

not working on full screen mode #1

Closed chinesefaker closed 1 year ago

chinesefaker commented 1 year ago

Hello,

Its working correctly but when it comes to full screen mode on google chrome and that I want to watch a serie on website like Qiyi its not working because its full screen and like the plug in is not detected So I can only watch it on little screen if i want to check the dictionnary ( its only for the dictionnary , the colors and pinyin are fine ) how to solve it?

thanks

chinese-words-separator commented 1 year ago

That's the problem I'm still figuring out how to solve. It seems that some video sites design their video to be on the topmost layer when in fullscreen mode, hence CWS is not able to surface the pop-up dictionary on top of the video

chinesefaker commented 1 year ago

After trying a lot of chinese dictionnaries extensions, I know that the dictionnary check on full screen mode is working on the Yomichan extension (and the chinese version of it https://gist.github.com/shoui520/25460fd2e9fb194d3e5152fa2ce42ca2 ) if you want to look at the code maybe, but I'm still using your extension as I found the colors very useful , despite the fact that sometimes there's a little discordance on the synchronisation (but again it is very unlikely, I think you noticed).
I do really believe that the extension you created got some nice potential. Some good working features already.

chinese-words-separator commented 1 year ago

Thanks @chinesefaker, found a solution here: https://stackoverflow.com/questions/62093104/html-element-over-video-element-also-in-full-screen-mode#comment109847930_62093104

CWS's pop-up dictionary can now be on top of Qiyi's fullscreen video. Just need to put a code to check if the video is in fullscreen mode before attaching the popup dictionary to video's parent instead. Also need to test if it also work on Netflix, YouTube, Viki, WeTV as well, then will deploy afterwards

By the way, aren't you bothered with burned-in subtitles of Qiyi when used with soft subtitles + CWS combo? The burned-in subtitle and soft subtitle tend not to be aligned with each other when the soft subtitle is applied with different hanzi size or when using spacer between words

image

Or are there any Qiyi videos that have no burned-in subtitles? I can't seem to find any

chinesefaker commented 1 year ago

Oh yeah, actually I forgot to mention that using the ''separate with space'' option is not working, I mean it looks the same as the screen you sent. So I just do not use it lol, but I dont really mind of using the space mode anyway. The problem with this feature is that the sentences are extended, so it takes 2 lines like in the screen you sent ( most of the time ) and the colors are discorded.

Regarding the other platforms I did not try it yet but so far I noticed that some movies or series are just incompatible with the dictionnaries and colors as the subtitles are like '' nailed '' on the video.

My settings are like that
image

And 150% font size on Qiyi

Sometimes there is this random thing that shows up under the character, that line image

But this happens not very often I think its due to the garden-path thing right ? If yes then there is no problems

I'm still under the version 8.24.84.411.

By the way is the app compatible with Du Chinese app ?

chinese-words-separator commented 1 year ago

But this happens not very often I think its due to the garden-path thing right ? If yes then there is no problems

Yes it's due to garden-path, it appears when the sequence of characters can be interpreted in another way. CWS doesn't have any sort of AI, so the least that it could do is to make the language learner be aware of the possible different interpretation of the sequence of characters

By the way is the app compatible with Du Chinese app?

CWS is compatible with Du Chinese's desktop website, e.g.,

image

But it's not compatible with Du Chinese app. CWS works in the browser only

If you want to use CWS with Du Chinese, and if Du Chinese's website can be used (some mobile sites refused to operate on mobile and forces the user to download and use their app version instead) on smartphone's browser, on Android you can download Kiwi browser from Google Play store, and then add the CWS Chrome extension in Kiwi. On iPhone/iPad, you can get the CWS Safari extension from Apple App store, the iOS version is paid; I'll be running a promo in the near future and make it free on iOS when Chinese words separator reaches 824 users in Chrome Web Store, it will be free for 8 days and 24 hours by then

chinesefaker commented 1 year ago

Thanks !

A last thing I was wondering as well for now

image

Is there any options to change the color of the background ( the yellow thing where I put the red mark ) as well as the color for the font hanzi ?

Also, noticed that sometimes it takes time to detect the text like 2 or 3 seconds instead of just 20MS.

chinese-words-separator commented 1 year ago

Is there any options to change the color of the background ( the yellow thing where I put the red mark ) as well as the color for the font hanzi ?

No options yet for that as of now. I'm inclined to keep it that way though, I'm striving to use the most intuitive color for the pop-up dictionary, making it resemble a post-it note, not so saturated yellow, not so whitish, so it won't blend with the page the learner is reading. If you really need to customize the color of CWS (or any elements of the page for that matter), you can use Amino CSS editor to customize the page of its color, size, etc

As for the 2 or 3 seconds delay of dictionary, it can happen on text-heavy page, CWS parses the whole page when adding color and pinyin, sometimes it takes a while to do that, after that, the dictionary can then function

Perhaps I'm not experiencing that due to the speed of the machine I'm using

I should regularly test on a machine (Core i3) here that is not very fast

If you need the dictionary to quickly respond upon page load, you can use CWS's tagless dictionary mode. When it is in that mode, CWS will not parse nor observe the page. When CWS is in tagless mode though, it cannot add pinyin under/above the hanzi, it cannot enlarge the hanzi nor put colors on hanzi. When in tagless mode, you can only use CWS's word dictionary functionality and read-aloud functionality; you can also use sentence dictionary with tagless mode, but you have to manually highlight the text, then the highlighted words will be included in the pop-up dictionary

image
chinese-words-separator commented 1 year ago

TL;DR for best iQIYI experience with CWS, use Font edges option other than Default edge or Border edge

Looks like the Default edge (and Border edge too) of iQIYI is not as flexible as other edges options. Hence when changing the size of the hanzi from its original size or when using separate with space, the 'nailed' subtitle (it turns out it is not burned-in, it can be changed by iQIYI programmatically) is not synchronized/aligned with the soft subtitle (the one which CWS uses to put color and/or add pinyin annotation and English annotations). I might file the issue of the default edge and border edge as a bug report to iQIYI. iQIYI's Default edge and Border edge's sizes should be in sync with its soft subtitle

Default edge: image

Convex edge: image

Concave edge: image

Border edge: image

Shadow edge: image

No edge: image

chinese-words-separator commented 1 year ago

Popup dictionary now works on iQIYI even when on fullscreen mode, version 8.24.84.420, uploaded it now to Chrome Web Store, Edge Add-ons Store, and Apple App Store. Most of the time, the update gets approved on next day, except for Microsoft Edge Add-ons which often takes between 5 to 7 days

Use Font edges other than Default/Border (e.g., Convex) so the nailed subtitle (which turns out is used for edge/shadow purposes, not a burned-in subtitle) and the soft subtitle are aligned with each other

image

Hoverless video dictionary is now supported on iQIYI too. Hoverless video dictionary works on non-fullscreen only

image

If you need to turn the English annotations off on iQIYI, you can limit the English letters to zero

image

chinesefaker commented 1 year ago

Great work thank you!

I m still using it and will notify if I see any other problems For now, I noticed something while using the separate mode, like when I change it from full screen to normal screen and vice-versa, the sentence is on one line and then suddenly on two lines.

Also, most of the time the sentences are on two lines it does not fit just one line ( while it could ) which makes it a bit harder or not usual to read

image image

chinesefaker commented 1 year ago

By the way you said that it was also update on the app store but is there any way to use this program from an iPhone on Qiyi?

chinese-words-separator commented 1 year ago

By the way you said that it was also update on the app store but is there any way to use this program from an iPhone on Qiyi?

I tried, iQIYI forces users to use its app version instead if you want to change the subtitle (see screenshot below). CWS need to see the subtitle in order to put colors, annotate pinyin/english, separate the words, and provide dictionary. I hope they could at least provide a way for paid subscribers to use subtitle on their mobile website version, not just made it exclusive to its app version. CWS won't work on iPhone site of iQIYI due to aforementioned design by iQIYI. If they will support subtitles on their mobile website, I will subscribe to them and test CWS on their mobile website and make CWS work on it

image

CWS works on https://m.youtube.com and WeTV's mobile website. CWS works on WeTV mobile website (e.g., https://wetv.vip/zh-cn/play/2knhnaakii18oxj-Falling-Into-Your-Smile/c0039fqtvc0-EP2-Falling-Into-Your-Smile); however, WeTV only shows the first 3 minutes of the series if it is watched on their mobile website instead, I don't know if the limit is lifted if you have paid subscription, or if the full length is available on their app only

image

CWS fully works on YouTube mobile website, it doesn't have the artificial limitations of iQIYI and WeTV

image

image

chinese-words-separator commented 1 year ago

For now, I noticed something while using the separate mode, like when I change it from full screen to normal screen and vice-versa, the sentence is on one line and then suddenly on two lines.

As much as possible, CWS is designed to just minimally change the behavior of the soft subtitle. Perhaps if CWS forcefully stretch the soft subtitle to video's width, iQIYI's nailed subtitle will not be aligned/sync with its soft subtitle anymore. It's possible that it will exhibit the same problem as when Font edges is set to Default/Border if nailed subtitle will not be aligned/sync with its soft subtitle's width

I might try make CWS forcefully set the subtitle's width to video's width on iQIYI, but if it will exhibit problems, I will not pursue it. And also if CWS is made to forcefully set the subtitle's width and if it case it works, it's not guaranteed to work forever; iQIYI might change the behavior of their subtitle later on, and it might break how CWS forcefully set the width

I think we will have more luck if we give feedbacks/suggestions to iQIYI, make them be aware that some browser extensions supports their website, and they should make their subtitles' width be flexible from font size changes

chinese-words-separator commented 1 year ago

Here's a way to give feedback/suggestions to iQIYI's subtitles

image

chinesefaker commented 1 year ago

I can try to send subtitle feedback to them. If you want to do so, as your extension was shared on the discord of the reddit r/ChineseLanguage recently, could ask more people to do so there.

Also, do you consider adding multiple back-end wallpaper colors ? Like having the choice of black or white or yellow without having to change the wallpaper using some other extensions, or will it be problematic for the extension to work correctly ?

image

I'm currently combinate your app with Inkah extension and I think the design looks a bit better, but especially because it is faster while moving the mouse on a word. You can comparate both of them, If you use both extensions at the same time with dictionnary enable ( here I disabled it because it will show two dictionnaries ) the Inkah one will show it faster and ''easier''.

Also, did you recently add the english translation as the screen shows ? How to disabled it ? Because when I have only your extension enable it shows english translation now

I was also wondering when the app is going to be free use trial so that I can try it before buying like on app like Net Ease music ( 网易云音乐 ) especially for the pin yin and the colors ? hope it helps ,

Thanks :)

chinese-words-separator commented 1 year ago

Also, did you recently add the english translation as the screen shows ? How to disabled it ? Because when I have only your extension enable it shows english translation now

Hmm.. I mentioned on one of my replies how to disable the English annotations

If you use both extensions at the same time with dictionnary enable ( here I disabled it because it will show two dictionnaries ) the Inkah one will show it faster and ''easier''.

CWS have two dictionary modes. One is sentence dictionary, the other one is word dictionary

Sentence dictionary is designed to use a little delay as it need to give the language learner ample time to move the mouse inside the pop-up dictionary (in order to be able to use the pop-up dictionary's several functionalities). Otherwise, if you don't give the user ample time to be able to move the mouse cursor inside the dictionary, the user need to develop godly speed when moving the mouse cursor inside the pop-up dictionary as they need to avoid the Chinese characters that don't belong to their currently hovered sentence/phrase. If the user don't have godly speed, the pop-up dictionary will display the definitions of the sentence of the Chinese characters that was accidentally hovered on, giving no chance for the language learner to use the pop-up dictionary's other functionalities (e.g., splitting the word, further lookup, translation) on the sentence/phrase they are interested on

As for the word dictionary, there's no need to use delay since word dictionary does not span multiple lines unlike sentence dictionary. The automatic read-aloud feature (a.k.a. automatic text-to-speech) is the one that is causing some delay on the dictionary. If you don't need read-aloud to be automatic, you can make the dictionary fast by turning off the automatic read-aloud, and just press s (speak) if you need to hear how the word is spoken, or press the speaker icon in the dictionary. Here's the speed difference of the dictionary if it is using automatic read-aloud versus when it is not: https://www.youtube.com/watch?v=CjXygqhXNIE

I was also wondering when the app is going to be free use trial so that I can try it before buying like on app like Net Ease music ( 网易云音乐 ) especially for the pin yin and the colors ?hope it helps

I'll make it free for 8 days and 24 hours (9 days to be exact) once CWS reaches 824 users on Chrome, or perhaps I might make it free as soon as 8-24 (a.k.a. August 24), whichever comes first. Those who got it free during those 9 days period, gets it free forever, no need for them to buy it

Also, do you consider adding multiple back-end wallpaper colors ? Like having the choice of black or white or yellow without having to change the wallpaper using some other extensions, or will it be problematic for the extension to work correctly ?

I will consider this. I like to use dark mode for development, but as a user myself, I want to see some light every once in a while, I'm not obsessed to use dark mode for everything. Anyway, on these coming days (or after I finished the new functionality that's still in development), I'll try to find some Chinese websites in dark mode and see if I can still tolerate CWS dictionary's yellow Post-It Note-like color while reading Chinese text in dark background. That might be able to compel me to create dark mode theme for the pop-up dictionary

Thanks :)

You're welcome :)

chinesefaker commented 1 year ago

Hmm.. I mentioned on one of my replies how to disable the English annotations

Thanks, I had trouble finding it as I do not use the hoverless dico and the ''more tools'' option which is a bit hide. It worked. I have two questions by the way, what means the 月 when you click on the extension ? What are the changes exactly ?

image

And is that normal that those tools are not clickable ?

Screenshot 2022-08-21 174610

I will consider this. I like to use dark mode for development, but as a user myself, I want to see some light every once in a while, I'm not obsessed to use dark mode for everything. Anyway, on these coming days (or after I finished the new functionality that's still in development), I'll try to find some Chinese websites in dark mode and see if I can still tolerate CWS dictionary's yellow Post-It Note-like color while reading Chinese text in dark background. That might be able to compel me to create dark mode theme for the pop-up dictionary

This is what I meant, even if some people do not like it, maybe other people will like the dark theme, maybe other will like a white one, where some will like a blue one. So I was wondering why just not add different colors background if it does not affect the extension speed and correct functionalities ? As long as it is just features and not an obligation Maybe a website that wont fit the yellow will fit the dark or the white mode and vice-versa.

Regarding the speed, I knew it for the audio and I already disabled this option, but the speed is still different, I do not know where does it come from, maybe it is because Inkah extension force the pop-up to always appears on top while sometimes chinese words separator appears in the bottom even in full screen? Or maybe because your pop up have this little bubble that needs to be load , the bubble that redirect you to https://resources.allsetlearning.com/chinese/grammar/ .

Also, it is a very little detail, but the characters are displayed in blue on the pop up as for the pinyin, like it is just the color you used by default, maybe because the blue is easier to read on yellow, the thing is, it would be nice if it would be possible in the future to change this color Main reason is that if you use this very precise tone color for a certain tone , and then you see this blue every time no matters what the tone is or what the character is , it makes confusion as you brain think it corresponds to the second tone. But it is because you use this precise color for tone color. I think it would be great if the color can be displayed in a normal black or white or just make it match the tone color of the user. Again, it is just to make it as options, not obligations In case you did not understand I'm speaking about that image

Last thing I noticed that when Im afk for like an hour and I come back the colors are gone and I need to re open a new page to make it work. It does not matter if I refresh the dico or not I have to refresh google chrome.

chinese-words-separator commented 1 year ago

I have two questions by the way, what means the 月 when you click on the extension ? What are the changes exactly ?

月 will use colors for font that are optimized for dark background, these colors can be found in Dark mode colors section in the Options screen; not having 月, CWS will use colors that are optimized for light background, these colors can be found in Light mode colors section in the Options screen instead. If the page's background color is dark, and the Light mode colors does not mixes well with the dark background, click the CWS icon to set the 月 mode and then CWS will instead apply the Dark mode colors from the Options to the text. CWS does not have a way to detect if a page is using dark mode or light mode, so you have to give CWS a little assist in that regard

Last thing I noticed that when Im afk for like an hour and I come back the colors are gone and I need to re open a new page to make it work. It does not matter if I refresh the dico or not I have to refresh google chrome.

The Chrome extension manifest v3 (which is what CWS is using), is designed by Google not to consume too much memory. So when the extension is idle, it will unload it from memory

and then you see this blue every time no matters what the tone is or what the character is , it makes confusion as you brain think it corresponds to the second tone. But it is because you use this precise color for tone color. I think it would be great if the color can be displayed in a normal black or white or just make it match the tone color of the user.

There was a request from a language learner last June 19, 2021:

"1. Colors in the dictionary popup. It really makes a huge difference having Chinese characters and Pinyin in colors, different from the black color of the English translation."

It was "all black" before, actually the pinyin and Chinese characters are of gray variants because I know if I made it all black, the Chinese characters, and especially the Pinyin and English, will just blend into each other, making the text confusing to read; however, those grays still look all black to him, perhaps different monitors, renders different colors. So I made the Chinese characters and Pinyin in the dictionary have color other than black so they won't blend with the English text, I went for a muted blue (that still look a little like black) for Chinese text, and then bright blue for pinyin so it will not blend with English text. Since then, he does not complain anymore about CWS dictionary color

Another reason for the choice of blue, so that it will look like that it is a link/clickable, so the user will know that it is not just a static text, that there's a functionality on the the color blue text

Hmm.. so for the meantime, while the user-defined dictionary color is not yet supported, think of blue as a link/functionality, so the brain will not be having a hard time reconciling blue as a functionality vs blue as a tone, that blue have other uses besides tones

And is that normal that those tools are not clickable ?

Those tools works in the context of a page, don't click them when the page is blank or if you are in Options screen. When you are in a page that have Chinese content, then select any of those tools. When you click them while the current tab have a blank page or is just in Options page, nothing will happen

Regarding the speed, I knew it for the audio and I already disabled this option, but the speed is still different, I do not know where does it come from

Maybe you can record a video (e.g., via OBS) of the speed of CWS dictionary, then upload it to YouTube. Perhaps a video of its own is enough. I feel it is not an apple-to-apple comparison to compare CWS's speed to other extensions' speed if other extensions can really afford the speed due to them having relatively few functionalities as compared to CWS's

chinesefaker commented 1 year ago

I recorded the video here, first try, just 1 minute or so.
Sometimes you can clearly see that there is a difference between the two.

https://www.youtube.com/watch?v=4noUhlBwHZ8&feature=youtu.be

Make sure to watch the whole video, as it is not very obvious in the beginning but I think that you can clearly see it from the middle to the end. It's about detection and speed and it is not because I have two extensions, If I use both extensions one by one alone it would be the same.

Also, I was wondering, where I can disable the option that automatically stops the video when you click on the word ? That the first time it happens to me

chinese-words-separator commented 1 year ago

It's about detection and speed

CWS's word dictionary have the same speed as Inkah, I can see the performance of both CWS and Inkah on the video you posted; it's just that CWS sometimes have incorrect text detection, and the mouse have to be re-moved by the user in order for the text detection to correctly detect the text, re-moving the mouse gives CWS a sluggish/slow impression. Don't re-move the mouse, the dictionary will not even pop-up, it just means there is really nothing happening nor there is sluggish/slow fetching of dictionary data that is happening currently; it's just that it failed on detecting text, nothing is happening, no slow code is happening

While Chinese words separator's sentence dictionary is built from the grounds-up, CWS's word dictionary relies on the same code as Rikaikun though. Might need to improve or perhaps revamp the code of CWS's word dictionary, CWS's word dictionary should not miss detecting text on mouse move

I created sentence dictionary first for CWS, as it can just leverage the HTML tags that are embedded in CWS's sentence/word separation mechanism

The word dictionary is integrated later, and I don't want it to be dependent on tags, so that when some language learners who are in the expert level already, they can still use CWS dictionary if CWS's dictionary can still work in tag-less mode. So just like most browser dictionaries, CWS's word dictionary uses the same code as Rikaikun, thus inheriting the same text detection flaws of Rikaikun. I will revisit CWS's word dictionary, if correcting the Rikaikun's old code (same code logic since 2010) is not easy, I might rewrite CWS's word dictionary from scratch, I can't make a promise when this will gonna be delivered, there are some other functionalities that I'm still developing for CWS

For the meantime, users who don't want to keep re-moving the mouse when CWS's word dictionary have incorrect text detection on mouse move (causing the dictionary not to pop-up, and have to re-move the mouse to make the dictionary able to detect the text), they can use CWS's sentence dictionary instead

Contrasting word dictionary (via Rikaikun) and sentence dictionary at the same time: https://www.youtube.com/watch?v=4giGeA8q9Jg. You can also see from this video how Rikaikun can't detect text sometimes, while CWS's sentence dictionary can

It's a surprise that more than a decade, this flaw is not corrected. Perhaps some users already get used to re-moving their mouse

Also, I was wondering, where I can disable the option that automatically stops the video when you click on the word ? That the first time it happens to me

That is by design, the dictionary for subtitles does not automatically stop before, it's annoying when the video keeps on playing while you haven't finish reading the definitions yet; with that said, the video is now made to automatically stop when the learner is reading subtitles' definitions. I might make a settings in Option that can enable/disable it though, some can read fast

chinesefaker commented 1 year ago

I see. Well, it is not a speed problem itself indeed, like not in the code but it does affect the speed indirectly as incorrect text detection happens so you have to use time by checking again that is what I meant.

That is by design, the dictionary for subtitles does not automatically stop before, it's annoying when the video keeps on playing while you haven't finish reading the definitions yet; with that said, the video is now made to automatically stop when the learner is reading subtitles' definitions. I might make a settings in Option that can enable/disable it though, some can read fast

Well it makes sense, but it would be great if you make an option enable/disable as sometimes I press on the text without stopping the video, becauce I just need to see one word or one character and I do not need to stop unless they speak very fast.

chinese-words-separator commented 1 year ago

8.24.84.450: FIX: iQIYI, subtitle's width is too narrow, causing the subtitle to become multi-lines. This is fixed now, longer subtitle can now fit in one line FIX: iQIYI, Font Edges of Default and Border are not aligned to actual subtitles. For the meantime, disable the Font Edges of Default and Border while iQIYI is not yet making these two Font Edges be aligned to actual subtitles

8.24.84.440: UPDATE: Added option in automatic video dictionary for enabling/disabling auto-pause FIX: Mouse have to be re-moved sometimes so that CWS can detect the words, this is fixed now; re-moving the mouse is no longer required

8.24.84.420: FIX: iQIYI, pop-up dictionary now works even if the video is in fullscreen mode

chinesefaker commented 1 year ago

Hello !

is the app going to be free any soon ? Im wondering if it will work / detect the text for wechat app?

chinese-words-separator commented 1 year ago

Hello !

is the app going to be free any soon ? Im wondering if it will work / detect the text for wechat app?

Yes it will be free for 9 days once it reaches 824 language learners, decided to just wait for that instead as there are several language learners who have seen that promotion in Chrome web store's page. It might annoy them if they missed the August 24-30 promotion window. Anyway, CWS has 795 users now, it will reach 824 some weeks (or month) from now

Chinese words separator cannot work in apps, Chinese words separator works in the browsers only. It will only work in Wechat if Wechat runs on browser/Safari. However, even if a web software can run on browser, it does not automatically mean Chinese words separator can work on it. Some web software have parts of it that are designed to be isolated from the rest of the page, thus resulting on CWS not being able to work on the isolated Chinese content. But those web softwares that are designed like that are very rare, most web softwares are designed to be open and extensible

Chinese words separator works on Facebook Messenger, i.e., its desktop browser-based version, not the app version. I've yet to test if CWS works on desktop browser-based version of WeChat, and I'm not sure if WeChat let its web software work on mobile browsers, some web softwares insist on downloading their app version if the web software detected that it is running in a phone or tablet