Browse Source

Use stream name as nginx application name, fixes #1

master
Shyim 7 years ago
parent
commit
d0dce24305
  1. 2
      src/Component/NginxConfigGenerator.php
  2. 2
      src/Controller/Streams.php

2
src/Component/NginxConfigGenerator.php

@ -95,7 +95,7 @@ rtmp {
$configPush[] = "\t\t\tpush " . $this->buildUrl($endpoint) . ';'; $configPush[] = "\t\t\tpush " . $this->buildUrl($endpoint) . ';';
} }
$applicationName = sprintf('%s_%s', $stream->getUser()->getUsername(), $stream->getId()); $applicationName = sprintf('%s/%s', $stream->getUser()->getUsername(), $stream->getName());
$vhost .= sprintf(self::VHOST, $applicationName, implode("\n", $configPush)); $vhost .= sprintf(self::VHOST, $applicationName, implode("\n", $configPush));
} }
} }

2
src/Controller/Streams.php

@ -73,7 +73,7 @@ class Streams extends Controller
$host = parse_url($this->container->getParameter('appHost'), PHP_URL_HOST); $host = parse_url($this->container->getParameter('appHost'), PHP_URL_HOST);
$data = $stream->jsonSerialize(); $data = $stream->jsonSerialize();
$data['streamUrl'] = sprintf('rtmp://%s/%s', $host, $stream->getUser()->getUsername() . '_' . $stream->getId()); $data['streamUrl'] = sprintf('rtmp://%s/%s', $host, $stream->getUser()->getUsername() . '_' . $stream->getName());
return new JsonResponse($data); return new JsonResponse($data);
} }

Loading…
Cancel
Save