Closed n1trux closed 3 years ago
This is probably my most desired feature. Having the option to have FreeTube simply pass the YouTube URL to a configured player when clicking a video thumbnail would be amazing.
yep, that.
Until this gets implemented on freetube - my workaround on linux is click the drawer icon, click Copy YouTube Link
, then have a keybind preset for the following:
mpv "$(xclip -o -selection clipboard)"
This is basically the same as typing mpv <youtube_url>
which MPV auto recognises and plays.
Requirement on debian based distro:
sudo apt install xclip
Then just press the keybind combo and video opens in external player
Swap mpv
out for whatever player you want (of course it has to support a url in the commandline arg, but each player may have different syntax for this).
I've noticed lately this command errors on some videos, mpv uses youtube-dl
and it doesn't seem to recognise video formats. Could be youtube using vp9/h.265? Not sure.
More use cases:
I'll add my voice of support for a feature like this. Ideally it would be configurable to pass the applicable URL to the external application of choice with a single click on the video.
I'll spare you the details, but this would be a huge improvement for me and I would love to see this implemented.
Another reason why this feature is a must have: https://github.com/FreeTubeApp/FreeTube/issues/912
This feature is great if you use filters in your media player to make videos look higher resolution than they are, like MPC-HC + madVR.
Hi guys! Just discovered FreeTube and I love it! I prefer playing videos in mpv though so I downloaded the source code and edited it so that if I middle-mouse click a thumbnail or video title I open it in mpv. I've never used js before so my implementation is very very ugly but it works so if anyone else is interested I thought I'd post it: All I did was open FreeTube/src/renderer/components/ft-list-video/ft-list-video.js and add the following function to the methods:
activateMiddleMouseClickShortcut: function() {
// I loop through all the links on the page and change
// their middle-click function. Doing the entire for loop
// seems very silly to me but for some reason I couldn't
// get the function to work without it.
let links_on_page = document.getElementsByClassName('ft-list-video');
for(let i=0; i<links_on_page.length; i++) {
links_on_page[i].onauxclick = (e,t) => {
let youtube_id = ''
// If we clicked on a title target.src will be undefined
// and we retrieve the ID from target.href
if (e.target.src == undefined) {
let url_split = e.target.href.split('/')
youtube_id = url_split[url_split.length - 1]
}
// If we clicked on a thumbnail we retrieve
// the ID from target.src
else {
let url_split = e.target.src.split('/')
youtube_id = url_split[url_split.length - 2]
}
let youtube_url = `https://www.youtube.com/watch?v=${youtube_id}`
let child = cp.spawn('mpv', [youtube_url], { detached: true, stdio: 'ignore' });
child.unref();
return false;
}
}
},
and then run this new function in the mounted() function (right above "methods:"), so I changed the mounted function to:
mounted: function () {
this.parseVideoData()
this.checkIfWatched()
this.activateMiddleMouseClickShortcut()
},
Finally just add
import cp from "child_process"
to the top since I use that in activateMiddleMouseClickShortcut to run mpv. Of course you could change mpv here to whatever you like.
@feynmania create a pull request so de dev can implement
EDIT 4: PR #1271
Working on a proper PR...
It's awesome that the support for external video player is finally included in 0.14!
Would it be possible to enable custom external video player? Or is there any current workaround? I'm using Celluloid which is a mpv GUI frontend. It seems changing neither "Custom External Player Executable" nor "Custom External Player Arguments" in settings worked if I wanted to use Celluloid instead of mpv.
It's awesome that the support for external video player is finally included in 0.14!
Would it be possible to enable custom external video player? Or is there any current workaround? I'm using Celluloid which is a mpv GUI frontend. It seems changing neither "Custom External Player Executable" nor "Custom External Player Arguments" in settings worked if I wanted to use Celluloid instead of mpv.
@sith-on-mars If you are interested in adding support for an external player, feel free to take a look at: #1409 / #1424
Why not just add a 'Custom' setting where people can enter the path of their video player and their own external arguments with a variable representing the YouTube URL.
Why not just add a 'Custom' setting where people can enter the path of their video player and their own external arguments with a variable representing the YouTube URL.
Because that would have been too complicated for most users, which is why it wasn't included in the initial implementation of this feature. That being said, I personally think that this would be a neat addition, so if someone wants to volunteer, and submit a PR for this, feel free to do so :smile:
@sith-on-mars Also, I just took a look at Celluloid, and the reason why it doesn't work with the current mpv flags can be seen here:
It is also possible to set mpv options by putting the options — as you would pass to mpv on the command line — in
Extra MPV Options
text box in the preferences dialog. You can also pass options directly on the command line by addingmpv-
prefix to the option name. For example, using the option--mpv-vf=flip
when launching Celluloid is equivalent to using--vf=flip
in mpv.
So, theoretically, a PR for adding Celluloid support would need to make the following changes/additions (NOT TESTED):
{
"name": "Celluloid",
"value": "celluloid",
"cmdArguments": {
"defaultExecutable": "celluloid",
"supportsYtdlProtocol": true,
"videoUrl": "",
"playlistUrl": "",
"startOffset": "--mpv-start=",
"playbackRate": "--mpv-speed=",
"playlistIndex": "--mpv-playlist-start=",
"playlistReverse": null,
"playlistShuffle": "--mpv-shuffle",
"playlistLoop": "--mpv-loop-playlist"
}
}
Like you might have noticed, these are almost the exact changes as in PR #1424, minus the defaultCustomArguments
part, which I don't know whether it is required for Celluloid :shrug:.
It would be awesome if you could have a setting and a right-click menu entry where you open a video in an external player from a list of videos.
MPV can play youtube (and other!) videos with youtube-dl.