Skip to content
Snippets Groups Projects
Verified Commit d80a398a authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Zmena aktualizace is_live u streamu

parent 5ccae10d
No related branches found
No related tags found
No related merge requests found
package PiTube::Controller::Nginx;
use Mojo::Base 'Mojolicious::Controller';
use Mojo::Pg::PubSub;
use constant HLS => qr/hls\/([a-z0-9\-]+)(_\w+)?(\/\w+)?\.(m3u8|ts)$/i;
sub callback_rtmp {
my $c = shift;
my $pubsub = Mojo::Pg::PubSub->new(pg => $c->pg);
$pubsub = $pubsub->json('messages');
if ( $c->param('call') =~ /publish/ ) {
my $name = $c->param('name');
......@@ -32,6 +35,11 @@ sub callback_rtmp {
publish_last => '\now()',
publish_user_id => $user->id,
publish_time => ( $c->param('time') // 0 ),
is_live => ( $c->param('call') =~ /done/ ) ? 'f':'t',
});
$pubsub->notify( messages => {
call => $c->param('call'),
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment