Add ability to enabled HLS in the admin panel
authorChocobozzz <me@florianbigard.com>
Tue, 5 Nov 2019 09:13:37 +0000 (10:13 +0100)
committerChocobozzz <me@florianbigard.com>
Tue, 5 Nov 2019 09:13:37 +0000 (10:13 +0100)
client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
config/default.yaml
config/production.yaml.example
server/initializers/checker-before-init.ts

index 5e7ab03cd9ee53c071c55419225732b2d630406d..e057e394ecd9549f3cd07f0984d6239f254bd958 100644 (file)
               </my-peertube-checkbox>
             </div>
 
+            <ng-container formGroupName="hls">
+              <div class="form-group" >
+                <my-peertube-checkbox
+                  inputName="transcodingHlsEnabled" formControlName="enabled"
+                  i18n-labelText labelText="HLS support enabled"
+                >
+                  <ng-template ptTemplate="help">
+                    <ng-container i18n>
+                      <strong>Requires ffmpeg >= 4.1 and multiplies videos storage by 2!</strong>
+
+                      <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with the current default player:</p>
+                      <ul>
+                        <li>Resolution change is smoother</li>
+                        <li>Faster playback in particular with long videos</li>
+                        <li>More stable playback (less bugs/infinite loading)</li>
+                      </ul>
+                    </ng-container>
+                  </ng-template>
+                </my-peertube-checkbox>
+              </div>
+            </ng-container>
+
             <div class="form-group">
               <label i18n for="transcodingThreads">Transcoding threads</label>
               <div class="peertube-select-container">
index 0a69f34819fc970f7132a83f40fb00cbc2096174..f3fb849bbf438465b4b2ec9e4e10d4f06095386d 100644 (file)
@@ -166,7 +166,10 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
         threads: this.customConfigValidatorsService.TRANSCODING_THREADS,
         allowAdditionalExtensions: null,
         allowAudioFiles: null,
-        resolutions: {}
+        resolutions: {},
+        hls: {
+          enabled: null
+        }
       },
       autoBlacklist: {
         videos: {
index 5ebfdeddb6a00ccf619aec6bed0e380c095b98db..b16ebe934957f9d38d341121ba8b37ebb2eae01b 100644 (file)
@@ -209,8 +209,7 @@ transcoding:
     720p: false
     1080p: false
     2160p: false
-  # /!\ EXPERIMENTAL /!\
-  # /!\ Requires ffmpeg >= 4
+  # /!\ Requires ffmpeg >= 4.1
   # Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent:
   #     * Resolution change is smoother
   #     * Faster playback in particular with long videos
index 96d676a35c65f7778bf3594d3d89e9052bb23812..d563c7cf2b612062ff45db52dda257204d79b0d4 100644 (file)
@@ -223,8 +223,7 @@ transcoding:
     720p: false
     1080p: false
     2160p: false
-  # /!\ EXPERIMENTAL /!\
-  # /!\ Requires ffmpeg >= 4
+  # /!\ Requires ffmpeg >= 4.1
   # Generate HLS playlists and fragmented MP4 files. Better playback than with WebTorrent:
   #     * Resolution change is smoother
   #     * Faster playback in particular with long videos
index a986c3e0eb19a00c0f1088d31fec1e09f7551ca2..d32ff9b8161615c6795d4b4c5807941742395cfe 100644 (file)
@@ -21,7 +21,7 @@ function checkMissedConfig () {
     'signup.enabled', 'signup.limit', 'signup.requires_email_verification',
     'signup.filters.cidr.whitelist', 'signup.filters.cidr.blacklist',
     'redundancy.videos.strategies', 'redundancy.videos.check_interval',
-    'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions',
+    'transcoding.enabled', 'transcoding.threads', 'transcoding.allow_additional_extensions', 'transcoding.hls.enabled',
     'import.videos.http.enabled', 'import.videos.torrent.enabled', 'auto_blacklist.videos.of_users.enabled',
     'trending.videos.interval_days',
     'instance.name', 'instance.short_description', 'instance.description', 'instance.terms', 'instance.default_client_route',