ModernFlyouts-Community / ModernFlyouts

A modern Fluent Design replacement for the old Metro themed flyouts present in Windows.
https://modernflyouts-community.github.io
MIT License
3.58k stars 193 forks source link

Feature proposal: Add support for seeking or changing the progress of the media playback #97

Closed Samuel12321 closed 3 years ago

Samuel12321 commented 4 years ago

from @Samkunmiayo's request Is your feature request related to a problem? Please describe:

Amazing app! Would be amazing to have the ability to seek the current audio in the timeline info section.

Describe the solution you'd like:

Addition of a seek feature similar to the volume slider to enable the user go to a certain section of the song or podcast, like in spotify for example

Describe alternatives you've considered:

Additional context:

image

ShankarBUS commented 4 years ago

https://github.com/ShankarBUS/ModernFlyouts/issues/49#issuecomment-699785844

@Poopooracoocoo,

still can't seek in the GMC or STMC >:(

We can actually seek the playback iff the source app supports seeking through SMTC. Currently we only have a ProgressBar to show the timeline properties. We could replace that with a slider to actually control the playback from our app. But the last time I tried, it was really slow. I will reconsider this in future versions

References :

Our side of control :

Media apps' side :

GlobalSystemMediaTransportControlsSession.TryChangePlaybackPositionAsync(Int64) Method doesn't work unfortunately 🤷‍♂️. So this will not be worked on.

Samuel12321 commented 3 years ago

GlobalSystemMediaTransportControlsSession.TryChangePlaybackPositionAsync(Int64) Method doesn't work unfortunately 🤷‍♂️. So this will not be worked on. Why? is it broken like GlobalSystemMediaTransportControlsSessionManager.SessionsChanged

ShankarBUS commented 3 years ago

It doesn't accept a timespan as a parameter.

I didn't know in what format we have to pass the requested position in.

It resets to zero for any value I pass. I will reinvestigate this later.

Samuel12321 commented 3 years ago

Highly requested feature, warrants further investigation.

ShankarBUS commented 3 years ago

Let me be honest with you.

Most apps which consume the SMTC APIs don't care about functions other play, pause, next, previous, media title, media artist and thumbnail.

They just simply ignore other functionalities of the SMTC APIs.

Some apps could report their playback position while not others.

I'm not sure if any one of them support seeking.

There's nothing we can do on our side without the media source app's side support.

They have to hook things up to make it work.

Android is a different case. Android has a limited amount of media playback APIs, so there's a good chance the Android developers use the official APIs to play media instead of 3rd party or custom methods. Thus, securing complete integration with Android's Global media controls feature!

But Windows!!!!

There's literature a ton of distinct APIs and libs to play media.

There are multiple platforms or frameworks to build Windows apps. Each have their own method to play media. There's no built-in support for SMTC in non-UWP apps.

App devs have to hook the SMTC themselves to whatever media playback API they use. Thus, resulting in this incomplete support and making the SMTC feature of Windows insignificant.

While UWP apps have complete integration and out-of-the-box support for SMTC (with guidelines and samples and D O C S), they still don't make use of or hook all the functionalities of the SMTC!

(UWP devs still have to hook SMTC themselves though 😅).

We are underestimating the true power of SMTC APIs.

If all done correctly, we can also get support for changing the volume of the media sessions, fast forward, rewind and control the playback rate!

Samuel12321 commented 3 years ago

But Windows!!!!

Doesn't that just about sum everything up.

ShankarBUS commented 3 years ago

Just found out a similar issue:

https://github.com/MicrosoftDocs/winrt-api/issues/1725

Seems like the TryChangePlaybackPositionAsync method itself have some major problems.

It doesn't have proper documentation and provides unreliable reports about the result of changing the playback position.

If anyone want to see this feature implemented, please bring enough attention (by voting or commenting) to the fore-mentioned issue. Let's see if they notice the issue and provide us any workarounds.

ShankarBUS commented 3 years ago

Man f*** GlobalSystemMediaTransportControls!

@ADeltaX showed me this https://cdn.discordapp.com/attachments/772345967785672734/788750160297590814/2020-12-16_13-50-52.mp4 half an hour ago.

You can see the seeking actually work. All hail lord @ADeltaX! Thanks for the NowPlayingSessionManager!

prakharb5 commented 3 years ago

The fact that old APIs are more reliable and better just proves the fact, in a way, that Win7 is better than Win10 (older better than new). 😂😂😂

ShankarBUS commented 3 years ago

So, this thing happened while me and @ADeltaX where chatting. image

https://kapwi.ng/c/W4NYHflh

LOL. Just "3 words" and he solved a month long suffering.