Skip to content

Commit f677d6f

Browse files
author
pascalbaljet
committed
Updated README.md + cleanup
1 parent a36dd18 commit f677d6f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ FFMpeg::open('my_movie.mov')
134134
->export()
135135
->inFormat(new FFMpeg\Format\Video\WebM)
136136
->save('my_movie.webm')
137+
138+
// optionally you could set the visibility
139+
// of the exported file
140+
->export()
141+
->inFormat(new FFMpeg\Format\Video\WebM)
142+
->withVisibility('public')
143+
->save('my_movie.webm')
137144
```
138145

139146
Create a frame from a video:
@@ -169,7 +176,7 @@ $durationInSeconds = $media->getDurationInSeconds(); // returns an int
169176
$durationInMiliseconds = $media->getDurationInMiliseconds(); // returns a float
170177
```
171178

172-
Create a M3U8 playlist to do [HLS](https://en.wikipedia.org/wiki/HTTP_Live_Streaming):
179+
You can create a M3U8 playlist to do [HLS](https://en.wikipedia.org/wiki/HTTP_Live_Streaming). Exporting is currently only supported on local disks.
173180

174181
``` php
175182
$lowBitrate = (new X264)->setKiloBitrate(250);
@@ -201,7 +208,7 @@ The Media object you get when you 'open' a file, actually holds the Media object
201208
// This gives you an instance of Pbmedia\LaravelFFMpeg\Media
202209
$media = FFMpeg::fromDisk('videos')->open('video.mp4');
203210

204-
// The 'getStreams' method will be called on the underlying Media object since
211+
// The 'getStreams' method will be called on the underlying Media object since
205212
// it doesn't exists on this object.
206213
$codec = $media->getStreams()->first()->get('codec_name');
207214
```

src/Disk.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/**
99
* @method bool put($path, $contents, $visibility = null)
1010
* @method array|false read($path)
11+
* @method void setVisibility($path, $visibility)
1112
*/
1213
class Disk
1314
{

src/MediaExporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function save(string $path): Media
7373
$this->moveSavedFileToRemoteDisk($destinationPath, $file);
7474
}
7575

76-
if ($this->visibility) {
76+
if ($this->visibility !== null) {
7777
$disk->setVisibility($path, $this->visibility);
7878
}
7979

0 commit comments

Comments
 (0)