public function generateFrontUrl(MediaInterface $media)
    {
        $path = null;

        if ($media->getType() === MediaTypes::IMAGE) {
            $path = $this->cacheManager->getBrowserPath($media->getPath(), 'media_front');
        } elseif (in_array($media->getType(), [MediaTypes::VIDEO, MediaTypes::AUDIO, MediaTypes::FLASH])) {
            $path = $this->urlGenerator->generate('ekyna_media_player', ['key' => $media->getPath()], true);
        } else {
            $path = $this->urlGenerator->generate('ekyna_media_download', ['key' => $media->getPath()], true);
        }

        return $path;
    }
public function generateFrontUrl(MediaInterface $media)
    {
        $path = null;

        if ($media->getType() === MediaTypes::IMAGE) {
            $path = $this->cacheManager->getBrowserPath($media->getPath(), 'media_front');
        } elseif (in_array($media->getType(), [MediaTypes::VIDEO, MediaTypes::AUDIO, MediaTypes::FLASH])) {
            $path = $this->urlGenerator->generate('ekyna_media_player', ['key' => $media->getPath()], true);
        } else {
            $path = $this->urlGenerator->generate('ekyna_media_download', ['key' => $media->getPath()], true);
        }

        return $path;
    }
public function generateFrontUrl ( MediaInterface $ media ) { $ path = null ; if ( $ media -> getType ( ) === MediaTypes :: IMAGE ) { $ path = $ this -> cacheManager -> getBrowserPath ( $ media -> getPath ( ) , 'media_front' ) ; } elseif ( in_array ( $ media -> getType ( ) , [ MediaTypes :: VIDEO , MediaTypes :: AUDIO , MediaTypes :: FLASH ] ) ) { $ path = $ this -> urlGenerator -> generate ( 'ekyna_media_player' , [ 'key' => $ media -> getPath ( ) ] , true ) ; } else { $ path = $ this -> urlGenerator -> generate ( 'ekyna_media_download' , [ 'key' => $ media -> getPath ( ) ] , true ) ; } return $ path ; }
Generates the default front url.

@param MediaInterface $media
@return string
Generates the default front url .