From: Olivier Aubert Date: Mon, 16 Nov 2009 16:57:01 +0000 (+0100) Subject: python-ctypes: override Instance.media_new to allow to directly pass item options X-Git-Tag: 1.1.0-ff~2418 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c57811067847c2644c2487a749f149057fb448cf;p=vlc python-ctypes: override Instance.media_new to allow to directly pass item options --- diff --git a/bindings/python-ctypes/override.py b/bindings/python-ctypes/override.py index 2813ac1111..9f9d6a844e 100644 --- a/bindings/python-ctypes/override.py +++ b/bindings/python-ctypes/override.py @@ -51,6 +51,18 @@ class Instance: p._instance=self return p + def media_new(self, mrl, *options): + """Create an empty Media Player object + + Options can be specified as supplementary string parameters, e.g. + m=i.media_new('foo.avi', 'sub-filter=marq{marquee=Hello}', 'vout-filter=invert') + """ + e=VLCException() + m=libvlc_media_new(self, mrl, e) + for o in options: + libvlc_media_add_option(m, o, e) + return m + class MediaControl: """Create a new MediaControl instance