Template talk:VideoGallery: Difference between revisions

From Dolphin Emulator Wiki
Jump to navigation Jump to search
No edit summary
Line 27: Line 27:


:I removed the rand calls and cleaned up the loop logic to be faster/easier to read. I did two versions, one which [https://wiki.dolphin-emu.org/index.php?title=Template%3AVideoGallery%2Fsandbox&type=revision&diff=146540&oldid=146436 embeds the first 3 and links the rest] like current behavior (just not randomly), and a version which [https://wiki.dolphin-emu.org/index.php?title=Template%3AVideoGallery%2Fsandbox&type=revision&diff=146545&oldid=146540 embeds them all] like you requested. You can see how it looks embedding a lot of videos [https://wiki.dolphin-emu.org/index.php?title=Template:VideoGallery/sandbox/doc#Regular here]. Loading that page slows my browser down quite a bit even after speeding up the loops, so I don't know if that's such a good idea. - [[User:Xerxes|Xerxes]] ([[User talk:Xerxes|talk]]) 01:03, 17 July 2017 (CEST)
:I removed the rand calls and cleaned up the loop logic to be faster/easier to read. I did two versions, one which [https://wiki.dolphin-emu.org/index.php?title=Template%3AVideoGallery%2Fsandbox&type=revision&diff=146540&oldid=146436 embeds the first 3 and links the rest] like current behavior (just not randomly), and a version which [https://wiki.dolphin-emu.org/index.php?title=Template%3AVideoGallery%2Fsandbox&type=revision&diff=146545&oldid=146540 embeds them all] like you requested. You can see how it looks embedding a lot of videos [https://wiki.dolphin-emu.org/index.php?title=Template:VideoGallery/sandbox/doc#Regular here]. Loading that page slows my browser down quite a bit even after speeding up the loops, so I don't know if that's such a good idea. - [[User:Xerxes|Xerxes]] ([[User talk:Xerxes|talk]]) 01:03, 17 July 2017 (CEST)
:: Whoops, I hadn't considered the impact in the page loading. Anyway, the first version (which embeds the first 3 and links the rest without the rand stuff) LGTM, I would move it out of the sandbox right now, but perhaps, [[User:Kolano|Kolano]] or [[User:MayImilae|MayImilae]] might have something to add in the discussion - [[User:Jhonn|Jhonn]] ([[User talk:Jhonn|talk]]) 01:38, 17 July 2017 (CEST)


=== Square Brackets Example ===
=== Square Brackets Example ===

Revision as of 01:38, 17 July 2017

Lift Thumbnail Limit

Back when we're implementing this template, we decided to limit the number of thumbnails to 3 because of the crappy Flash plugin that caused slowdowns in pages with various videos (like Xenoblade Chronicles). From a quick look, a huge part of our wiki have video links hosted on YouTube and currently it uses an HTML5 player by default in major browsers (Chrome, Safari, Firefox, the new Microsoft Edge). Said that, I think we should remove the thumbnail limit (especially now that it's becoming common random users reordering the list of videos when adding new content). Thoughts? Jhonn (talk)

I'm OK with lifting it or minimally increasing the limit. We should test out some of the more densely populated pages first. Super Smash Bros. Brawl has 12 separate videos and I'd want to be sure there doesn't need to be some limit still. Kolano (talk) 07:02, 12 September 2015 (CEST)

I'll try to find a way to measure the impact this change could take then report back. Do we have more dense pages? Right now I remember only of Xenoblade Chronicles and now that you mentioned, Super Smash Bros. Brawl - Jhonn (talk)

I would like to keep the limit, honestly. There's more than just the limit at stake, but also page composition. Endless rows of videos is just tacky! If the limit should be changed, it should just be increased to 6. - MaJoR (talk) 11:14, 13 September 2015 (CEST)

I think the other goal here was to prevent edits from folks who think the order of videos makes a difference regarding which are displayed. If we maintain the limit, we should probably add a comment along with the template that more clearly explains videos are chosen at random and order does not matter. We probably should also universally add the empty template across pages, so the mechanism for adding videos is more clear (i.e. currently the template only appears where there are videos populated). Kolano (talk) 19:43, 13 September 2015 (CEST)

Square Bracket Handling

YouTube videos seem to be prone to use square brackets in their titles. These seem to cause breakages when used in the captions here. We either need to account for that internally, or document how to escape them. Pipes similarly need a documented escape. Kolano (talk) 20:15, 22 January 2016 (CET)

Sounds critical, could you share an example? I would like to apply at least a "band-aid" here until I can finish the RFC of the video templates... - Jhonn (talk) 02:33, 23 January 2016 (CET)
There's something weird going on with <span title=""> in the middle of a link. The YouTube template does some funky stuff and calls a mouseover template from within a [ ] link, and that template sets a span title. If the span title contains a closing bracket ] then it freaks out and actually parses the bracket into html for some reason as an </a>, then the weird glitchy links happen after that. I have it working and fully functional in the sandbox, the only problem is that the tiny blue link square in the bottom right of the YouTube embed is either missing or cut off. I was mostly shuffling things around so it must do with ordering (which caused the problem to begin with). You could probably also do this fix by using Template:Hover over the whole link, but I don't think that would be any better honestly. - Xerxes (talk) 16:46, 15 July 2017 (CEST)
Thanks for taking a stab at this. Something is still off with the parsing even in your revised template. The final square bracket seems to end up outside of the link...

<span style="text-overflow: ellipsis; display: inline-block; width: 275px; white-space: nowrap; overflow: hidden; vertical-align: top;" title="Xenoblade JP HD Gameplay 1A (Dolphin Emulator @ 720p]"> <a class="external text" rel="nofollow" href="http://www.youtube.com/watch?v=sam9lDWDvXE">Xenoblade JP HD Gameplay 1A (Dolphin Emulator @ 720p</a> ] </span>

User:Lucario's nowiki tagging on live fixes that behavior. I only needed to port over the Template:YouTube tag though, the change to Template:VideoGallery is giving the same page source output as without it. I tried going crazy and throwing a million brackets at the sandbox and live versions, and it seems that in both, double open brackets [[ cause some total madness and completely break the YouTube template and just display the wikitext as page text. But, that doesn't seem to be nearly as common of a situation as single open/closed brackets. - Xerxes (talk) 01:52, 16 July 2017 (CEST)
To be honest, I would just remove the random thumbnail selection code since it's broken for ages and just do a loop calling the respective subtemplates to embed every video from the arguments, that would make the code cleaner and probably fix those strange issues. I hope I'm able to finish {{Video}} someday, but until that I think this will suffice... - Jhonn (talk) 20:16, 16 July 2017 (CEST)
I removed the rand calls and cleaned up the loop logic to be faster/easier to read. I did two versions, one which embeds the first 3 and links the rest like current behavior (just not randomly), and a version which embeds them all like you requested. You can see how it looks embedding a lot of videos here. Loading that page slows my browser down quite a bit even after speeding up the loops, so I don't know if that's such a good idea. - Xerxes (talk) 01:03, 17 July 2017 (CEST)
Whoops, I hadn't considered the impact in the page loading. Anyway, the first version (which embeds the first 3 and links the rest without the rand stuff) LGTM, I would move it out of the sandbox right now, but perhaps, Kolano or MayImilae might have something to add in the discussion - Jhonn (talk) 01:38, 17 July 2017 (CEST)

Square Brackets Example


Weird Links

Seem to continue to following sections. Seems the link tag is never closed.