/** * @return string * @throws LiveBroadcastInputException */ public function generateInputCmd() { $inputFilename = $this->media->getFileLocation(); if (!file_exists($inputFilename)) { throw new LiveBroadcastInputException(sprintf('Could not find input file %s', $inputFilename)); } return sprintf('-re -i %s', escapeshellarg($inputFilename)); }
/** * Test the getFileLocation method */ public function testFileLocation() { $input = new MediaFile(); self::assertEquals('', $input->getFileLocation()); $input->setFileLocation('/tmp/file/location'); self::assertEquals('/tmp/file/location', $input->getFileLocation()); $input->setFileLocation('/tmp/test'); self::assertEquals('/tmp/test', $input->getFileLocation()); }