Passed
Push — master ( 4d4fc5...4bc7af )
by Amin
03:11
created

DASH::isGenerateHlsPlaylist()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * This file is part of the PHP-FFmpeg-video-streaming package.
5
 *
6
 * (c) Amin Yazdanpanah <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Streaming;
13
14
use Streaming\Filters\DASHFilter;
15
use Streaming\Filters\FilterStreamingInterface;
16
17
class DASH extends Streaming
18
{
19
    /** @var string */
20
    private $adaption;
21
22
    /** @var string */
23
    private $seg_duration = 10;
24
25
    /** @var bool */
26
    private $generate_hls_playlist = false;
27
28
    /**
29
     * @return mixed
30
     */
31
    public function getAdaption()
32
    {
33
        return $this->adaption;
34
    }
35
36
    /**
37
     * @param mixed $adaption
38
     * @return DASH
39
     */
40
    public function setAdaption(string $adaption): DASH
41
    {
42
        $this->adaption = $adaption;
43
        return $this;
44
    }
45
46
    /**
47
     * @param string $seg_duration
48
     * @return DASH
49
     */
50
    public function setSegDuration(string $seg_duration): DASH
51
    {
52
        $this->seg_duration = $seg_duration;
53
        return $this;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getSegDuration(): string
60
    {
61
        return $this->seg_duration;
62
    }
63
64
    /**
65
     * @param bool $generate_hls_playlist
66
     * @return DASH
67
     */
68
    public function generateHlsPlaylist(bool $generate_hls_playlist = true): DASH
69
    {
70
        $this->generate_hls_playlist = $generate_hls_playlist;
71
        return $this;
72
    }
73
74
    /**
75
     * @return bool
76
     */
77
    public function isGenerateHlsPlaylist(): bool
78
    {
79
        return $this->generate_hls_playlist;
80
    }
81
82
    /**
83
     * @return DASHFilter
84
     */
85
    protected function getFilter(): FilterStreamingInterface
86
    {
87
        return new DASHFilter($this);
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    protected function getPath(): string
94
    {
95
        return implode(".", [$this->getFilePath(), "mpd"]);
96
    }
97
}