summaryrefslogtreecommitdiff
path: root/mpv.py
diff options
context:
space:
mode:
Diffstat (limited to 'mpv.py')
-rw-r--r--mpv.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/mpv.py b/mpv.py
index 2131fa2..993cf67 100644
--- a/mpv.py
+++ b/mpv.py
@@ -495,8 +495,12 @@ class MPV(object):
def playlist_prev(self, mode='weak'):
self.command('playlist_prev', mode)
- def loadfile(self, filename, mode='replace'):
- self.command('loadfile', filename.encode(fs_enc), mode)
+ @staticmethod
+ def _encode_options(options):
+ return ','.join('{}={}'.format(str(key), str(val)) for key, val in options.items())
+
+ def loadfile(self, filename, mode='replace', **options):
+ self.command('loadfile', filename.encode(fs_enc), mode, MPV._encode_options(options))
def loadlist(self, playlist, mode='replace'):
self.command('loadlist', playlist.encode(fs_enc), mode)