Jump to content


Photo

Spoilers on YouTube videos


  • Please log in to reply
4 replies to this topic

#1 DarkNemesis

DarkNemesis

    Keeper of the Threads

  • Members
  • PipPipPipPipPip
  • 14,860 posts

Posted 16 December 2015 - 03:39 PM

DISCLAIMER: I am guilty of doing this. So. My bad.


When a thread has multiple YT videos on a page, loading can be a pain. A slow, aching, yet sharp pain. So I was wondering since the forum can already recognize when a link is a YT video, can it also auto-apply a spoiler tag around the link? That way loading stays fast and we can still videos without accidentally killing the page(s).

Is it possible? Is it hard to do? Is it worth it?
  • GintaMan likes this

Kubo's announcement will be his new work will be called Tide; not as strong as bleach but does its trolling in a more colorful fashion! - arcane_chaos

Spoiler

#2 GintaMan

GintaMan

    Rock Star

  • Members
  • PipPipPipPipPip
  • 1,130 posts
  • LocationSniper Island

Posted 16 December 2015 - 04:11 PM

If it's something that helps other people view the pages better, I think it's worth it. I support this.  :kakashi:


"To have a dream is to struggle with reality."

 

Have a taste of my pIMP Slap!

 

tiM4Zrr.gif

 

"The Old Man of the North"

 

http://38.media.tumb...EcNV1r1vglf.gif

 

Chairman Emeritus, OMF Butt Stuff Appreciation Association

Almighty Bishop of the Church of Escanor, Gawd of the Sun


#3 Krizalid

Krizalid

    Member

  • Members
  • PipPipPipPipPip
  • 1,164 posts

Posted 16 December 2015 - 04:14 PM

AFAIK content within spoiler tags is loaded no matter what.


  • ZCOverload likes this

#4 Greg

Greg

    Administrator

  • Administrators
  • 1,722 posts

User's Awards

3   

Posted 16 December 2015 - 04:35 PM

Time permitting I can poke into the best way to do this. Spoilers operate by creating a div with display property of none. The naive way of handling this will load everything within the div anyway- fundamentally, you can think about this as the content is still part of the DOM. However, browsers do perform optimizations with regards to what they load, and you can see speed increases along two different vectors. Some browsers will not load everything, so you get a speedup from a network perspective (if that's the bottleneck). On the other hand, sometimes the bottleneck is at rendering the image/video window, and that is something I believe most modern browsers optimize on- to see this in action, try loading a page with a bunch of images on them while you have tons of tabs open and come back to your image tab a while later after browsing. Chances are it will take a bit to reload the images on the page that aren't in active portion of the screen when you switched tabs. 

 

The correct way to do this would be to modify the way the media tag works so it creates a button and inserts into the page via AJAX. I'm definitely not a webdev so I don't know how feasible this is to do within the structure of IPB. My intuition says that there's probably a good path forward, though.


  • ZCOverload, Défectueux and Chillman like this

#5 DarkNemesis

DarkNemesis

    Keeper of the Threads

  • Members
  • PipPipPipPipPip
  • 14,860 posts

Posted 12 July 2016 - 09:16 AM

Hello. Just wondering if anyone had any time to poke around on this.


Kubo's announcement will be his new work will be called Tide; not as strong as bleach but does its trolling in a more colorful fashion! - arcane_chaos

Spoiler




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users