Metadata-Version: 2.4
Name: ovos-media-plugin-ffplay
Version: 0.0.3a3
Summary: ffplay plugin for ovos
Author-email: JarbasAI <jarbasai@mailfence.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/OpenVoiceOS/ovos-media-plugin-ffplay
Keywords: ovos,audio,video,OCP,plugin
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: ovos-plugin-manager<3.0.0,>=2.2.0
Requires-Dist: ovos-utils>=0.5.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: ovoscope[media]>=0.20.0a1; extra == "test"
Dynamic: license-file

# ovos-media-plugin-ffplay

ffplay plugin for [ovos-audio](https://github.com/OpenVoiceOS/ovos-audio) and [ovos-media](https://github.com/OpenVoiceOS/ovos-media)

## Install

`pip install ovos-media-plugin-ffplay`

## Configuration

edit your mycroft.conf with any ffplay players you want to expose

```javascript
{
  "Audio": {
    "backends": {
      "ffplay": {
        "type": "ovos_ffplay",
        "active": true
      }
    }
  }
}
```

## Python usage

direct access to ffplay is provided via `FFPlayAudioPlayer`

```python
import time
from ovos_media_plugin_ffplay.ffplay import FFPlayAudioPlayer

# Example usage: playing an MP3 file from a URL
url = "https://github.com/OpenVoiceOS/ovos-skill-easter-eggs/raw/refs/heads/dev/sounds/sing/drnimpo-robots.mp3"

# Create player instance
player = FFPlayAudioPlayer()

# Play media
player.play(url, volume=100)
print(f"Playback time: {player.playback_time} ms")
time.sleep(5)
print(f"Playback time: {player.playback_time} ms")

# Pause media
player.pause()
time.sleep(2)
print(f"Playback time: {player.playback_time} ms")

# Resume media
player.resume()
time.sleep(1)
player.set_track_position(65)
print(f"Playback time: {player.playback_time} ms")
print(f"Volume: {player.volume}")
time.sleep(3)
player.set_volume(30)
print(f"Volume: {player.volume}")
time.sleep(6)
player.set_volume(70)
print(f"Volume: {player.volume}")
player.wait_for_end_of_playback()

```
