ambie icon indicating copy to clipboard operation
ambie copied to clipboard

[Feature request] Autoplay with protocol

Open shef3r opened this issue 1 year ago • 3 comments

It would be great if the user could launch ambie with autoplay (with an optional mix name and minimize argument) using a URI.

This way for example ambie:autoplay?name=Example&minimize would auto-play the "Example" mix and minimize the app immedately, ambie:autoplay would play the whatever was played last, and ambie:autoplay?minimize would play whatever was played last and minimize the app.

This would be useful for power users for automation purposes. (ex. Power Automate)

shef3r avatar Aug 05 '24 13:08 shef3r

I think there's already a way to play Ambie using a protocol, but it was experimental. It's in the code somewhere.

But for minimizing, I'm not sure that it's possible to for a uwp app to programmatically minimize itself. Can you check the docs to see if you find anything for this?

dpaulino avatar Aug 06 '24 05:08 dpaulino

There's no way to play Ambie with a protocol, its not in the method. Also, there is a way to minimize the app, check out PR #443

shef3r avatar Aug 06 '24 10:08 shef3r

public void ProcessLaunchProtocolArguments(string arguments)
{
    var query = QueryString.Parse(arguments);
    query.TryGetValue(AutoPlayKey, out var isAutoPlay);

    if (!string.IsNullOrEmpty(isAutoPlay) && Convert.ToBoolean(isAutoPlay))
    {
        // Auto play music.
        _player.Play();
    }
}

nevermind... but still, mine is more functional LMAOO

shef3r avatar Aug 06 '24 10:08 shef3r