Skip to content

Commit

Permalink
Add mute support
Browse files Browse the repository at this point in the history
  • Loading branch information
palaviv committed Oct 30, 2016
1 parent 732e68e commit 6bcd0e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ down -> volume down.
right -> jump 30 seconds forward.
left -> jump 30 seconds backwards.
s -> stop.
m -> toggle between mute and unmute.
```

Dependencies
Expand Down
6 changes: 5 additions & 1 deletion caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def parse_range(self, file_size):
def do_GET(self):
self.protocol_version = "HTTP/1.1"
content_type = mimetypes.guess_type(self.path)
print(self.path, content_type)

with open(self.path, "rb") as f:
f.seek(0, 2)
Expand Down Expand Up @@ -102,6 +101,11 @@ def handle_input(server_thread, dev, mc):
elif key == readchar.key.LEFT:
mc.update_status(blocking=True)
mc.seek(mc.status.current_time - 30)
elif key == "m":
if dev.status.volume_muted:
dev.set_volume_muted(False)
else:
dev.set_volume_muted(True)


def get_args():
Expand Down

0 comments on commit 6bcd0e6

Please sign in to comment.