1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
16: class IMP_Mime_Viewer_Video extends Horde_Mime_Viewer_Default
17: {
18: 19: 20: 21: 22:
23: protected $_capability = array(
24: 'full' => false,
25: 'info' => true,
26: 'inline' => false,
27: 'raw' => false
28: );
29:
30: 31: 32: 33: 34:
35: protected function _renderInfo()
36: {
37: $mime_id = $this->_mimepart->getMimeId();
38: $headers = Horde_Mime_Headers::parseHeaders($this->getConfigParam('imp_contents')->getBodyPart($mime_id, array(
39: 'length' => 0,
40: 'mimeheaders' => true
41: )));
42:
43: if (($duration = $headers->getValue('content-duration')) === null) {
44: return array();
45: }
46:
47: $status = new IMP_Mime_Status(sprintf(_("This video file is reported to be %d minutes, %d seconds in length."), floor($duration / 60), $duration % 60));
48: $status->icon('mime/video.png');
49:
50: return array(
51: $this->_mimepart->getMimeId() => array(
52: 'data' => '',
53: 'status' => $status,
54: 'type' => 'text/html; charset=UTF-8'
55: )
56: );
57: }
58:
59: }
60: