- case 'application/ogg':
- $arr = array('type' => $this->attachment->mimetype,
- 'data' => $this->attachment->url,
- 'width' => 320,
- 'height' => 240
- );
- $this->out->elementStart('object', $arr);
- $this->out->element('param', array('name' => 'src', 'value' => $this->attachment->url));
- $this->out->element('param', array('name' => 'autoStart', 'value' => 1));
- $this->out->elementEnd('object');
+ // FIXME: Get proper mime recognition of Ogg files! If system has 'mediainfo', this should do it:
+ // $ mediainfo --inform='General;%InternetMediaType%'
+ if ($this->attachment->mimetype === 'application/ogg') {
+ $mediatype = 'video'; // because this element can handle Ogg/Vorbis etc. on its own
+ }
+ switch ($mediatype) {
+ // Anything we understand as an image, if we need special treatment, do it in StartShowAttachmentRepresentation
+ case 'image':
+ if ($thumb instanceof File_thumbnail) {
+ $this->out->element('img', $thumb->getHtmlAttrs(['class'=>'u-photo', 'alt' => '']));
+ } else {
+ $this->out->element('img', array('class'=>'u-photo', 'src' => $this->attachment->getUrl(), 'alt' => $this->attachment->getTitle()));
+ }
+ unset($thumb); // there's no need carrying this along after this