-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFps.php
More file actions
85 lines (74 loc) · 1.96 KB
/
Fps.php
File metadata and controls
85 lines (74 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* This file is part of the Cloudinary PHP package.
*
* (c) Cloudinary
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Cloudinary\Transformation;
use Cloudinary\ArrayUtils;
use Cloudinary\Transformation\Qualifier\BaseQualifier;
/**
* Controls the range of acceptable FPS (Frames Per Second) to ensure that video (even when optimized) is delivered with
* an expected FPS level (helps with sync to audio).
*
* **Learn more**: <a
* href=https://cloudinary.com/documentation/video_transformation_reference#video_settings
* target="_blank">Video settings</a>
*
* @property MinMaxRange $value
*
* @api
*/
class Fps extends BaseQualifier
{
protected const VALUE_CLASS = MinMaxRange::class;
/**
* @var string $key Serialization key.
*/
protected static string $key = 'fps';
/**
* FPS constructor.
*/
public function __construct($min = null, mixed $max = null)
{
parent::__construct($min, $max);
}
/**
* Sets the minimum frame rate.
*
* @param int|float|string|null $min The minimum frame rate in frames per second.
*
* @return $this
*/
public function min(int|float|string|null $min): static
{
$this->value->min($min);
return $this;
}
/**
* Sets the maximum frame rate.
*
* @param int|float|string|null $max The maximum frame rate in frames per second.
*
* @return $this
*/
public function max(int|float|string|null $max): static
{
$this->value->max($max);
return $this;
}
/**
* Creates a new instance using provided qualifiers array.
*
* @param array|string $qualifiers The qualifiers.
*
*/
public static function fromParams(array|string $qualifiers): Fps
{
$qualifiers = ArrayUtils::build($qualifiers);
return new static(...$qualifiers);
}
}