-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhls.php
More file actions
188 lines (168 loc) · 4.88 KB
/
hls.php
File metadata and controls
188 lines (168 loc) · 4.88 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?php
declare(strict_types=1);
return [
/**
* Middlewares the HLS routes should use.
* This should be an array of middleware names that will be applied
* to the HLS routes.
*
* Default: []
*/
'middlewares' => [
// 'auth', // Uncomment to enable authentication middleware
],
/**
* The queue name for HLS conversion jobs.
* This should be a string that defines the queue
* name where the HLS conversion jobs will be dispatched.
*
* Default: "default"
*/
'queue_name' => 'default',
/**
* This determines whether the HLS output files should be encrypted
* using AES-128 encryption.
*
* Default: true
*/
'enable_encryption' => true,
/**
* The bitrates for different resolutions. (In kbps)
* This should be an associative array where the keys are
* resolution strings in the format '{resolution}'
* and the values are the corresponding bitrates in kbps.
*/
'bitrates' => [
'360p' => 600,
'480p' => 1000,
'720p' => 2500,
'1080p' => 4500,
'1440p' => 7000,
'2160p' => 12000,
],
/**
* The resolutions for HLS conversion.
* This should be an associative array where the keys are
* resolution strings in the format '{resolution}'
* and the values are the corresponding resolution strings
* in the format '{width}x{height}'.
*
* Example: ['480p' => '854x480', '720p' => '1280x720', '1080p' => '1920x1080']
*/
'resolutions' => [
'360p' => '640x360',
'480p' => '854x480',
'720p' => '1280x720',
'1080p' => '1920x1080',
'1440p' => '2560x1440',
'2160p' => '3840x2160',
],
/**
* The database column that is used to store the original video path.
* This should be a string column that contains the path to the original
* video file in default storage.
*
* Default: 'video_path'
*/
'video_column' => 'video_path',
/**
* The database column that is used to store the HLS folder.
* This should be a string column that contains the path to the HLS
* output folder in default storage.
*
* Default: 'hls_path'
*/
'hls_column' => 'hls_path',
/**
* The database column that is used to store the conversion progress.
* This should be an integer column that contains the progress percentage
* of the HLS conversion.
*
* Default: 'conversion_progress'
*/
'progress_column' => 'conversion_progress',
/**
* The disk where the original video files are stored.
* This should be a valid disk name as defined in your
* `config/filesystems.php` file.
*
* Default: 'public'
*/
'video_disk' => 'public',
/**
* The disk where the HLS output files are stored.
* This should be a valid disk name as defined in your
* `config/filesystems.php` file.
*
* Default: 'local'
*/
'hls_disk' => 'local',
/**
* The disk where the encryption secrets are stored.
* This should be a valid disk name as defined in your
* `config/filesystems.php` file.
*
* Default: 'local'
*/
'secrets_disk' => 'local',
/**
* The path where the HLS output files will be stored.
* This should be a valid path relative to the disk defined
* in `hls_disk`.
*
* Default: 'hls'
*/
'hls_output_path' => 'hls',
/**
* The path where the encryption secrets will be stored.
* This should be a valid path relative to the disk defined
* in `secret_disk`.
*
* Default: 'hls/secrets'
*/
'secrets_output_path' => 'secrets',
/**
* The path where the conversion temp files are stored.
*
* Default: 'tmp'
*/
'temp_storage_path' => 'tmp',
/**
* The path where the conversion temp files are stored.
*
* Default: 'tmp'
*/
'temp_hls_storage_path' => 'tmp',
/**
* The model aliases to detect the class for conversion.
* This should be an array of model class names that
* implement the ConvertsToHLS trait.
*
* Default: []
*/
'model_aliases' => [
// 'video' => \App\Models\Video::class,
],
/**
* This determines whether the HLS routes should be registered.
* If set to true, the package will register the necessary routes
* for HLS conversion and playback.
*
* Default: true
*/
'register_routes' => true,
/**
* This determines whether the original video file should be deleted
* after the HLS conversion is complete.
*
* Default: false
*/
'delete_original_file_after_conversion' => false,
/**
* This determines whether the events should be dispatched
* when HLS conversion completes or fails.
*
* Default: false
*/
'dispatch_events' => false,
];