Download the PHP package dweb-x/volumio without Composer
On this page you can find all versions of the php package dweb-x/volumio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dweb-x/volumio
More information about dweb-x/volumio
Files in dweb-x/volumio
Package volumio
Short Description Volumio API wrapper for Laravel
License MIT
Homepage https://github.com/dweb-x/volumio
Informations about the package volumio
Volumio API wrapper for Laravel
Introduction
This package provides a simple and elegant way to interact with the Volumio audio player API from your Laravel application. Volumio is a free and open source Linux distribution designed for music playback with a focus on sound quality.
With this package, you can:
- Control playback (play, pause, stop, next, previous)
- Adjust volume
- Manage the queue
- Get player state and queue information
- Control playback modes (repeat, random)
- Manage playlists
- Browse and search the music library
- Add items to the queue or replace the queue
- Get collection statistics
- Manage multi-room zones
- Get system information
- Set up push notifications
This package is compatible with Laravel 12 and connects to the Volumio REST API.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Configuration
The package comes with a configuration file that allows you to customize how the Volumio API client behaves. Here's a detailed explanation of each configuration option:
Base URL
This is the URL of your Volumio instance. By default, it points to http://localhost:3000, which is the standard address for a Volumio instance running on the same machine. If your Volumio instance is running on a different machine or port, you should set the VOLUMIO_API_URL environment variable in your .env file:
Timeout
This setting controls how long (in seconds) the client will wait for a response from the Volumio API before timing out. The default is 10 seconds, which should be sufficient for most use cases. If you're experiencing timeout issues, you can increase this value in your .env file:
Retries
If an API request fails, the client will automatically retry the request. This setting controls how many retry attempts will be made before giving up. The default is 3 retries. You can adjust this in your .env file:
The client uses an exponential backoff strategy for retries, meaning each subsequent retry will wait longer before attempting again.
HTTP Options
These are the default HTTP headers that will be sent with every request to the Volumio API. The default headers are set to work with the Volumio API's JSON responses. You typically won't need to modify these.
Usage
You can use the facade to interact with the Volumio API:
Or you can inject the Volumio service:
Response Format
All methods return an array containing the response from the Volumio API. The exact structure of the response depends on the method called. For example:
Error Handling
The package will automatically retry failed requests based on your configuration. If all retry attempts fail, an exception will be thrown. You should wrap your API calls in a try-catch block to handle potential errors:
Testing
Credits
License
The MIT License (MIT). Please see License File for more information.