</my-peertube-checkbox>
</div>
+ <ng-container formGroupName="webtorrent">
+ <div class="form-group" >
+ <my-peertube-checkbox
+ inputName="transcodingWebTorrentEnabled" formControlName="enabled"
+ i18n-labelText labelText="WebTorrent support enabled"
+ >
+ <ng-template ptTemplate="help">
+ <ng-container i18n>
+ <strong>Experimental, we suggest you to not disable webtorrent support for now</strong>
+
+ <p>If you also enabled HLS support, it will multiply videos storage by 2</p>
+ </ng-container>
+ </ng-template>
+ </my-peertube-checkbox>
+ </div>
+ </ng-container>
+
<ng-container formGroupName="hls">
<div class="form-group" >
<my-peertube-checkbox
>
<ng-template ptTemplate="help">
<ng-container i18n>
- <strong>Requires ffmpeg >= 4.1 and multiplies videos storage by 2!</strong>
+ <strong>Requires ffmpeg >= 4.1</strong>
<p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with the current default player:</p>
<ul>
<li>Faster playback in particular with long videos</li>
<li>More stable playback (less bugs/infinite loading)</li>
</ul>
+
+ <p>If you also enabled WebTorrent support, it will multiply videos storage by 2</p>
</ng-container>
</ng-template>
</my-peertube-checkbox>
resolutions: {},
hls: {
enabled: null
+ },
+ webtorrent: {
+ enabled: null
}
},
autoBlacklist: {
enabledResolutions: [],
hls: {
enabled: false
+ },
+ webtorrent: {
+ enabled: true
}
},
avatar: {
<div class="input-group input-group-sm">
<div class="input-group-prepend peertube-select-container">
<select [(ngModel)]="resolutionId">
- <option *ngFor="let file of video?.files" [value]="file.resolution.id">{{ file.resolution.label }}</option>
+ <option *ngFor="let file of getVideoFiles()" [value]="file.resolution.id">{{ file.resolution.label }}</option>
</select>
</div>
<input #urlInput (click)="urlInput.select()" type="text" class="form-control input-sm readonly" readonly [value]="getLink()" />
private i18n: I18n
) { }
+ getVideoFiles () {
+ if (!this.video) return []
+
+ return this.video.getFiles()
+ }
+
show (video: VideoDetails) {
this.video = video
this.activeModal = this.modalService.open(this.modal)
- this.resolutionId = this.video.files[0].resolution.id
+ this.resolutionId = this.getVideoFiles()[0].resolution.id
}
onClose () {
// HTML select send us a string, so convert it to a number
this.resolutionId = parseInt(this.resolutionId.toString(), 10)
- const file = this.video.files.find(f => f.resolution.id === this.resolutionId)
+ const file = this.getVideoFiles().find(f => f.resolution.id === this.resolutionId)
if (!file) {
console.error('Could not find file with resolution %d.', this.resolutionId)
return
hasHlsPlaylist () {
return !!this.getHlsPlaylist()
}
+
+ getFiles () {
+ if (this.files.length === 0) return this.getHlsPlaylist().files
+ }
}
this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
- const videoFiles = (video as VideoDetails).files
+ const videoFiles = (video as VideoDetails).getFiles()
if (videoFiles.length > 1) { // Already transcoded
this.waitTranscodingEnabled = false
}
</div>
</div>
-<ng-template [ngIf]="video !== null">
+<ng-container *ngIf="video !== null">
<my-video-support #videoSupportModal [video]="video"></my-video-support>
<my-video-share #videoShareModal [video]="video" [videoCaptions]="videoCaptions"></my-video-share>
-</ng-template>
+</ng-container>
segmentsSha256Url: hlsPlaylist.segmentsSha256Url,
redundancyBaseUrls: hlsPlaylist.redundancies.map(r => r.baseUrl),
trackerAnnounce: this.video.trackerUrls,
- videoFiles: this.video.files
+ videoFiles: hlsPlaylist.files
} as P2PMediaLoaderOptions
Object.assign(options, { p2pMediaLoader })
segmentsSha256Url: hlsPlaylist.segmentsSha256Url,
redundancyBaseUrls: hlsPlaylist.redundancies.map(r => r.baseUrl),
trackerAnnounce: videoInfo.trackerUrls,
- videoFiles: videoInfo.files
+ videoFiles: hlsPlaylist.files
} as P2PMediaLoaderOptions
})
}