kotatogram / kotatogram-desktop

Experimental Telegram Desktop fork.
https://kotatogram.github.io
Other
1.17k stars 121 forks source link

[Feature Request] Open video files in local player #207

Open tissole opened 3 years ago

tissole commented 3 years ago

Is your feature request related to a problem?

Currently, the video player can render only .mp4 and .mov files. MKV, AVI, FLV, TS can't be played on the video player.

Describe the solution you'd like

Add an option for the users to open video files in the local video player. Not only a greater variety of files could be played directly, but the process is more smoothly and battery friendly. Now the video player consumes more resources than the local video player.

ilya-fedin commented 3 years ago

Such option already exists, look at kotatogram settings

tissole commented 3 years ago

??? I searched all settings, I could not find this option in any menu. Where exactly is this option located?

ilya-fedin commented 3 years ago

Ah, it's not released yet. You can still enable it via videoplayer cheat code inherited from tdesktop.

tissole commented 3 years ago

Please give more details, I don't know anything about this cheat code. P.S. When this feature is coming?

ilya-fedin commented 3 years ago

Please give more details, I don't know anything about this cheat code.

Go to the main settings view (where Notifications, Chat Settings, etc), enter videoplayer blindly (like a cheat code in a game)

P.S. When this feature is coming?

It's already present on dev branch. No ETA for next pointing release.

ilya-fedin commented 3 years ago

Here's the list of tdesktop cheat codes: https://github.com/telegramdesktop/tdesktop/wiki/Hidden-modes

tissole commented 3 years ago

Aaaa...the treasure trove. Thanks a lot!

tissole commented 3 years ago

I tested but unfortunately, it does not work, It downloads the file instead to open it in the external player. I will wait for the new version.

Is it also possible to open Youtube links in the external player? Now, these links are opened in the browser, which is quite annoying.

ilya-fedin commented 3 years ago

It downloads the file instead to open it in the external player.

Of course it downloads, you can't open something in external program without downloading it.

I will wait for the new version.

It just adds a visible switch for that feature. Nothing else.

tissole commented 3 years ago

Oh! I was expecting the file to be streamed, not downloaded. That's disappointing... If that's not going to work, what about making the internal player stream, mkv, avi files? Or is a Telegram limitation that can't be bypassed?

The desktop client can be made to play directly Youtube links as the mobile client does?

ilya-fedin commented 3 years ago

I don't imagine how to stream to external players. Usually system provides you an API like ShellExecute/xdg-open and all you can is to specify local file, then it finds the appropriate application that can handle that file and opens it. They don't provide any API to handle streams.

ilya-fedin commented 3 years ago

The desktop client can be made to play directly Youtube links as the mobile client does?

That would require a lot of effort, personally I'm not interested in this, so I won't work on this

ilya-fedin commented 3 years ago

If that's not going to work, what about making the internal player stream, mkv, avi files? Or is a Telegram limitation that can't be bypassed?

I'm not sure we should do that. I think this should be discussed with @RadRussianRus

EricKotato commented 3 years ago

I don't think it's going to work. Even if player supports streaming, it's probably by HTTP(S), and Telegram uses MTProto.

It could be solved with embedding of HTTP server, so video can be converted from MTProto to HTTP, but that's totally overkill.

Another way is to make a player plugin with embedded TDLib to support streaming. But I'm not sure if TDLib even supports streaming. Though even if it does, you'll need to make a plugin for every player you need, and maintain it (at least in terms of updating TDLib). And with Telegram's pretty unstable APIs it probably will be painful.

So it's either overkill or painful to make and maintain (also first way could be both overkill and painful).

tissole commented 3 years ago

Thanks for the answers! If making Youtube links play in the external player is difficult, what about this: Opening any links with a custom URI Scheme like in this fork https://github.com/Forkgram/tdesktop

It could be solved with embedding of HTTP server, so video can be converted from MTProto to HTTP, but that's totally overkill.

I see. That's OK, I found a solution based on this concept, streaming Telegram files through an HTTP server.

ilya-fedin commented 3 years ago

Opening any links with a custom URI Scheme like in this fork

WTF

tissole commented 3 years ago

hEhGMj3MPS

R9FWHCpsUg

ilya-fedin commented 3 years ago

What does that do?

tissole commented 3 years ago

Forkgram_hErKGJDtLN

ilya-fedin commented 3 years ago

It doesn't make clear what happens when you click "Open Link with URI scheme"

tissole commented 3 years ago

It opens the player (Potplayer), but it does not play the video for some reason. Or is something wrong with the implementation, or I did not set this correctly.

ilya-fedin commented 3 years ago

How does it understand what app to open?

tissole commented 3 years ago

Supposedly through this URI scheme potplayer://

ilya-fedin commented 3 years ago

so you specify URI scheme in settings and it just opens that URI scheme via system handler by that menu item?

tissole commented 3 years ago

Yes, but only for Potplayer, I tried vlc://, and is not working. So I don't know what the scheme is for specific players. I will open a ticket to ask the developers.

ilya-fedin commented 3 years ago

So I don't know what the scheme is for specific players.

Players usually don't provide schemes. So I think such a feature is useless.

tissole commented 3 years ago

They updated the fork and the feature is working now. I tried with potplayer:// andmpv://. I also found a workaround, drop the link in the player :)

github-actions[bot] commented 4 months ago

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!