Greasy Fork is available in English.

YouTube Player Controls

Adds features to YouTube player page: fill window with video, stretch, float video, set HD 4K 8K resolution, hide annotations and ads, click skip ads, click show more, loop, replay a video segment, pause at start/end, zoom and pan video.

< 腳本YouTube Player Controls的回應

評論:正評 - 腳本一切正常

§
發表於:2018-06-29

Theatre mode got broken

Hi again,

YouTube has recently made an update and changed the title attribute of theatre mode button. So Fill Window feature stopped working.

If you could just replace this function:

function setTheaterMode() {
    var thnode = docsearch("//*[@class='ytp-chrome-controls']//*[@title='Theater mode']").snapshotItem(0);
    if (thnode) simulClick(thnode);
}

with this function:

function setTheaterMode() {
    var thnode = docsearch("//*[@class='ytp-chrome-controls']//*[@title='Cinema mode']").snapshotItem(0);
    if (thnode) simulClick(thnode);
}

that would be great. And I was thinking maybe you could also set up a Github repo for the script so others and I can send you pull requests when the script isn't working?

Costas作者
§
發表於:2018-06-29

Hi, I cannot observe this problem. However, I changed the line to include both cases. I hope it works now in your browser.

I will check the Github option and probably move the project there.

Thank you for your comments and suggestions for fixing the problems!

§
發表於:2018-06-29

When you said that you could not see the changes, my first thought was that maybe they had released a new update only for the UK region as I live there. Then, I remembered that I had recently changed language settings for YouTube from English (US) to English (UK). And I thought that maybe it was the cause of the issue. So, I changed the language setting back to English (US) again just to see if the title property would change accordingly. Oddly enough, it did.

Long story short: the title property seems to be dependant on the interface language. It is Cinema mode for English (UK), Theater mode for English (US), Sinema modu for Turkish, and it varies for every other language.

In other words, your latest changes to script has solved the problem for British and American users but because of the way how title property works, you should keep it mind that it will not work properly for people who use different UI languages other than English.

Thanks for the swift reply and update though. Keep up the good work. Cheers,

Costas作者
§
發表於:2018-06-30

Such a good observation! I didn't think about this before, I just assumed everyone was using US English...

I have a universal solution, I will test it for a couple of days and then post it. It first checks whether the page is already in theater mode before searching for the resize button (without using the @title attribute).

Thanks again for this!

發表回覆

登入以回復