-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility for immediate playback after download/update #33
Comments
I do see something now that I have not seen before. |
Sorry for the delayed response! In general, I think that it makes perfect sense user-wise (download and immediate playback).
I do not recall exactly how this works, but the MPD communication is done via the ws2mpd package. This communication channel can be probably enhanced with a public interface (called from the function that handles downloads) that does the
Yeah, looks hairy.
Yep, not possible. Once we stream ther very first body byte, headers are out of reach.
Exactly, this is how we would notify the client. Instead of streaming the body, we might use Server-sent Events, introduce some structure into the data and pass the filename in the stream. In my opinion, the pure server-based solution (via ws2mpd) is a better choice. But I have not looked into it in more detail yet. |
It would be nice to have an option in the search result list to immediately begin playback after download. That is to say, what is the point of the download if not to play it back at some time.
I played around with a popular download program that returned a stream URL that could be added to mpd but unfortunately that option got broken by a popular video platform quite some time ago for streams that are longer than only some minutes.
I was thinking about adding a new button in the search result list next to the existing download button to handle that.
There are some caveats to overcome to accomplish that.
The download of the file happens on the server side while mpd communication is happening through the browser over the ws2mpd bridge. That means that after an accomplished download the client triggers the mpd
update
with the download folder.Of course this might take some time and there is no way to check if that has finished successfully and added the downloaded file. Second the destination of the download is not transported to the client at the moment so the client cannot add the file to the queue.
The download handler on the server side streams the console output to the client so there is no structured data communication going on here.
As I see it, this leaves us basically with two architectural options (ugliest first to cancel them out quickly so pleeeaaaase read to the end):
addid
on mpd and playing the title by callingplayid
.The means of giving back the filename are a different story since the download endpoint streams the results back to the client at the moment. 3 options come to my mind (again, ugliest first):
CYP_WRITTENFILENAME:
and the client could interpret that, read the file name from the response and add that to mpd (after waiting for the update).So I am thinking about a PR for that but don't want to put the work in before hearing your thoughts on that.
I would go for the last mentioned option (return file name in the stream of the download endpoint).
Thanks for the great app by the way. I really enjoy using it.
The text was updated successfully, but these errors were encountered: