ability to give several arguments in 'player_name' config option
This commit is contained in:
parent
f2d0b514c6
commit
1006e9ff83
1 changed files with 11 additions and 3 deletions
|
|
@ -88,8 +88,13 @@ class MediaPlayer(object):
|
||||||
"""
|
"""
|
||||||
Play media.url with the media player.
|
Play media.url with the media player.
|
||||||
"""
|
"""
|
||||||
print 'Invoking "%s %s".' % (player_name, media.url)
|
args = player_name.split(' ')
|
||||||
os.spawnlp(os.P_WAIT, player_name, player_name, media.url)
|
|
||||||
|
player_name = args[0]
|
||||||
|
args.append(media.url)
|
||||||
|
|
||||||
|
print 'Invoking "%s".' % (' '.join(args))
|
||||||
|
os.spawnlp(os.P_WAIT, player_name, *args)
|
||||||
|
|
||||||
def _play_rtmp(self, media, player_name, args):
|
def _play_rtmp(self, media, player_name, args):
|
||||||
"""
|
"""
|
||||||
|
|
@ -124,11 +129,14 @@ class MediaPlayer(object):
|
||||||
|
|
||||||
assert args is not None
|
assert args is not None
|
||||||
|
|
||||||
|
player_name = player_name.split(' ')
|
||||||
|
args = args.split(' ')
|
||||||
|
|
||||||
print ':: Streaming from %s' % media_url
|
print ':: Streaming from %s' % media_url
|
||||||
print ':: to %s %s' % (player_name, args)
|
print ':: to %s %s' % (player_name, args)
|
||||||
print ':: %s' % rtmp
|
print ':: %s' % rtmp
|
||||||
p1 = Popen(rtmp.split(), stdout=PIPE)
|
p1 = Popen(rtmp.split(), stdout=PIPE)
|
||||||
Popen([player_name, args], stdin=p1.stdout, stderr=PIPE)
|
Popen(player_name + args, stdin=p1.stdout, stderr=PIPE)
|
||||||
|
|
||||||
def _find_in_path(self,path, filename):
|
def _find_in_path(self,path, filename):
|
||||||
for i in path.split(':'):
|
for i in path.split(':'):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue