| @@ 34-47 (lines=14) @@ | ||
| 31 | return $this->file; |
|
| 32 | } |
|
| 33 | ||
| 34 | public function getDurationInSeconds(): int |
|
| 35 | { |
|
| 36 | $stream = $this->media->getStreams()->first(); |
|
| 37 | ||
| 38 | if ($stream->has('duration')) { |
|
| 39 | return $stream->get('duration'); |
|
| 40 | } |
|
| 41 | ||
| 42 | $format = $this->media->getFormat(); |
|
| 43 | ||
| 44 | if ($format->has('duration')) { |
|
| 45 | return $format->get('duration'); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| 49 | public function getDurationInMiliseconds(): float |
|
| 50 | { |
|
| @@ 49-62 (lines=14) @@ | ||
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| 49 | public function getDurationInMiliseconds(): float |
|
| 50 | { |
|
| 51 | $stream = $this->media->getStreams()->first(); |
|
| 52 | ||
| 53 | if ($stream->has('duration')) { |
|
| 54 | return $stream->get('duration') * 1000; |
|
| 55 | } |
|
| 56 | ||
| 57 | $format = $this->media->getFormat(); |
|
| 58 | ||
| 59 | if ($format->has('duration')) { |
|
| 60 | return $format->get('duration') * 1000; |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| 64 | public function export(): MediaExporter |
|
| 65 | { |
|