-
Notifications
You must be signed in to change notification settings - Fork 3
/
player.py
59 lines (42 loc) · 1.81 KB
/
player.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# =============================================================================
# Module: player.py
# Contacts: Edward Li ([email protected])
# =============================================================================
"""___DESC___
"""
# =============================================================================
# IMPORTS
# =============================================================================
import subprocess
# =============================================================================
# CLASSES
# =============================================================================
class Player(object):
# =========================================================================
def __init__(self, filePath=None):
self._filePath = filePath
self._proc = None
# =========================================================================
def start(self):
print(self.args)
# =========================================================================
def stop(self):
print('stopped')
'''
# =========================================================================
def startstop(self, signal=None):
if signal == 'start' and not self.cmdProc:
self.cmdProc = subprocess.Popen(self.playCmd, shell=True,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
elif signal == 'stop' and self.cmdProc:
self.cmdProc.communicate(input='q')
self.cmdProc = None
else:
return
'''
# =========================================================================
@property
def args(self):
return 'ffplay {option}'.format(option=self._filePath)
# =============================================================================