Greasy Fork is available in English.

Youtube UI Fix

Moves the controls under the video and makes the UI look like it was before august 2015

< 腳本Youtube UI Fix的回應

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

§
發表於:2015-08-09

problems

Hi,
Thank you for this script that works well, and perfectly replaces the player to recover the features of the old player. However, i found a problem. The script don't works with a video (embed) on an external website.

I found a similar script that works well on youtube and on external website but only for the progress bar and not for the timer. You can be just inspire you to correct the problem ?
https://greasyfork.org/en/scripts/11486-youtube-progressbar-updater


Also, would it be possible to add height on the iframe tag outside of youtube website to get the full sized video ?

I found this but I do not know if it help you?
https://css-tricks.com/fluid-width-youtube-videos/

thanks if you can update :)

Roy192作者
§
發表於:2015-08-09

The big problem is that the controls didn't update, right? That's fixed, I only had to change the way how the video element was obtained. Previously I did that with an id, because normally it's always movie_player, but not in embedded videos.

For the size, I don't think I can do anything about that. The inside of the iframe cannot do stuff with the outside (for security reasons). So I can't do anything on the (inside) youtube side.

§
發表於:2015-08-09

Looking at your code, that's what I thought. I then tried to change the "getElementById" with "getElementByClassName" then "movie_player" with "html5-video-player" but that did not function. Normal, I do not know nothing in Javascript ^^

§
發表於:2015-08-09

I just saw that you have updated your code and you have solved the problem of videos "embed" ! Yiiiihaaa! you are my hero !

Roy192作者
§
發表於:2015-08-09
Looking at your code, that's what I thought. I then tried to change the "getElementById" with "getElementByClassName" then "movie_player" with "html5-video-player" but that did not function. Normal, I do not know nothing in Javascript ^^

I also make that mistake from time to time. You forgot the s in "getElementsByClassName". Because there can be more elements that have a certain class, you'll get an array back with those elements, and not just one element. At first I used document.getElementsByClassName("html5-video-player")[0], but document.querySelector(".html5-video-player") is a bit cleaner.

§
發表於:2015-08-09

Mmm ok,

For the full size in "embed", do you think it is possible to make another script to all the domains and that would be able to detect an "iframe" which contains the domain scr *: //www.youtube.com/* and give a style with it a height of 100% + 35px ?

Since I know nothing about javascript, I do not know if it's possible, it's just an idea

Roy192作者
§
發表於:2015-08-09
編輯:2015-08-09

I can make a script that runs for all the domains, but one that works for all of them? There are a lot of websites on the internet, and creating a script that works for all of them, would be weeks of work (if not an eternity).

I've tried to do it for one website just now (tumblr), and that already seems like a huge amount of work. It's not always: take the height, add 35, set edited height, and done. On the dashboard I already saw an embedded video that was an iframe inside another iframe, completely different from what youtube shows when you go to share > embed. And who knows what people will do on their own blog.

Then there's the problem of endless scrolling, where the next posts get added through javascript, and if my script would only run once at the start, then those new posts are not checked for embedded videos.

§
發表於:2015-08-09

Oh, I thought it was possible to create a script that is active on all websites (without a domain specified).
I thought it was better to change the height of an iframe because this is the first tag (source) to embed video. If the iframe already has a specified height, it is of course not possible to change the size of other elements in the iframe to add control bar.

But all this seems complicated to implement. So i stop bothering you with my ideas. It's already nicely that you did. Thank you for your work.

發表回覆

登入以回復