From 7c8f76438bcb9b78b172ab33c5500d53de9e1852 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 9 Jun 2022 00:14:40 -0600 Subject: [PATCH] Update LiveStream model --- app/Models/LiveStream.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Models/LiveStream.php b/app/Models/LiveStream.php index 3336f3ce..197bd70a 100644 --- a/app/Models/LiveStream.php +++ b/app/Models/LiveStream.php @@ -22,6 +22,21 @@ class LiveStream extends Model $host = config('livestreaming.server.host'); $port = ':' . config('livestreaming.server.port'); $path = '/' . config('livestreaming.server.path') . '?'; + $query = http_build_query([ + 'name' => $this->stream_id, + 'key' => $this->stream_key, + 'ts' => time() + ]); + + return $proto . $host . $port . $path . $query; + } + + public function getStreamRtmpUrl() + { + $proto = 'rtmp://'; + $host = config('livestreaming.server.host'); + $port = ':' . config('livestreaming.server.port'); + $path = '/' . config('livestreaming.server.path') . '/'. $this->stream_id . '?'; $query = http_build_query([ 'key' => $this->stream_key, 'ts' => time()