]> git.sesse.net Git - vlc/blobdiff - bindings/python-ctypes/override.py
python-ctypes: override Instance.media_new to allow to directly pass item options
[vlc] / bindings / python-ctypes / override.py
index 2813ac111140d17d1a3284e7bd1de2646ba74e39..9f9d6a844ec737e3756680aeef965d0bb5743f05 100644 (file)
@@ -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