You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
17 years ago | |
|---|---|---|
| .. | ||
| Makefile | 17 years ago | |
| README | 17 years ago | |
| TODO | 17 years ago | |
| footer.py | 17 years ago | |
| generate.py | 17 years ago | |
| header.py | 17 years ago | |
| override.py | 17 years ago | |
README
* Python ctypes-based bindings
The bindings use ctypes to directly call the libvlc dynamic lib, and
the code is generated from the include files defining the public API.
** Building
To generate the vlc.py module and its documentation, use
make
Documentation building needs epydoc.
** Layout
The module offers two ways of accessing the API - a raw access to all
exported methods, and more convenient wrapper classes :
- Raw access: methods are available as attributes of the vlc
module. Use their docstring (introspective shells like ipython are
your friends) to explore them.
- Wrapper classes: most major structures of the libvlc API (Instance,
Media, MediaPlayer, etc) are wrapped as classes, with shorter method
names.
** Using the module
On win32, the simplest way is to put the vlc.py file in the same
directory as the libvlc.dll file (standard location:
c:\Program Files\VideoLAN\VLC ).
- Using raw access:
>>> import vlc
>>> vlc.libvlc_get_version()
'1.0.0 Goldeneye'
>>> e=vlc.VLCException()
>>> i=vlc.libvlc_new(0, [], e)
>>> i
<vlc.Instance object at 0x8384a4c>
>>> vlc.libvlc_audio_get_volume(i,e)
50
- Using wrapper classes:
>>> import vlc
>>> i=vlc.Instance('--no-audio', '--fullscreen')
>>> i.audio_get_volume()
50
>>> m=i.media_new('/tmp/foo.avi')
>>> m.get_mrl()
'/tmp/foo.avi'
>>> p=i.media_player_new(m)
>>> p.play()
or shorter:
>>> import vlc
>>> p=vlc.MediaPlayer('/tmp/foo.avi')
>>> p.play()