Skip to content
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

[Feature request] Autoplay with protocol #442

Open
shef3r opened this issue Aug 5, 2024 · 3 comments
Open

[Feature request] Autoplay with protocol #442

shef3r opened this issue Aug 5, 2024 · 3 comments

Comments

@shef3r
Copy link
Contributor

shef3r commented Aug 5, 2024

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)

@dpaulino
Copy link
Contributor

dpaulino commented Aug 6, 2024

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?

@shef3r shef3r mentioned this issue Aug 6, 2024
@shef3r
Copy link
Contributor Author

shef3r commented Aug 6, 2024

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
Copy link
Contributor Author

shef3r commented Aug 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants