Skip to content
Browse files

tell VLC to play stream immediately (otherwise times out)

  • Loading branch information...
1 parent a30d01a commit f1c7b82f314d901f2c86c19ad002222b75dcaf96 Niall Smart committed
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 f1c7b82

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