public function getType()
    {
        $mimeType = preg_replace('#^([^/]+)/.*$#', '$1', $this->getMimeType());

        if ($mimeType == 'video') {
            return Media::VIDEO;
        }

        if ($mimeType == 'audio') {
            return Media::AUDIO;
        }

        if ($mimeType == 'image') {
            return Media::IMAGE;
        }

        $extension = $this->getExtension();

        if (in_array($extension, $this->imagesExtensions())) {
            return Media::IMAGE;
        }

        if (in_array($extension, $this->audiosExtensions())) {
            return Media::AUDIO;
        }

        if (in_array($extension, $this->videosExtensions())) {
            return Media::VIDEO;
        }

        return Media::OTHER;
    }