FYTE /Fast YouTube Embedded/ Player

Hugely improves load speed of pages with lots of embedded Youtube videos by instantly showing clickable and immediately accessible placeholders, then the thumbnails are loaded in background. Optionally a fast simple HTML5 direct playback (720p max) can be selected if available for the video.

< 腳本FYTE /Fast YouTube Embedded/ Player的回應

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

§
發表於:2020-04-21
編輯:2020-04-21

YTOHP compatibility?

I've been using invidio.us redirects forever to play directly, but the service has sharply declined in reliability. I have a customized sideloaded install of YTOHP, and since I've been going back to using FYTE, it'd be cool if it could facilitate the googlevideo redirects, whether utilizing the iframe or replacing it, wouldn't really matter. Otherwise, my lazy ass is gonna have to figure it out myself.

woxxom作者
§
發表於:2020-04-21

I don't understand what kind of compatibility is needed so maybe you could provide a step-by-step instruction?

§
發表於:2020-04-21

I'd mostly just like it to handle the redirects from YT to native googlevideo players. Whether that's inside the iframe, or it replaces the iframe, doesn't really matter. As many of the cool FYTE features that could work with it would be added bonuses.

woxxom作者
§
發表於:2020-04-21
編輯:2020-04-21

I still don't understand. Can you make a demo page on jsfiddle.net or a similar site?

P.S. If you want this script to run inside the iframe shown by that extension, it's not what this script is for (the script's purpose is to show placeholders instead of iframes to make the main page load faster).

§
發表於:2020-04-21

If I knew how to do what I'm asking enough to make a fiddle, I wouldn't be bugging you. =)

YTOHP inserts a YT embed iframe when YT links are hovered. FYTE ignores these iframes for whatever reason, perhaps their location? I'd just like it to replace the player in these iframes the same as it does elsewhere.

woxxom作者
§
發表於:2020-04-21

Ah. I understand now. Apparently the iframe is ignored because it doesn't have src when it's appended to the document.

Let me see what I can do...

§
發表於:2020-04-21

Sweet, thanks for looking into it!

woxxom作者
§
發表於:2020-04-21

Turns out that extension is excluded explicitly, probably because the interaction is buggy? Remove , .ihvyoutube in the script code and see if it works for you.

woxxom作者
§
發表於:2020-04-21
編輯:2020-04-21

Maybe you can copy the stream extraction logic from this script (or another one) into that extension. It's just one request to https://www.youtube.com/get_video_info service and a relatively simple parser for the response.

§
發表於:2020-04-21

@wOxxOm said: Remove , .ihvyoutube in the script code and see if it works for you.

Yeah, it's also fixed, so I had to switch it to:

  if (!np ||
      !np.parentNode ||
      skipCustom && srcFixed.indexOf('enablejsapi=1') > 0 ||
      srcFixed.indexOf('/embed/videoseries') > 0 ||
      node.matches('.instant-youtube-embed, .YTLT-embed') ||
      node.style.position === 'fixed' && !node.matches('.ihvyoutube') ||
      node.onload // skip some retarded loaders
  )

It replaces the iframe with a player alright, but there's sizing issues, and the click handler to remove the iframe doesn't work, since it no longer exists.

I'd rather not try to recreate all the FYTE features separately. These do seem like fixable issues. It'd be way better if it executed inside the iframe.

If it's a big ask for an edge case, I get it if you don't wanna bother. I figured it might be a simple tweak. At least I have a better starting point, if I do have to try to fix it myself.

woxxom作者
§
發表於:2020-04-21
§
發表於:2020-04-21

Had to add node.style.position === 'fixed' && !node.matches('.ihvyoutube'), but yeah, that fixes sizing. Still needs a click handler to remove.

woxxom作者
§
發表於:2020-04-21
編輯:2020-04-21

Click handler sounds like something that should be done in the extension.

§
發表於:2020-04-21

You check node.style.position === 'fixed' already, which it is, optionally. It will be ignored without adding that. Click handler could easily be amended locally, but if you're shooting for compatibility, not so much.

woxxom作者
§
發表於:2020-04-21

I guess I won't be adding this feature after all because it looks like you're the only one who wants it. Ideally, this option should be added in the extension.

§
發表於:2020-04-21

Cool. If you're not gonna include compatibility in the actual script, you've set me up real nice to get this working for personal use, so much appreciated. =)

woxxom作者
§
發表於:2020-04-22
編輯:2020-04-22

Added an option to use the native player in https://github.com/tophf/yt-hover

發表回覆

登入以回復

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址