import { Injectable } from '@angular/core'
import { AuthService, Notifier, ServerService } from '@app/core'
import { BytesPipe, VideoService } from '@app/shared/shared-main'
-import { isIOS } from '@root-helpers/web-browser'
import { HttpStatusCode } from '@shared/models'
import { UploaderXFormData } from './uploaderx-form-data'
}
private getUploadxOptions (endpoint: string, uploaderClass: typeof UploaderXFormData) {
- // FIXME: https://github.com/Chocobozzz/PeerTube/issues/4382#issuecomment-915854167
- const chunkSize = isIOS()
- ? 0
- : undefined // Auto chunk size
-
return {
endpoint,
multiple: false,
maxChunkSize: this.server.getHTMLConfig().client.videos.resumableUpload.maxChunkSize,
- chunkSize,
token: this.authService.getAccessToken(),
break
case 'uploading':
- // TODO: remove || 0 when // https://github.com/kukhariev/ngx-uploadx/pull/368 is released
- this.videoUploadPercents = state.progress || 0
+ this.videoUploadPercents = state.progress
break
case 'paused':
-import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core'
+import { AfterContentInit, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
import { PeerTubeTemplateDirective } from '@app/shared/shared-main'
@ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'label' | 'help'>>
- // FIXME: https://github.com/angular/angular/issues/10816#issuecomment-307567836
- @Input() onPushWorkaround = false
-
labelTemplate: TemplateRef<any>
helpTemplate: TemplateRef<any>
- constructor (private cdr: ChangeDetectorRef) { }
-
ngAfterContentInit () {
{
const t = this.templates.find(t => t.name === 'label')
writeValue (checked: boolean) {
this.checked = checked
-
- if (this.onPushWorkaround) {
- this.cdr.markForCheck()
- }
}
registerOnChange (fn: (_: any) => void) {
<button class="primary-row button-unstyle" (click)="toggleMainPlaylist($event, playlist)">
<my-peertube-checkbox
[disabled]="isPresentMultipleTimes(playlist) || playlist.optionalRowDisplayed" [inputName]="getPrimaryInputName(playlist)"
- [ngModel]="isPrimaryCheckboxChecked(playlist)" [onPushWorkaround]="true"
+ [ngModel]="isPrimaryCheckboxChecked(playlist)"
></my-peertube-checkbox>
<label [for]="getPrimaryInputName(playlist)" class="display-name">
<ng-container *ngFor="let element of buildOptionalRowElements(playlist)">
<my-peertube-checkbox
[inputName]="getOptionalInputName(playlist, element)"
- [ngModel]="element.enabled" [onPushWorkaround]="true"
+ [ngModel]="element.enabled"
(click)="toggleOptionalPlaylist($event, playlist, element, startAt.timestamp, stopAt.timestamp)"
></my-peertube-checkbox>