/** * @return string * @throws LiveBroadcastInputException */ public function generateInputCmd() { $inputUrl = $this->media->getUrl(); if (filter_var($inputUrl, FILTER_VALIDATE_URL) === false) { throw new LiveBroadcastInputException(sprintf('Invalid URL %s', $inputUrl)); } return sprintf('-re -i %s', escapeshellarg($inputUrl)); }
/** * Test the __toString method */ public function testToString() { $input = new MediaUrl(); self::assertEquals('', (string) $input); $input->setUrl('https://github.com/Martin1982/live-broadcast-bundle'); self::assertEquals('https://github.com/Martin1982/live-broadcast-bundle', $input->getUrl()); }