controllers/DownloadController.php
private function getRemuxStream(Request $request, Response $response)
    {
        if (!$this->config->remux) {
            throw new Exception(_('You need to enable remux mode to merge two formats.'));
        }
        $stream = $this->video->getRemuxStream();
        $response = $response->withHeader('Content-Type', 'video/x-matroska');
        if ($request->isGet()) {
            $response = $response->withBody(new Stream($stream));
        }

        return $response->withHeader(
            'Content-Disposition',
            'attachment; filename="'.$this->video->getFileNameWithExtension('mkv')
        );
    }
private function getRemuxStream(Request $request, Response $response)
    {
        if (!$this->config->remux) {
            throw new Exception(_('You need to enable remux mode to merge two formats.'));
        }
        $stream = $this->video->getRemuxStream();
        $response = $response->withHeader('Content-Type', 'video/x-matroska');
        if ($request->isGet()) {
            $response = $response->withBody(new Stream($stream));
        }

        return $response->withHeader(
            'Content-Disposition',
            'attachment; filename="'.$this->video->getFileNameWithExtension('mkv')
        );
    }
private function getRemuxStream ( Request $ request , Response $ response ) { if ( ! $ this -> config -> remux ) { throw new Exception ( _ ( 'You need to enable remux mode to merge two formats.' ) ) ; } $ stream = $ this -> video -> getRemuxStream ( ) ; $ response = $ response -> withHeader ( 'Content-Type' , 'video/x-matroska' ) ; if ( $ request -> isGet ( ) ) { $ response = $ response -> withBody ( new Stream ( $ stream ) ) ; } return $ response -> withHeader ( 'Content-Disposition' , 'attachment; filename="' . $ this -> video -> getFileNameWithExtension ( 'mkv' ) ) ; }
Get a remuxed stream piped through the server.

@param Response $response PSR-7 response
@param Request  $request  PSR-7 request

@return Response HTTP response
Get a remuxed stream piped through the server .