jcrossbdn / fpp-after-hours

After hours music player plugin for Falcon Pi Player
2 stars 3 forks source link

[Enhancement] Is there a way to hook into sending a 'mediaCallback' for the stream details #23

Closed kylegrymonprez closed 10 months ago

kylegrymonprez commented 10 months ago

Wondering if there is a way to trigger a FPP mediaCallback event when the stream metadata changes. Would like to get the title and artist info from the stream (if available) in other FPP plugins.

jcrossbdn commented 10 months ago

Fpp-after-hours doesn’t monitor the stream real time so I don’t have a way to capture that in such a way that I can push to fpp callbacks directly.It would be possible to use a script and call the mpc command which will return the stream details which can be parsed out and passed wherever they are needed.  This command will also output a running timestamp (in most cases).Here is what the command outputs:I can also provide detail on what status files are updated to signify that fpp-after-hours is running.I would be willing to generate a script or api endpoint that could be called to return all the relevant information in json output format if that would be useful.  Relevant information would be isFAHrunning, artist, title and would be polled on demand from the calling plug-in or script.Hope this helps!JasonSent from my iPhoneOn Dec 25, 2023, at 3:06 PM, Kyle Grymonprez @.***> wrote: Wondering if there is a way to trigger a FPP mediaCallback event when the stream metadata changes. Would like to get the title and artist info from the stream (if available) in other FPP plugins.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

jcrossbdn commented 10 months ago

Currently you can call this endpoint and it will return a json string that can be parsed out as desired:

/plugin.php?plugin=fpp-after-hours&page=fpp-after-hours.php&nowPlaying&nopage

when no music is playing it will return: {title: "----No music is playing----", detail: ""}

And when music is playing it will return: {"title":"Radio X-MAS: Leona Lewis ft. NeYo - Kiss Me It's Christmas","detail":"[playing] #1\/1 88:25\/0:00 (0%)
volume:100% repeat: off random: off single: off consume: off"}

Closing this request for now.