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

API Call Help #8

Closed
DocDrydenn opened this issue Oct 6, 2024 · 2 comments
Closed

API Call Help #8

DocDrydenn opened this issue Oct 6, 2024 · 2 comments

Comments

@DocDrydenn
Copy link

DocDrydenn commented Oct 6, 2024

Looking for assistance on how to properly form an API call URL to force MMM-Videoplayer to REPLAY the currently loaded video.

Initially, I set this up in MMM-GPIO-Notifications inside config.js and it worked perfectly:

'16': {
  delay: 2000,
  notifications_low: [
    {
      notification: 'VIDEOPLAYER1',
      payload: 'REPLAY'
    }
  ]
}

Now, I'm moving away from MMM-GPIO-Notifications and to an external python script to handle all my button commands. All went smoothly except for this one command.

I know it has something to do with how MMM-Videoplayer handles notifications... as per the last line of it's config.js entry:

module: 'MMM-Videoplayer',
position: 'fullscreen_above',
config: {
    video: "/modules/MMM-Videoplayer/video/blob.mp4",
    ...
    notification: "VIDEOPLAYER1"  // Unique notification string for this player (to be able to play, pause, restart and next from another modules).
}

I've tried so many different combinations of http:ip:8080/remote?... and just can't get it to work. Any help would be appreciated.

@Snille
Copy link
Owner

Snille commented Oct 7, 2024

You can try everything out with the Remote-Control API (Docs): http://YOUR.IP.TO_THE.MIRROR:8080/api/docs/#/Module%20Control/get_api_notification___notification_____p_

Then you can see the the curl-command that you can use in your script... :)

This is how it looks for me (using the api/docs):
image

PS: for the moment (since v2.29.0) the API from the "MMM-Remote-Control" does not work properly, see here: Jopyth/MMM-Remote-Control#306
But if you use the suggested PR from khassel you should be good... At least it works for me.

@DocDrydenn
Copy link
Author

That was it!

I needed to do it with /api/notification/xxxx/yyyy.
For whatever reason, I was mentally fixed on the /remote?xxxx... format.

Thanks for the help! (Yes, I had already applied the MMM-Remote-Control PR)

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