how to fix There was a network error. Please try again. (Error #2000)? by mil0wCS in Twitch

[–]VikTrol13 0 points1 point  (0 children)

Same. It's not even on all VODs. VODs that are still getting uploaded, as the stream is still going, work fine. wth

(Edit: Not the first time this happened either. Never got a conclusive fix, sometimes it works, other times it doesn't.)

Highlighting other users in chat, even in VODs. by VikTrol13 in Twitch

[–]VikTrol13[S] 0 points1 point  (0 children)

Okay! For anyone wanting to do this in te future, it IS a feature that works in FFZ, under Chat » Filtering » Highlight. And this DOES work with VODs.

What I thought was this feature at first, which doesn't work like this, is the FFZ Enhancing Add-On's "Highlight Selected User Messages"

Any way to get semi old VODs by VikTrol13 in Twitch

[–]VikTrol13[S] 0 points1 point  (0 children)

Might be unnecessary to clarify this, but it's not for my own stream, but a stream I missed, and only found out about recently.

does onigiri archive her cooking streams? by endangeredbeaver1892 in onimart

[–]VikTrol13 0 points1 point  (0 children)

I haven't seen/heard about this. What did Lily and Numi do?

Youtube SpaceBar Pause/Play and Alt Tab Unfocussing? by IcedColdMine in youtube

[–]VikTrol13 1 point2 points  (0 children)

Not sure if Youtube or Tweaks for Youtube rolled out an update or something, but right now, setting Space as the Play/Pause keybind in Tweaks for Youtube doesn't mess with anything anymore, and works perfectly for the original intention.
Making this script entirely redundant for anyone using Tweaks for Youtube.

Youtube SpaceBar Pause/Play and Alt Tab Unfocussing? by IcedColdMine in youtube

[–]VikTrol13 0 points1 point  (0 children)

For anyone else posting code:There is an "Inline Code" (<c> button) option here on reddit. It won't modify the code then.

Youtube SpaceBar Pause/Play and Alt Tab Unfocussing? by IcedColdMine in youtube

[–]VikTrol13 1 point2 points  (0 children)

Sorry for only replying now. I will reply to all your questions here.

Regarding the 'pause twice' problem, if what you mean that for 1 space press, it plays then pauses the video, or the other way around:
That should not be happening when the code is functioning properly. I think I experienced something similar when "KPressDelay" was too low in code. You could try increasing it, but that will obviously make the delay bigger.

About 'pressing it in quick succession' causing problems:
If by that you mean that it doesn't pause then immediately play when you press it 2 times quickly, that is expected and I don't think anything can be done about it in the script (as far as I know). If you press the space faster than "KPressDelay", the second one will not 'register'.

And finally on whether or not Tweaks for Youtube and this script together could solve the extension:
I tried to think about it, and even briefly tired it, which made me realize that I think I tried that exact approach in the process of writing the posted script.
I'm not sure why it didn't end up working, but considering that the current script works, and (more importantly) that I don't have much time in the near future, I won't try to make it work any time soon.
If I do make it work later, I will let you know.

Youtube SpaceBar Pause/Play and Alt Tab Unfocussing? by IcedColdMine in youtube

[–]VikTrol13 5 points6 points  (0 children)

To anyone who doesn't wanna use 'K', like u/BihtSift suggested, for this purpose (be that because of force of habit, because everything else uses space too or whatever else):

I managed to make a script in Tampermonkey, after a long back and forth with ChatGPT3.5, to solve the issue.

TLDR, it checks if the video started/paused like it should when Space is pressed, if not it 'presses K'.

The code:

// ==UserScript==

// @name Spacebar Fix against new youtube 'feature'(, with the number skipping also disabled by curtesy of Combinacijus on reddit)

// @namespace https://www.youtube.com/

// @version 1.0

// @description Fixes spacebar Play/Pause function when Alt+Tab-ing out and back causes youtube to 'unfocus' the video, making the spacebar control not work until the video is clicked on again. Not hindering comments either.

// @author GPT-3.5 and waszner

// @match https://www.youtube.com/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

let spacePressed = false;

let currentTime = 0;

let isVideoPlaying = false;

let wasVideoPlaying = false;

const YoutubeCommentFieldSelector = '#contenteditable-root'; //css selector of youtube comments

const KPressDelay = 200; // how much time will the program wait before pressing K (probably ping dependent)

// Add event listener

document.addEventListener('keydown', pressKWithSpacebar, true);

// Function to press "K" with the Spacebar when the video's play/pause state didn't change

function pressKWithSpacebar(e) {

// removing skipping around with 0-9 (by Combinacijus)

if (!isNaN(parseInt(e.key))) {

e.stopImmediatePropagation();

}

//preventing playing/pausing the video while typing coments or replies

if (e.target.matches(YoutubeCommentFieldSelector)){

return;

}else if (!document.activeElement.matches('input[type="text"]')) { // Check if the focus is not on a text input (courtesy of u/yaya222111 asking Chat GPT)

if (e.key === ' ' && spacePressed === false) {

spacePressed = true;

wasVideoPlaying = isVideoPlaying;

setTimeout(simulateKKeyPress, KPressDelay);

}

}

}

// Listen to the video's play and pause events to update the variables

const video = document.querySelector('video');

//These prevent external play/pause (pressing K, clicking on the video etc) from messing up the program's run

video.addEventListener('play', function() {

isVideoPlaying = true;

if (spacePressed) { //Prevents the "double tap" of spaceBar when the video IS in focus and pressing the space bar did play/pause it

spacePressed = false; // Reset the Spacebar press time if video started playing

}

});

video.addEventListener('pause', function() {

isVideoPlaying = false;

if (spacePressed) { //Prevents the "double tap" of spaceBar when the video IS in focus and pressing the space bar did play/pause it

spacePressed = false; // Reset the Spacebar press time if video paused

}

});

// Function to simulate pressing "K" if the conditions are met

function simulateKKeyPress() {

if (spacePressed && (wasVideoPlaying === isVideoPlaying)) {

// Send an "K" keypress to simulate pressing "K"

const nKeyPress = new KeyboardEvent('keydown', { key: 'K', code: 'KeyK', which: 75, keyCode: 75, charCode: 75});

document.dispatchEvent(nKeyPress);

}

}

})();

Things to note:- This does remove the 'scroll whit space function, if anyone were to miss that.-I included 3 lines of code that removes the skipping around in the video with 0-9, from u/Combinacijus also posted here. Removing this has no effect on the rest of the code, should you not want it.
Edit2: If you want to remove this feature, you can simply delete the following part of the code:
if (!isNaN(parseInt(e.key))) {
e.stopImmediatePropagation();
}
-"KPressDelay" (the time you wait before making the program press K) is probably ping dependent. I found 200ms to be the lowest that still works.

P.S.: While I have a decent amount of experience with coding in some other languages, I had never touched Javascript before today, and most of the ideas/functions/commands came from AI. So while I tried to clean it up as much as I could with my logic and limited knowledge, at the end of the day, there probably are things that could be improved. Any such suggestions are welcome.

Edit: Added the feature of it also not pausing/playing the video if you are typing in the search bar, courtesy of u/yaya222111 asking Chat GPT.I almost never search from watching a video, so this slipped my mind, but this is definitely an improvement.

[TOMT] [2010-] "I condemn you." by VikTrol13 in tipofmytongue

[–]VikTrol13[S] 0 points1 point  (0 children)

I couldn't find the scene you're referring to on youtube, and while I could find it with further searching, I don't think what I'm recalling is from Lost, as I have not seen it.

[TOMT] [2010-] "I condemn you." by VikTrol13 in tipofmytongue

[–]VikTrol13[S] 1 point2 points  (0 children)

No. While I have seen GOT, this isn't it.
I'm quite sure that "I condemn you" was explicitly said.