Completed
Pull Request — develop (#551)
by
unknown
09:20
created

Video::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * This file is part of PHPPresentation - A pure PHP library for reading and writing
4
 * presentations documents.
5
 *
6
 * PHPPresentation is free software distributed under the terms of the GNU Lesser
7
 * General Public License version 3 as published by the Free Software Foundation.
8
 *
9
 * For the full copyright and license information, please read the LICENSE
10
 * file that was distributed with this source code. For the full list of
11
 * contributors, visit https://github.com/PHPOffice/PHPPresentation/contributors.
12
 *
13
 * @link        https://github.com/PHPOffice/PHPPresentation
14
 * @copyright   2009-2015 PHPPresentation contributors
15
 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
16
 */
17
18
namespace PhpOffice\PhpPresentation\Shape;
19
20
use PhpOffice\PhpPresentation\ComparableInterface;
21
use PhpOffice\PhpPresentation\Shape\Drawing\File;
22
23
/**
24
 * Video element
25
 */
26
class Video extends Media
27
{
28
	
29
	
30
	public function __construct() {
31
		parent::__construct();
32
		
33
		// settings
34
		$this->setName('Video')
35
		->setDescription('Video')
36
		->setResizeProportional(false);
37
	}
38
	
39
	
40
	/**
41
	 * @return string
42
	 */
43
	public function getMimeType()
44
	{
45
		switch (strtolower($this->getExtension())) {
46
			case 'mp4':
47
				$mimetype = 'video/mp4';
48
				break;
49
			case 'ogv':
50
				$mimetype = 'video/ogg';
51
				break;
52
			case 'wmv':
53
				$mimetype = 'video/x-ms-wmv';
54
				break;
55
			default:
56
				$mimetype = 'application/octet-stream';
57
		}
58
		return $mimetype;
59
	}
60
	
61
}
62