diff options
author | jaseg <git@jaseg.net> | 2017-05-07 15:59:16 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2017-05-07 16:01:51 +0200 |
commit | 4168064adee8227b193c2d9ef799cdcc8fde5aa9 (patch) | |
tree | 3f483a4b4285a3564e46c55fc3345f44303ead36 | |
parent | 28fdc21a2444c3d8005405bb4df369b7552ca244 (diff) | |
download | python-mpv-4168064adee8227b193c2d9ef799cdcc8fde5aa9.tar.gz python-mpv-4168064adee8227b193c2d9ef799cdcc8fde5aa9.tar.bz2 python-mpv-4168064adee8227b193c2d9ef799cdcc8fde5aa9.zip |
README: Add playlist example
-rw-r--r-- | README.md | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -58,3 +58,21 @@ player.wait_for_playback() del player ``` + +```python +#!/usr/bin/env python3 +import mpv + +player = mpv.MPV(ytdl=True, input_default_bindings=True, input_vo_keyboard=True) + +player.playlist_append('https://youtu.be/PHIGke6Yzh8') +player.playlist_append('https://youtu.be/Ji9qSuQapFY') +player.playlist_append('https://youtu.be/6f78_Tf4Tdk') + +player.playlist_pos = 0 + +while True: + # To modify the playlist, use player.playlist_{append,clear,move,remove}. player.playlist is read-only + print(player.playlist) + player.wait_for_playback() +``` |