Skip to content
Browse files

Merge pull request #34 from niallsmart/hexxeh

Tell VLC to play stream immediately (otherwise URL times out)
  • Loading branch information...
2 parents a30d01a + f1c7b82 commit 5570f0b35d042091d3fb8ac0fedc706a99fe9620 @Hexxeh committed Mar 24, 2013
Showing with 8 additions and 1 deletion.
  1. +8 −1 examples/play.py
View
9 examples/play.py
@@ -8,7 +8,14 @@
def track_uri_callback(sp, result):
if sys.platform == "darwin":
- os.system("open -a VLC \""+result["uri"]+"\"")
+ script = """
+ tell application "VLC"
+ Stop
+ OpenURL "%s"
+ Play
+ end tell
+ """ % result["uri"]
+ os.system("osascript -e '%s'" % script)
elif sys.platform == "linux" or sys.platform == "linux2" or sys.platform[:7] == "freebsd":
os.system("vlc \""+result["uri"]+"\"")
else:

0 comments on commit 5570f0b

Please sign in to comment.
Something went wrong with that request. Please try again.