Dislay information about the video.

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

@return Response HTTP response
166639
public function info(Request $request, Response $response)
    {
        $url = $request->getQueryParam('url') ?: $request->getQueryParam('v');

        if (isset($url) && !empty($url)) {
            $this->video = new Video($url, $this->getFormat($request), $this->getPassword($request));

            if ($this->config->convert && $request->getQueryParam('audio')) {
                // We skip the info page and get directly to the download.
                return $response->withRedirect(
                    $this->container->get('router')->pathFor('download').
                    '?'.http_build_query($request->getQueryParams())
                );
            } else {
                return $this->getInfoResponse($request, $response);
            }
        } else {
            return $response->withRedirect($this->container->get('router')->pathFor('index'));
        }
    }
860479
protected function sendResetLinkResponse(Request $request, $response)
    {
        if ($request->expectsJson()) {
            return response()->json([
                'status' => trans($response)
            ]);
        }
        return back()->with('status', trans($response));
    }
856117
private function getStream(Request $request, Response $response)
    {
        if (isset($this->video->entries)) {
            if ($this->config->convert && $request->getQueryParam('audio')) {
                $stream = new ConvertedPlaylistArchiveStream($this->video);
            } else {
                $stream = new PlaylistArchiveStream($this->video);
            }
            $response = $response->withHeader('Content-Type', 'application/zip');
            $response = $response->withHeader(
                'Content-Disposition',
                'attachment; filename="'.$this->video->title.'.zip"'
            );

            return $response->withBody($stream);
        } elseif ($this->video->protocol == 'rtmp') {
            $response = $response->withHeader('Content-Type', 'video/'.$this->video->ext);
            $body = new Stream($this->video->getRtmpStream());
        } elseif ($this->video->protocol == 'm3u8' || $this->video->protocol == 'm3u8_native') {
            $response = $response->withHeader('Content-Type', 'video/'.$this->video->ext);
            $body = new Stream($this->video->getM3uStream());
        } else {
            $stream = $this->video->getHttpResponse(['Range' => $request->getHeader('Range')]);

            $response = $response->withHeader('Content-Type', $stream->getHeader('Content-Type'));
            $response = $response->withHeader('Content-Length', $stream->getHeader('Content-Length'));
            $response = $response->withHeader('Accept-Ranges', $stream->getHeader('Accept-Ranges'));
            $response = $response->withHeader('Content-Range', $stream->getHeader('Content-Range'));
            if ($stream->getStatusCode() == 206) {
                $response = $response->withStatus(206);
            }

            if (isset($this->video->downloader_options->http_chunk_size)) {
                // Workaround for Youtube throttling the download speed.
                $body = new YoutubeStream($this->video);
            } else {
                $body = $stream->getBody();
            }
        }
        if ($request->isGet()) {
            $response = $response->withBody($body);
        }
        $response = $response->withHeader(
            'Content-Disposition',
            'attachment; filename="'.
                $this->video->getFilename().'"'
        );

        return $response;
    }
1290348
protected function setUriHeader(Response $response, Request $request)
    {
        $response->header('X-PJAX-URL', $request->getRequestUri());

        return $this;
    }
76675
protected function sendResetResponse(Request $request, $response)
    {
        if ($request->expectsJson()) {
            return response()->json([
                'status' => trans($response)
            ]);
        }
        return redirect($this->redirectPath())
            ->with('status', trans($response));
    }
524529
public function renderRequest(Request $request, Response $response, RenderingContext $renderingContext)
    {
        $contentObjectRenderer = new ContentObjectRenderer();
        $content = $contentObjectRenderer->cObjGetSingle('RECORDS', $this->resolveRenderingConfiguration($request, $renderingContext));
        $response->setContent($content);
    }
842022
public function load(Request $request, Response $response) {
        $config = $this->app->package('global')->service('captcha-main');

        //if no config
        if(!$config
            || !isset($config['token'], $config['secret'])
            || $config['token'] === '<GOOGLE CAPTCHA TOKEN>'
            || $config['secret'] === '<GOOGLE CAPTCHA SECRET>'
        )
        {
            return $this;
        }

        //render the key
        $key = $config['token'];

        $response->setResults('captcha', $key);

        return $this;
    }
1221396
public function send(Request $request)
    {
        $response   = new DeleteResponse();
        $rpbPutReq  = $this->createRpbMessage($request);

        $this->client->send($rpbPutReq, RiakMessageCodes::DEL_REQ, RiakMessageCodes::DEL_RESP);

        return $response;
    }
147614
public function json(Request $request, Response $response)
    {
        $url = $request->getQueryParam('url');

        if (isset($url)) {
            try {
                $this->video = new Video($url, $this->getFormat($request), $this->getPassword($request));

                return $response->withJson($this->video->getJson());
            } catch (Exception $e) {
                return $response->withJson(['error' => $e->getMessage()])
                    ->withStatus(500);
            }
        } else {
            return $response->withJson(['error' => 'You need to provide the url parameter'])
                ->withStatus(400);
        }
    }
1130948
public function call(Request $request, Response $response) : Response {

		return call_user_func($this->callable, $request, $response, $this->slugs);

	}
96056
public function dispatch(Request $request, Response $response = null)
	{
		$this->tranlate();
		$allowed = $this->hasIdentity();
		$this->view->flashMessenger = $this->flashMessenger();
		if($allowed instanceof \Zend\Http\PhpEnvironment\Response)
		     return $allowed;
		return parent::dispatch($request, $response);
	}
1147742
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')
        );
    }
819341
public function modifyResponse(Request $request, Response $response)
    {
        $app = $this->app;

        if (is_admin_panel() || $app->runningInConsole() || $this->isDebugbarRequest() || $request->ajax()) {
            return $response;
        }

        $this->injectAdminBar($response);

        return $response;
    }
904171
private function getConvertedResponse(Request $request, Response $response)
    {
        $response = $response->withHeader(
            'Content-Disposition',
            'attachment; filename="'.
            $this->video->getFileNameWithExtension($request->getQueryParam('customFormat')).'"'
        );
        $response = $response->withHeader('Content-Type', 'video/'.$request->getQueryParam('customFormat'));

        if ($request->isGet() || $request->isPost()) {
            $process = $this->video->getConvertedStream(
                $request->getQueryParam('customBitrate'),
                $request->getQueryParam('customFormat')
            );
            $response = $response->withBody(new Stream($process));
        }

        return $response;
    }
270113
public function dropsDownloadAction(Request $request)
    {
        $drops = $this->decodeIdsString($request, Drop::class);
        $dropzone = $drops[0]->getDropzone();
        $this->checkPermission('EDIT', $dropzone->getResourceNode(), [], true);
        $fileName = $dropzone->getResourceNode()->getName();

        $archive = $this->manager->generateArchiveForDrops($drops);

        $response = new StreamedResponse();
        $response->setCallBack(
            function () use ($archive) {
                readfile($archive);
            }
        );
        $response->headers->set('Content-Transfer-Encoding', 'octet-stream');
        $response->headers->set('Content-Type', 'application/force-download');
        $response->headers->set('Content-Disposition', 'attachment; filename='.urlencode($fileName.'.zip'));
        $response->headers->set('Content-Type', 'application/zip; charset=utf-8');
        $response->headers->set('Connection', 'close');

        return $response->send();
    }
19144
protected function injectToolbar(Response $response, Request $request)
    {
        if (function_exists('mb_stripos')) {
            $posrFunction = 'mb_strripos';
            $substrFunction = 'mb_substr';
        } else {
            $posrFunction = 'strripos';
            $substrFunction = 'substr';
        }

        $content = $response->getContent();
        $pos = $posrFunction($content, '</body>');

        if ($pos !== false) {
            $session = $request->getSession();

            $editMode = $session->get('hexmedia_content_edit_mode') === true;

            $toolbar = $this->twig->render(
                "HexmediaAdministratorBundle:Toolbar:toolbar.html.twig",
                [
                    'edit_mode' => $editMode,
                    'edit_mode_class' => $editMode ? 'in-edit-mode' : ''
                ]
            );

            $content = $substrFunction($content, 0, $pos) . $toolbar . $substrFunction($content, $pos);

            $response->setContent($content);
        }
    }
416000
public function makeResponse(Request $request, Response $response, Responder $responder): Response
    {
        return $responder(
            $request,
            $response,
            new Payload(
                $this->getCode(),
                '',
                $this->getMessage()
            )
        );
    }