getServiceLocator()->get(MediaService::SERVICE_ID); $mediaSource = $mediaService->getMediaSource($urlParts['host']); $mediaId = (isset($urlParts['path'])) ? trim($urlParts['path'], '/') : ''; return new MediaAsset($mediaSource, $mediaId); } elseif (isset($urlParts['scheme']) && in_array($urlParts['scheme'], ['http','https'])) { return new MediaAsset(new HttpSource(), $url); } else { throw new TaoMediaException('Cannot resolve ' . $url); } } /** * @deprecated * @return \oat\oatbox\service\ServiceManager */ public function getServiceLocator() { return ServiceManager::getServiceManager(); } }