mirror of
https://github.com/brmlab/brmdoor.git
synced 2025-06-08 11:44:01 +02:00
brmd: Switch streaming on brmvid when record switch is pressed
This commit is contained in:
parent
d66a389c77
commit
593f34fe9b
1 changed files with 14 additions and 0 deletions
14
brmd/brmd.pl
14
brmd/brmd.pl
|
@ -94,6 +94,14 @@ sub record_str {
|
||||||
$record ? 'ON AIR' : 'OFF AIR';
|
$record ? 'ON AIR' : 'OFF AIR';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub stream_switch {
|
||||||
|
my ($s) = @_;
|
||||||
|
system('ssh brmstream@brmvid "echo '.($s?'START':'STOP').' >/tmp/brmstream"');
|
||||||
|
}
|
||||||
|
|
||||||
|
sub record_start { stream_switch(1); }
|
||||||
|
sub record_stop { stream_switch(0); }
|
||||||
|
|
||||||
sub topic_update {
|
sub topic_update {
|
||||||
my $newtopic = $topic;
|
my $newtopic = $topic;
|
||||||
if ($status) {
|
if ($status) {
|
||||||
|
@ -118,6 +126,12 @@ sub status_update {
|
||||||
sub record_update {
|
sub record_update {
|
||||||
my ($newrecord) = @_;
|
my ($newrecord) = @_;
|
||||||
$record = $newrecord;
|
$record = $newrecord;
|
||||||
|
if ($record) {
|
||||||
|
record_start();
|
||||||
|
} else {
|
||||||
|
record_stop();
|
||||||
|
}
|
||||||
|
|
||||||
my $st = record_str();
|
my $st = record_str();
|
||||||
$record and $st .= "\002 http://nat.brmlab.cz:8090/brmstream.asf";
|
$record and $st .= "\002 http://nat.brmlab.cz:8090/brmstream.asf";
|
||||||
$irc->yield (privmsg => $channel => "[brmvideo] update: \002$st" );
|
$irc->yield (privmsg => $channel => "[brmvideo] update: \002$st" );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue