Name | dbus-mediaplayer JSON |
Version |
2024.8.0
JSON |
| download |
home_page | None |
Summary | Currently playng media using DBus |
upload_time | 2024-08-07 12:39:13 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7.0 |
license | None |
keywords |
lnxlink
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# DBus MediaPlayer
[![PyPI](https://img.shields.io/pypi/v/dbus-mediaplayer.svg)](https://pypi.python.org/pypi/dbus-mediaplayer)
![Python versions](https://img.shields.io/pypi/pyversions/dbus-mediaplayer.svg)
![License](https://img.shields.io/pypi/l/dbus-mediaplayer.svg)
The `dbus-mediaplayer` library empowers Python applications to interact with media players on your system through the D-Bus communication protocol. This enables you to retrieve metadata (like song titles and artists), control playback (play, pause, next, etc.), and potentially even access features specific to certain media players.
## Key Features
* **Media Player Discovery:** Enumerate available media players on your system.
* **Metadata Access:** Retrieve current song information (title, artist, album, etc.).
* **Playback Control:** Play, pause, skip tracks.
* **Real-time Updates:** Utilizes callback functions to provide instant notifications of media player state changes, ensuring your application stays up-to-date.
## Requirements
* Python 3.7 or later
* `dasdbus` library
## Installation
Install the library using pip:
```bash
pip install dbus-mediaplayer
```
## Usage
This library offers two primary usage approaches:
### Command-Line Interaction (Optional)
If you prefer a quick way to view information or control playback, you can potentially execute the dbus-mediaplayer script directly. For more extensive programmatic control, I would recommend using the library within your Python code.
### Programmatic Control
Import the DBusMediaPlayers class from your Python code:
```python
from dbus_mediaplayer import DBusMediaPlayers
def callback(players):
# Handle the list of media player objects here
print(players)
# Create an instance of the class
media_player = DBusMediaPlayers(callback)
# Control media playback (replace "PlayPause" with desired methods like "Play", "Pause", "Next", etc.)
media_player.control_media("PlayPause")
# Keep the app running
while True:
time.sleep(1)
```
## Inspiration
This library was inspired by the MPRIS2 library, which utilizes the `dbus-python` library. However, `dbus-mediaplayer` aims to offer a more widely deployable solution, removing reliance on external dependencies.
## Future Features
While dbus-mediaplayer provides a solid foundation for interacting with media players, there's room for growth. Here are some features it is missing and could be implemented in future development:
* **Seek Position Control:** Allow users to set the playback position within a media track.
* **Volume Control:** Implement methods for adjusting media player volume. Note that volume control support may vary across different media players and platforms.
* **Playback Capabilities:** Provide methods to determine if a media player supports specific playback actions like next, previous, stop, and seek. This will allow users to tailor their interactions based on player capabilities.
Raw data
{
"_id": null,
"home_page": null,
"name": "dbus-mediaplayer",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": null,
"keywords": "lnxlink",
"author": null,
"author_email": "bkbilly <bkbilly@hotmail.com>",
"download_url": "https://files.pythonhosted.org/packages/69/f9/a423f269ad3b15e7c72daecb98cefe00eede369b6583a4daf0f2135cd429/dbus_mediaplayer-2024.8.0.tar.gz",
"platform": null,
"description": "# DBus MediaPlayer\n\n[![PyPI](https://img.shields.io/pypi/v/dbus-mediaplayer.svg)](https://pypi.python.org/pypi/dbus-mediaplayer)\n![Python versions](https://img.shields.io/pypi/pyversions/dbus-mediaplayer.svg)\n![License](https://img.shields.io/pypi/l/dbus-mediaplayer.svg)\n\nThe `dbus-mediaplayer` library empowers Python applications to interact with media players on your system through the D-Bus communication protocol. This enables you to retrieve metadata (like song titles and artists), control playback (play, pause, next, etc.), and potentially even access features specific to certain media players.\n\n## Key Features\n\n* **Media Player Discovery:** Enumerate available media players on your system.\n* **Metadata Access:** Retrieve current song information (title, artist, album, etc.).\n* **Playback Control:** Play, pause, skip tracks.\n* **Real-time Updates:** Utilizes callback functions to provide instant notifications of media player state changes, ensuring your application stays up-to-date.\n\n## Requirements\n\n* Python 3.7 or later\n* `dasdbus` library\n\n## Installation\n\nInstall the library using pip:\n\n```bash\npip install dbus-mediaplayer\n```\n\n## Usage\n\nThis library offers two primary usage approaches:\n\n### Command-Line Interaction (Optional)\n\nIf you prefer a quick way to view information or control playback, you can potentially execute the dbus-mediaplayer script directly. For more extensive programmatic control, I would recommend using the library within your Python code.\n\n### Programmatic Control\n\nImport the DBusMediaPlayers class from your Python code:\n\n```python\nfrom dbus_mediaplayer import DBusMediaPlayers\n\ndef callback(players):\n # Handle the list of media player objects here\n print(players)\n\n# Create an instance of the class\nmedia_player = DBusMediaPlayers(callback)\n\n# Control media playback (replace \"PlayPause\" with desired methods like \"Play\", \"Pause\", \"Next\", etc.)\nmedia_player.control_media(\"PlayPause\")\n\n# Keep the app running\nwhile True:\n time.sleep(1)\n```\n\n## Inspiration\nThis library was inspired by the MPRIS2 library, which utilizes the `dbus-python` library. However, `dbus-mediaplayer` aims to offer a more widely deployable solution, removing reliance on external dependencies.\n\n## Future Features\nWhile dbus-mediaplayer provides a solid foundation for interacting with media players, there's room for growth. Here are some features it is missing and could be implemented in future development:\n\n * **Seek Position Control:** Allow users to set the playback position within a media track.\n * **Volume Control:** Implement methods for adjusting media player volume. Note that volume control support may vary across different media players and platforms.\n * **Playback Capabilities:** Provide methods to determine if a media player supports specific playback actions like next, previous, stop, and seek. This will allow users to tailor their interactions based on player capabilities.\n",
"bugtrack_url": null,
"license": null,
"summary": "Currently playng media using DBus",
"version": "2024.8.0",
"project_urls": {
"Source Code": "https://github.com/bkbilly/dbus_mediaplayer"
},
"split_keywords": [
"lnxlink"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b2bcf716ba0d518884c9836389095acd238ff44d66f70f9a5421d439e6fcb303",
"md5": "4d02ef269a87fa86c7b0c40b7476f84c",
"sha256": "43cb31d3e9cbba3e50e9e283a0f0684dc366703a8f59bf4541ce69fb3c7f2dae"
},
"downloads": -1,
"filename": "dbus_mediaplayer-2024.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4d02ef269a87fa86c7b0c40b7476f84c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.0",
"size": 5761,
"upload_time": "2024-08-07T12:39:12",
"upload_time_iso_8601": "2024-08-07T12:39:12.065315Z",
"url": "https://files.pythonhosted.org/packages/b2/bc/f716ba0d518884c9836389095acd238ff44d66f70f9a5421d439e6fcb303/dbus_mediaplayer-2024.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "69f9a423f269ad3b15e7c72daecb98cefe00eede369b6583a4daf0f2135cd429",
"md5": "3955d200f57b559401164c99dfa55605",
"sha256": "e569948e8a900a69189335907352bfc7496683858cdf41b1c1d202690603a955"
},
"downloads": -1,
"filename": "dbus_mediaplayer-2024.8.0.tar.gz",
"has_sig": false,
"md5_digest": "3955d200f57b559401164c99dfa55605",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 5063,
"upload_time": "2024-08-07T12:39:13",
"upload_time_iso_8601": "2024-08-07T12:39:13.257032Z",
"url": "https://files.pythonhosted.org/packages/69/f9/a423f269ad3b15e7c72daecb98cefe00eede369b6583a4daf0f2135cd429/dbus_mediaplayer-2024.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-07 12:39:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bkbilly",
"github_project": "dbus_mediaplayer",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "dbus-mediaplayer"
}