Customizing buttons when over a youtube/twitch player

x64 Replacement/Alternative to Microsoft's IntelliMouse application.
Forum rules
Please read the forum rules before posting for the first time.
The more information you can provide, the quicker and more accurately someone can help.
NOTE: To reduce spam, new users can not post links, files or images until they have at least 4 posts.
kolyapedal
New User
Posts: 10
Joined: Wed Jul 06, 2022 4:20 am

Customizing buttons when over a youtube/twitch player

Post by kolyapedal »

XMBC Version 2.20 Beta4 (installed):
Windows Version: 10:
Mouse Information: A4tech X-710BK :
How long have you used XMBC? 2 weeks:
What language and keyboard layout do you use in Windows? English:

Good day!
I've been combing through the forum but didn't find anything that could help me understand how to specify a player on the youtube/twitter page? I'd like to customize my mouse buttons only when I'm over the player. Can somebody tell me what should I put in the "specific window" section when creating the profile?
Thank you
:
User avatar
phil
Site Admin
Posts: 7627
Joined: Sun Apr 06, 2003 11:12 pm

Re: Customizing buttons when over a youtube/twitch player

Post by phil »

Its unlikely that you will be able to do this because elements on a web page are not normal "windows" elements, they are html elements which you can not detect from outside of the browser. They are not individual controls in Windows' list of windows and child window.
Without writing a browser plugin that could communicate the required information to XMBC somehow (maybe that's a nice challenge one day!), the best you would be able to do, would be to setup a profile for the page itself, in the browser - so the application would be chrome or edge or firefox etc. and you can use the page title to narrow down to the page.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
kolyapedal
New User
Posts: 10
Joined: Wed Jul 06, 2022 4:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by kolyapedal »

phil wrote: Wed Jul 06, 2022 9:36 am ... and you can use the page title to narrow down to the page.
works for me!

thanks phil. You've made such a handy tool giving us the opportunity to comfort our lives knowing nothing about coding. From now this is the first thing I install after Windows
addled
New User
Posts: 3
Joined: Wed Jul 12, 2023 6:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by addled »

XMBC Version 2.20.5 (installed):
Windows Version: 10:
Mouse Information: : Logitech Mx Anywhere 2s
How long have you used XMBC?: 3 days
What language and keyboard layout do you use in Windows?: English

HI, New user here. Trying to achieve something similar for Youtube. Could you elaborate on how this was achieved?
Best
Aditya
User avatar
phil
Site Admin
Posts: 7627
Joined: Sun Apr 06, 2003 11:12 pm

Re: Customizing buttons when over a youtube/twitch player

Post by phil »

In the advanced, specific window profile setup, you can specify specific criteria for window profile detection.
You can include the window title (which usually has the page or site in it in a browser window)
And you can use regular expression matching to advanced string matches...

Something like this (will activate the profile on Edge or Chrome with a youtube page open)....
Capture.PNG
You do not have the required permissions to view the files attached to this post.
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
addled
New User
Posts: 3
Joined: Wed Jul 12, 2023 6:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by addled »

HI,
Thanks for the quick solution.
It works
Mostly :)

Sharing my profiles below Edit: I'm brand new here..cannot post the profile files or screenshots

Resultant profile using your suggestions works great on a youtube video page
I've run into few problems however

1. The profile seems to also activate on any page that has the word Youtube in it. Such as this thread.

2. I've used the simulated Keys option to map Youtube shortcuts ('m' for Mute, {SPACE} for PLay/pause, {UP} and {DOWN} for Volume control via the scroll wheel). Doing this lost my page scrolling ability, which I tried solving using Window Regions mapped out to the video player region with the page scrolled all the way up. Works mostly until I start scrolling down into the comments and the same relative area of the screen where the profile is active remains unavailable for page scrolling via the mousewheel. (PS I know it might be simpler to just choose different buttons, but i'd prefer the scroll wheel as it's intuitive and Plus I'm trying to learn here)

Just have a feeling the above (partial)solution (for point 2) is a clunky one and a better option exists/is possible.

3. Because of the Windows regions solution above I naturally lose the Mute and Play/Pause functionality as well for the rest of the page. This was simpler to solve by adding a more another similar profile for Youtube with no Windows Regions and with just Mute &Play pause mapped out to my preferred buttons. Put this profile at a lower heirarchy than the previous one


Is there a better way to achieve what I'm trying to do?

Best,
aditya
User avatar
phil
Site Admin
Posts: 7627
Joined: Sun Apr 06, 2003 11:12 pm

Re: Customizing buttons when over a youtube/twitch player

Post by phil »

You normally need 4 or 5 posts before screenshots and links are available. I've removed you from the new users group so you can now post screenshots.

1. Yes that's not surprising,, my example was quite basic. Unfortunately, the only way of detecting what is active is by the "name" of the tab which is visible to XMBC as the window title. The only solution is to improve the regular expression to be more specific - that may not be 100% possible. XMBC sees nothing other than the title of the window so it is the best it is able to do.

2 & 3. Again, as XMBC is unable to detect what is under the mouse inside the browser, this makes it pretty much impossible as you have found.
Maybe you would be better off using button chording for volume / media control - the benefit of that is it can work everywhere.
For media control (in the default profile so for all apps) what I do is I set button 2 to "Button Chording" (but equally you could use button 3, 4 or 5 (I don't recommend chording button 1 generally). In the chording config for the button, I set the wheel to be volume up/down, I set button 1 to mute, the middle button to be pause (which toggles pause/play), and I set the other two buttons (4 and 5) to be next/previous track. That way I can control media stuff (globally) by holding the right button and pressing the other buttons or scrolling the wheel. I find that works quite well and it works globally, no need for specific profiles.

Of course you could do that in a profile just for youtube pages but it works really nicely (esp. the volume controls) globally and can be a nice quick life saver for quick volume/mute control :)
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
addled
New User
Posts: 3
Joined: Wed Jul 12, 2023 6:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by addled »

Nice..
Button chording....I Like your set up for media. Think I might do something similar

thanks so much for your patience and of course this incredible software!

Revolutionised the way I work with Cad and Imaging softwares such as Revit and Photoshop which take up a lions share of my day. :)
kolyapedal
New User
Posts: 10
Joined: Wed Jul 06, 2022 4:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by kolyapedal »

Hi
Long time no see!

I noticed people's interest to what was bothering me as well. So I'd like to share my way which I found long time ago to comfortably control the video player on a webpage using the X-mouse. I hope it will help someone who wants to use the mouse wheel (or the other mouse buttons) to control whatever they want in their browser. :)

My objective was to use my mouse's wheel for:

1) seeking backward/forward
2) changing speed (you'll need an extension "Video speed controller")
3) changing volume

while watching youtube videos in Chrome/Edge

I've added 3 Chrome profiles using the "Specific Window" tab . I divided the bookmark bar into 3 equal areas. It could be the address bar, it doesn't matter. The main idea is that you manipulate with the upper part of Chrome, which is called Chrome_WidgetWin_1. It includes the address bar, the bookmark bar and the tabs bar.

You can make profiles by specifying any areas at the top of your browser (Parent Class: Chrome_WidgetWin_1) using the "Activate the profile only when the cursor is in the specified areas" checkbox and customize the profile. But pay attention to the numbers, they are absolute (Phil :?) switching to a monitor with a different resolution or changing the size of the browser's window might get confusing.

As a result: when I want to seek backward/forward I just move my mouse to the left side of the bookmark bar and use the wheel. To change the speed of the video I hover my mouse to the center, to change volume - to the right. Little tip: there's a site called Chrome Bookmarks Separator which can add vertical separators to your bookmark bar so you can clearly see your designated areas.

I've even pinpointed a couple of web shortcuts on my bookmark bar to use my mouse right button to change the current video resolution, reset the speed etc. So you get lots of possibilities mapping "the hat" of your browser

If someone needs some screenshots let me know
Last edited by kolyapedal on Sat Jul 15, 2023 2:01 am, edited 2 times in total.
kolyapedal
New User
Posts: 10
Joined: Wed Jul 06, 2022 4:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by kolyapedal »

1.JPG
2.JPG
3.JPG
4.JPG
You do not have the required permissions to view the files attached to this post.
kolyapedal
New User
Posts: 10
Joined: Wed Jul 06, 2022 4:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by kolyapedal »

addled wrote: Thu Jul 13, 2023 6:41 am Works mostly until I start scrolling down into the comments and the same relative area of the screen where the profile is active remains unavailable for page scrolling via the mousewheel.
although I've found a more reliable way (described above) and it's extremely comfortable believe me, at first I tried to accomplish my mission making the same manipulations as yours. And I found a solution by using an extension called SuperYouTube (Extension for Youtube™). It makes it so your player always remains in the same area of the screen while you can scroll comments to the left/right side of the player (very handy!).
5.JPG
So basically you can go this way but I find the way with the mapping your browser's hat to be more reliable (who use the mouse wheel over the bookmark bar anyway? Mostly we use the left button in that area so actually you can go wild with the others buttons)

You can even specify this area of your browser
6.JPG
to use the mouse right button over these icons making different actions. Let's say you click on the "X" with the right button to play/stop your player or scrolling your wheel over "-" to make the video brighter etc. As I said lots of possibilities with the trick I've found, let's just ask Phil to make this thing relative :wink:
7.JPG
But in the full screen mod I use the button chording mechanic as Phil described.

Right button + Wheel = volume
Button 4 + Wheel = speed
Button 5 + Wheel = seeking

Using my mouse with no additional buttons I have to switch layers to use my Right Button+Wheel chording for different actions. But that requires touching the keyboard keys :x , and there's no other way (that's what we concluded with Phil)
You do not have the required permissions to view the files attached to this post.
User avatar
phil
Site Admin
Posts: 7627
Joined: Sun Apr 06, 2003 11:12 pm

Re: Customizing buttons when over a youtube/twitch player

Post by phil »

let's just ask Phil to make this thing relative :wink:
Already in progress.... like doing a percentage of the parent window type of thing. I have it working for the simkey mouse movement commands... Need to do the same for the window region detection.... Also would like the ability like snipping tool to draw the area on the screen (will still have to be rectangular) and get the coordinates that way (either relative or actual).

So hopefully the next version will support this... Its taking a bit more effort than I hoped but it will be worth it I think!
--[ Phil ]--
--[ Administrator & XMBC Author ]--
Logitech G9/G604/M720/MX518, Microsoft Intellimouse, Trust 16341 BT Mouse
Windows 10 x64, AMD Ryzen 5900x, MSI x570 Tomahawk, 32GB DDR4,
nVidia RTX 2070s, Evo 970 1Tb NVME, 2x2TB WD Black (RAID1)
kolyapedal
New User
Posts: 10
Joined: Wed Jul 06, 2022 4:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by kolyapedal »

Hi Phil! :D
phil wrote: Sat Jul 15, 2023 12:30 pm Also would like the ability like snipping tool to draw the area on the screen and get the coordinates that way
That would be a huge time saver & very much appreciated! :P
jhonGL
New User
Posts: 8
Joined: Fri May 12, 2023 1:10 pm

Re: Customizing buttons when over a youtube/twitch player

Post by jhonGL »

Guys, as i was searching the forum for something youtube related, i saw this thread and i wanted to share something that i think is relevant .

Get the "Tweaks for YouTube" extension and check out it's "Interaction Zones" menu. You can set up to 12x12 zones.. :lol:
tweaks.jpg
The cool part is you don't need the mouse position in the profile, as it works with zoom, full screen etc.

This is how i got it at the moment in chrome:

1 zone

twaksyt1.jpg
RMB+Wheel Up/Down = Zoom in chrome, Volume Up/Down when over yt player

Button4+Wheel Up/Down = Shift + Wheel Up/Down in chrome, Fast forward 5 seconds/Rewind 5 seconds over yt player

Button4+Wheel Left/Right = {SHIFT}< / {SHIFT}> - decrease/increase speed

RMB+LMB = m

RMB+Button4 = {CTRL}w - close tab

RMB+Button5 = {CTRL}{SHIFT}t - reopen closed tab

Button5+LMB = {CTRL}t - new tab


MMB over yt player = full screen toggle
twaksyt2.jpg
:cheers:
You do not have the required permissions to view the files attached to this post.
kolyapedal
New User
Posts: 10
Joined: Wed Jul 06, 2022 4:20 am

Re: Customizing buttons when over a youtube/twitch player

Post by kolyapedal »

thanks for sharing!

filter options in the chrome web store really suck, that amazing extension has been in the store for 3 years

PS. just tried it and that extension handles everything, it has lots of customizations, I admire the author. He and Phil are my idols
Post Reply