57 if (!Loader::includeModule(
'seo'))
60 $error->
addError(
'SEO_NOT_INCLUDED');
61 $result->setError($error);
62 $result->setResult(
false);
67 $response = Media\Service::getVideo($videoId);
68 if ($response->isSuccess())
70 $responseData = $response->getData();
71 if ($responseData[
'count'])
73 $responseItem = $responseData[
'items'][0];
74 if ($responseItem[
'content_restricted'] && $responseItem[
'content_restricted_message'])
79 Encoding::convertEncoding(
80 $responseItem[
'content_restricted_message'],
85 $result->setError($error);
90 'player' => $responseItem[
'player'],
91 'preview' => $responseItem[
'image'][min(count($responseItem[
'image']), 4) - 1],
97 $result->setResult([]);
103 foreach ($response->getErrors() as $err)
105 $error->
addError($err->getCode(), $err->getMessage());
107 $result->setError($error);