F
F
F1eex2021-08-11 16:21:21
linux
F1eex, 2021-08-11 16:21:21

How to control the browser in parallel with other applications?

In one window, for example, Photoshop is open for me. In the second window, a browser is opened with a Photoshop video tutorial on YouTube. The video has to be stopped and started constantly, switching from the browser to Photoshop and back. To do this, you need to change the focus of the windows, for example, moving the mouse back and forth, which is very annoying. How to make video stop/start without changing focus from photoshop to browser? For example by means of hot keys?
One option came to my mind - a virtual machine with a separate keyboard forwarded and a browser running. But it's kind of hard.
Interesting solutions for both Windows and Linux.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xotkot, 2021-08-11
@F1eex

install mpv and yotube-dl
next, launch the IPC server and video with the desired video in the console (example):

mpv --input-ipc-server=/tmp/mpvsocket "https://www.youtube.com/watch?v=GYE2P7BWBAs"

(if you wish, you can additionally install a browser extension to run the command (video) so that you don’t go into the console every time)
in another console we type commands (example):
echo '{ "command": ["set_property", "pause", true] }' | socat - /tmp/mpvsocket

pause
echo '{ "command": ["set_property", "pause", false] }' | socat - /tmp/mpvsocket

continue playback
(for details see mpv:JSON IPC )
in general, we hang these commands on hotkeys and voila
p.s.
the last two commands, pause and playback, can be written a little easier and in one command: if there is a pause, it will start playback, and if it is played, it will pause.
echo "cycle pause" | socat - /tmp/mpvsocket

A
Alexander Falaleev, 2021-08-11
@suffix_ixbt

The second monitor in your case is not a whim but a necessity!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question