jaseg / python-mpv

Python interface to the awesome mpv media player
https://git.jaseg.de/python-mpv.git
Other
554 stars 69 forks source link

loadfile doesn't seem to do anything #5

Closed nivekuil closed 8 years ago

nivekuil commented 8 years ago
import mpv
player = mpv.MPV()
player.loadfile("/home/nivekuil/test.flv")

Nothing happens when I run this - no mpv processes are created, and the program exits immediately. The file plays correctly when I run mpv from the command line.

Tested on Python 3.5.1, mpv 0.15.0, Arch Linux.

jaseg commented 8 years ago

Are you running this from a python shell or from a standalone script? In case of the latter, try adding player.wait_for_playback() at the end. Otherwise playback will be started, but immediately stopped again as the host process exits.

nivekuil commented 8 years ago

That did the trick, thanks.