NoImplicitAny flag true (#1157)
this enables the `noImplicitAny` flag in the Typescript compiler > When the noImplicitAny flag is true and the TypeScript compiler cannot infer the type, it still generates the JavaScript files, but it also reports an error. Many seasoned developers prefer this stricter setting because type checking catches more unintentional errors at compile time. closes: #1131 replaces #1137
This commit is contained in:
parent
28e51e831b
commit
244b4ae397
|
@ -62,7 +62,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
const formGroupData = {
|
const formGroupData: any = {
|
||||||
instanceName: this.customConfigValidatorsService.INSTANCE_NAME,
|
instanceName: this.customConfigValidatorsService.INSTANCE_NAME,
|
||||||
instanceShortDescription: this.customConfigValidatorsService.INSTANCE_SHORT_DESCRIPTION,
|
instanceShortDescription: this.customConfigValidatorsService.INSTANCE_SHORT_DESCRIPTION,
|
||||||
instanceDescription: null,
|
instanceDescription: null,
|
||||||
|
@ -202,7 +202,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateForm () {
|
private updateForm () {
|
||||||
const data = {
|
const data: any = {
|
||||||
instanceName: this.customConfig.instance.name,
|
instanceName: this.customConfig.instance.name,
|
||||||
instanceShortDescription: this.customConfig.instance.shortDescription,
|
instanceShortDescription: this.customConfig.instance.shortDescription,
|
||||||
instanceDescription: this.customConfig.instance.description,
|
instanceDescription: this.customConfig.instance.description,
|
||||||
|
|
|
@ -7,7 +7,7 @@ export abstract class UserEdit extends FormReactive {
|
||||||
|
|
||||||
videoQuotaOptions: { value: string, label: string }[] = []
|
videoQuotaOptions: { value: string, label: string }[] = []
|
||||||
videoQuotaDailyOptions: { value: string, label: string }[] = []
|
videoQuotaDailyOptions: { value: string, label: string }[] = []
|
||||||
roles = Object.keys(USER_ROLE_LABELS).map(key => ({ value: key.toString(), label: USER_ROLE_LABELS[key] }))
|
roles = Object.keys(USER_ROLE_LABELS).map((key: any) => ({ value: key.toString(), label: USER_ROLE_LABELS[key] }))
|
||||||
|
|
||||||
protected abstract serverService: ServerService
|
protected abstract serverService: ServerService
|
||||||
protected abstract configService: ConfigService
|
protected abstract configService: ConfigService
|
||||||
|
|
|
@ -45,12 +45,12 @@ export class UserListComponent extends RestTable implements OnInit {
|
||||||
{
|
{
|
||||||
label: this.i18n('Ban'),
|
label: this.i18n('Ban'),
|
||||||
handler: users => this.openBanUserModal(users),
|
handler: users => this.openBanUserModal(users),
|
||||||
isDisplayed: users => users.every(u => u.blocked === false)
|
isDisplayed: users => users.every((u: any) => u.blocked === false)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.i18n('Unban'),
|
label: this.i18n('Unban'),
|
||||||
handler: users => this.unbanUsers(users),
|
handler: users => this.unbanUsers(users),
|
||||||
isDisplayed: users => users.every(u => u.blocked === true)
|
isDisplayed: users => users.every((u: any) => u.blocked === true)
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ import { VideoChannelValidatorsService } from '@app/shared/forms/form-validators
|
||||||
styleUrls: [ './my-account-video-channel-edit.component.scss' ]
|
styleUrls: [ './my-account-video-channel-edit.component.scss' ]
|
||||||
})
|
})
|
||||||
export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelEdit implements OnInit, OnDestroy {
|
export class MyAccountVideoChannelUpdateComponent extends MyAccountVideoChannelEdit implements OnInit, OnDestroy {
|
||||||
@ViewChild('avatarfileInput') avatarfileInput
|
@ViewChild('avatarfileInput') avatarfileInput: any
|
||||||
|
|
||||||
error: string
|
error: string
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
|
||||||
}
|
}
|
||||||
|
|
||||||
isInSelectionMode () {
|
isInSelectionMode () {
|
||||||
return Object.keys(this.checkedVideos).some(k => this.checkedVideos[ k ] === true)
|
return Object.keys(this.checkedVideos).some((k: any) => this.checkedVideos[ k ] === true)
|
||||||
}
|
}
|
||||||
|
|
||||||
getVideosObservable (page: number) {
|
getVideosObservable (page: number) {
|
||||||
|
@ -81,7 +81,7 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
|
||||||
|
|
||||||
async deleteSelectedVideos () {
|
async deleteSelectedVideos () {
|
||||||
const toDeleteVideosIds = Object.keys(this.checkedVideos)
|
const toDeleteVideosIds = Object.keys(this.checkedVideos)
|
||||||
.filter(k => this.checkedVideos[ k ] === true)
|
.filter((k: any) => this.checkedVideos[ k ] === true)
|
||||||
.map(k => parseInt(k, 10))
|
.map(k => parseInt(k, 10))
|
||||||
|
|
||||||
const res = await this.confirmService.confirm(
|
const res = await this.confirmService.confirm(
|
||||||
|
@ -168,9 +168,10 @@ export class MyAccountVideosComponent extends AbstractVideoList implements OnIni
|
||||||
}
|
}
|
||||||
|
|
||||||
private spliceVideosById (id: number) {
|
private spliceVideosById (id: number) {
|
||||||
for (const key of Object.keys(this.loadedPages)) {
|
let key: any
|
||||||
|
for (key of Object.keys(this.loadedPages)) {
|
||||||
const videos = this.loadedPages[ key ]
|
const videos = this.loadedPages[ key ]
|
||||||
const index = videos.findIndex(v => v.id === id)
|
const index = videos.findIndex((v: any) => v.id === id)
|
||||||
|
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
videos.splice(index, 1)
|
videos.splice(index, 1)
|
||||||
|
|
|
@ -49,7 +49,8 @@ export class VideoChangeOwnershipComponent extends FormReactive implements OnIni
|
||||||
.catch((_) => _) // Called when closing (cancel) the modal without validating, do nothing
|
.catch((_) => _) // Called when closing (cancel) the modal without validating, do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
search (event) {
|
// TODO: typing
|
||||||
|
search (event: any) {
|
||||||
const query = event.query
|
const query = event.query
|
||||||
this.userService.autocomplete(query)
|
this.userService.autocomplete(query)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { Account } from '@app/shared/account/account.model'
|
||||||
styleUrls: [ './actor-avatar-info.component.scss' ]
|
styleUrls: [ './actor-avatar-info.component.scss' ]
|
||||||
})
|
})
|
||||||
export class ActorAvatarInfoComponent {
|
export class ActorAvatarInfoComponent {
|
||||||
@ViewChild('avatarfileInput') avatarfileInput
|
@ViewChild('avatarfileInput') avatarfileInput: any
|
||||||
|
|
||||||
@Input() actor: VideoChannel | Account
|
@Input() actor: VideoChannel | Account
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ export function metaFactory (serverService: ServerService): MetaLoader {
|
||||||
providers: [
|
providers: [
|
||||||
{
|
{
|
||||||
provide: TRANSLATIONS,
|
provide: TRANSLATIONS,
|
||||||
useFactory: (locale) => {
|
useFactory: (locale: string) => {
|
||||||
// On dev mode, test localization
|
// On dev mode, test localization
|
||||||
if (isOnDevLocale()) {
|
if (isOnDevLocale()) {
|
||||||
locale = buildFileLocale(getDevLocale())
|
locale = buildFileLocale(getDevLocale())
|
||||||
|
|
|
@ -221,7 +221,7 @@ export class AuthService {
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshUserInformation () {
|
refreshUserInformation () {
|
||||||
const obj = {
|
const obj: any = {
|
||||||
access_token: this.user.getAccessToken(),
|
access_token: this.user.getAccessToken(),
|
||||||
refresh_token: null,
|
refresh_token: null,
|
||||||
token_type: this.user.getTokenType(),
|
token_type: this.user.getTokenType(),
|
||||||
|
|
|
@ -155,7 +155,7 @@ export class ServerService {
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(translations => {
|
switchMap(translations => {
|
||||||
return this.http.get(ServerService.BASE_VIDEO_URL + attributeName)
|
return this.http.get(ServerService.BASE_VIDEO_URL + attributeName)
|
||||||
.pipe(map(data => ({ data, translations })))
|
.pipe(map((data: any) => ({ data, translations })))
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.subscribe(({ data, translations }) => {
|
.subscribe(({ data, translations }) => {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage'
|
||||||
export class ThemeService {
|
export class ThemeService {
|
||||||
private theme = document.querySelector('body')
|
private theme = document.querySelector('body')
|
||||||
private darkTheme = false
|
private darkTheme = false
|
||||||
private previousTheme = {}
|
private previousTheme: { [ id: string ]: string } = {}
|
||||||
|
|
||||||
constructor () {
|
constructor () {
|
||||||
// initialise the alternative theme with dark theme colors
|
// initialise the alternative theme with dark theme colors
|
||||||
|
@ -33,7 +33,7 @@ export class ThemeService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private switchProperty (property, newValue?) {
|
private switchProperty (property: string, newValue?: string) {
|
||||||
const propertyOldvalue = window.getComputedStyle(this.theme).getPropertyValue('--' + property)
|
const propertyOldvalue = window.getComputedStyle(this.theme).getPropertyValue('--' + property)
|
||||||
this.theme.style.setProperty('--' + property, (newValue) ? newValue : this.previousTheme[property])
|
this.theme.style.setProperty('--' + property, (newValue) ? newValue : this.previousTheme[property])
|
||||||
this.previousTheme[property] = propertyOldvalue
|
this.previousTheme[property] = propertyOldvalue
|
||||||
|
|
|
@ -18,7 +18,7 @@ export class MenuComponent implements OnInit {
|
||||||
userHasAdminAccess = false
|
userHasAdminAccess = false
|
||||||
helpVisible = false
|
helpVisible = false
|
||||||
|
|
||||||
private routesPerRight = {
|
private routesPerRight: any = {
|
||||||
[UserRight.MANAGE_USERS]: '/admin/users',
|
[UserRight.MANAGE_USERS]: '/admin/users',
|
||||||
[UserRight.MANAGE_SERVER_FOLLOW]: '/admin/friends',
|
[UserRight.MANAGE_SERVER_FOLLOW]: '/admin/friends',
|
||||||
[UserRight.MANAGE_VIDEO_ABUSES]: '/admin/moderation/video-abuses',
|
[UserRight.MANAGE_VIDEO_ABUSES]: '/admin/moderation/video-abuses',
|
||||||
|
|
|
@ -53,7 +53,7 @@ export class AdvancedSearch {
|
||||||
}
|
}
|
||||||
|
|
||||||
containsValues () {
|
containsValues () {
|
||||||
const obj = this.toUrlObject()
|
const obj: any = this.toUrlObject()
|
||||||
for (const k of Object.keys(obj)) {
|
for (const k of Object.keys(obj)) {
|
||||||
if (k === 'sort') continue // Exception
|
if (k === 'sort') continue // Exception
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ export class AdvancedSearch {
|
||||||
size () {
|
size () {
|
||||||
let acc = 0
|
let acc = 0
|
||||||
|
|
||||||
const obj = this.toUrlObject()
|
const obj: any = this.toUrlObject()
|
||||||
for (const k of Object.keys(obj)) {
|
for (const k of Object.keys(obj)) {
|
||||||
if (k === 'sort') continue // Exception
|
if (k === 'sort') continue // Exception
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,9 @@ import { Component, Input } from '@angular/core'
|
||||||
|
|
||||||
export type DropdownAction<T> = {
|
export type DropdownAction<T> = {
|
||||||
label?: string
|
label?: string
|
||||||
handler?: (T) => any
|
handler?: (T: any) => any
|
||||||
linkBuilder?: (T) => (string | number)[]
|
linkBuilder?: (T: any) => (string | number)[]
|
||||||
isDisplayed?: (T) => boolean
|
isDisplayed?: (T: any) => boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
|
@ -8,9 +8,9 @@ import { Component, Input } from '@angular/core'
|
||||||
|
|
||||||
export class ButtonComponent {
|
export class ButtonComponent {
|
||||||
@Input() label = ''
|
@Input() label = ''
|
||||||
@Input() className = undefined
|
@Input() className: any = undefined
|
||||||
@Input() icon = undefined
|
@Input() icon: any = undefined
|
||||||
@Input() title = undefined
|
@Input() title: any = undefined
|
||||||
|
|
||||||
getTitle () {
|
getTitle () {
|
||||||
return this.title || this.label
|
return this.title || this.label
|
||||||
|
|
|
@ -8,5 +8,5 @@ import { Component, Input } from '@angular/core'
|
||||||
|
|
||||||
export class EditButtonComponent {
|
export class EditButtonComponent {
|
||||||
@Input() label: string
|
@Input() label: string
|
||||||
@Input() routerLink = []
|
@Input() routerLink: any = []
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ export class HelpComponent implements OnInit, OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
private createMarkdownList (rules: string[]) {
|
private createMarkdownList (rules: string[]) {
|
||||||
const rulesToText = {
|
const rulesToText: any = {
|
||||||
'emphasis': this.i18n('Emphasis'),
|
'emphasis': this.i18n('Emphasis'),
|
||||||
'link': this.i18n('Links'),
|
'link': this.i18n('Links'),
|
||||||
'newline': this.i18n('New lines'),
|
'newline': this.i18n('New lines'),
|
||||||
|
|
|
@ -6,7 +6,7 @@ class MemoryStorage {
|
||||||
[key: string]: any
|
[key: string]: any
|
||||||
[index: number]: string
|
[index: number]: string
|
||||||
|
|
||||||
getItem (key) {
|
getItem (key: any) {
|
||||||
const stringKey = String(key)
|
const stringKey = String(key)
|
||||||
if (valuesMap.has(key)) {
|
if (valuesMap.has(key)) {
|
||||||
return String(valuesMap.get(stringKey))
|
return String(valuesMap.get(stringKey))
|
||||||
|
@ -15,11 +15,11 @@ class MemoryStorage {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
setItem (key, val) {
|
setItem (key: any, val: any) {
|
||||||
valuesMap.set(String(key), String(val))
|
valuesMap.set(String(key), String(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
removeItem (key) {
|
removeItem (key: any) {
|
||||||
valuesMap.delete(key)
|
valuesMap.delete(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ function objectToFormData (obj: any, form?: FormData, namespace?: string) {
|
||||||
return fd
|
return fd
|
||||||
}
|
}
|
||||||
|
|
||||||
function lineFeedToHtml (obj: object, keyToNormalize: string) {
|
function lineFeedToHtml (obj: any, keyToNormalize: string) {
|
||||||
return immutableAssign(obj, {
|
return immutableAssign(obj, {
|
||||||
[keyToNormalize]: obj[keyToNormalize].replace(/\r?\n|\r/g, '<br />')
|
[keyToNormalize]: obj[keyToNormalize].replace(/\r?\n|\r/g, '<br />')
|
||||||
})
|
})
|
||||||
|
|
|
@ -16,4 +16,5 @@ export class VideosOverview implements VideosOverviewServer {
|
||||||
tag: string
|
tag: string
|
||||||
videos: Video[]
|
videos: Video[]
|
||||||
}[]
|
}[]
|
||||||
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ export class RestExtractor {
|
||||||
return this.applyToResultListData(result, this.convertDateToHuman, [ fieldsToConvert ])
|
return this.applyToResultListData(result, this.convertDateToHuman, [ fieldsToConvert ])
|
||||||
}
|
}
|
||||||
|
|
||||||
convertDateToHuman (target: object, fieldsToConvert: string[]) {
|
convertDateToHuman (target: any, fieldsToConvert: string[]) {
|
||||||
fieldsToConvert.forEach(field => target[field] = dateToHuman(target[field]))
|
fieldsToConvert.forEach(field => target[field] = dateToHuman(target[field]))
|
||||||
|
|
||||||
return target
|
return target
|
||||||
|
@ -83,7 +83,7 @@ export class RestExtractor {
|
||||||
errorMessage = err
|
errorMessage = err
|
||||||
}
|
}
|
||||||
|
|
||||||
const errorObj = {
|
const errorObj: any = {
|
||||||
message: errorMessage,
|
message: errorMessage,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
body: undefined
|
body: undefined
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class RestService {
|
||||||
return newParams
|
return newParams
|
||||||
}
|
}
|
||||||
|
|
||||||
addObjectParams (params: HttpParams, object: object) {
|
addObjectParams (params: HttpParams, object: any) {
|
||||||
for (const name of Object.keys(object)) {
|
for (const name of Object.keys(object)) {
|
||||||
const value = object[name]
|
const value = object[name]
|
||||||
if (!value) continue
|
if (!value) continue
|
||||||
|
|
|
@ -43,6 +43,7 @@ export class User implements UserServerModel {
|
||||||
|
|
||||||
blocked: boolean
|
blocked: boolean
|
||||||
blockedReason?: string
|
blockedReason?: string
|
||||||
|
[key: string]: any
|
||||||
|
|
||||||
constructor (hash: UserConstructorHash) {
|
constructor (hash: UserConstructorHash) {
|
||||||
this.id = hash.id
|
this.id = hash.id
|
||||||
|
|
|
@ -27,7 +27,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
sort: VideoSortField = '-publishedAt'
|
sort: VideoSortField = '-publishedAt'
|
||||||
categoryOneOf?: number
|
categoryOneOf?: number
|
||||||
defaultSort: VideoSortField = '-publishedAt'
|
defaultSort: VideoSortField = '-publishedAt'
|
||||||
syndicationItems = []
|
syndicationItems: any = []
|
||||||
|
|
||||||
loadOnInit = true
|
loadOnInit = true
|
||||||
marginContent = true
|
marginContent = true
|
||||||
|
@ -59,7 +59,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
private resizeSubscription: Subscription
|
private resizeSubscription: Subscription
|
||||||
|
|
||||||
abstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number}>
|
abstract getVideosObservable (page: number): Observable<{ videos: Video[], totalVideos: number}>
|
||||||
abstract generateSyndicationList ()
|
abstract generateSyndicationList (): any
|
||||||
|
|
||||||
get user () {
|
get user () {
|
||||||
return this.authService.getUser()
|
return this.authService.getUser()
|
||||||
|
@ -209,7 +209,7 @@ export abstract class AbstractVideoList implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected setNewRouteParams () {
|
protected setNewRouteParams () {
|
||||||
const paramsObject = this.buildRouteParams()
|
const paramsObject: any = this.buildRouteParams()
|
||||||
|
|
||||||
const queryParams = Object.keys(paramsObject).map(p => p + '=' + paramsObject[p]).join('&')
|
const queryParams = Object.keys(paramsObject).map(p => p + '=' + paramsObject[p]).join('&')
|
||||||
this.location.replaceState(this.currentRoute, queryParams)
|
this.location.replaceState(this.currentRoute, queryParams)
|
||||||
|
|
|
@ -25,6 +25,7 @@ export class VideoEdit implements VideoUpdate {
|
||||||
uuid?: string
|
uuid?: string
|
||||||
id?: number
|
id?: number
|
||||||
scheduleUpdate?: VideoScheduleUpdate
|
scheduleUpdate?: VideoScheduleUpdate
|
||||||
|
[key: string]: any
|
||||||
|
|
||||||
constructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
|
constructor (video?: Video & { tags: string[], commentsEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
|
||||||
if (video) {
|
if (video) {
|
||||||
|
@ -49,7 +50,7 @@ export class VideoEdit implements VideoUpdate {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
patch (values: Object) {
|
patch (values: any) {
|
||||||
Object.keys(values).forEach((key) => {
|
Object.keys(values).forEach((key) => {
|
||||||
this[ key ] = values[ key ]
|
this[ key ] = values[ key ]
|
||||||
})
|
})
|
||||||
|
|
|
@ -6,5 +6,5 @@ import { Component, Input } from '@angular/core'
|
||||||
templateUrl: './video-feed.component.html'
|
templateUrl: './video-feed.component.html'
|
||||||
})
|
})
|
||||||
export class VideoFeedComponent {
|
export class VideoFeedComponent {
|
||||||
@Input() syndicationItems
|
@Input() syndicationItems: any
|
||||||
}
|
}
|
||||||
|
|
|
@ -276,7 +276,7 @@ export class VideoService implements VideosProvider {
|
||||||
return this.authHttp
|
return this.authHttp
|
||||||
.get(environment.apiUrl + descriptionPath)
|
.get(environment.apiUrl + descriptionPath)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(res => res[ 'description' ]),
|
map((res: any) => res[ 'description' ]),
|
||||||
catchError(err => this.restExtractor.handleError(err))
|
catchError(err => this.restExtractor.handleError(err))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
|
||||||
|
|
||||||
@ViewChild('modal') modal: ElementRef
|
@ViewChild('modal') modal: ElementRef
|
||||||
|
|
||||||
videoCaptionLanguages = []
|
videoCaptionLanguages: any = []
|
||||||
|
|
||||||
private openedModal: NgbModalRef
|
private openedModal: NgbModalRef
|
||||||
private closingModal = false
|
private closingModal = false
|
||||||
|
@ -73,7 +73,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
|
||||||
this.hide()
|
this.hide()
|
||||||
|
|
||||||
const languageId = this.form.value[ 'language' ]
|
const languageId = this.form.value[ 'language' ]
|
||||||
const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)
|
const languageObject = this.videoCaptionLanguages.find((l: any) => l.id === languageId)
|
||||||
|
|
||||||
this.captionAdded.emit({
|
this.captionAdded.emit({
|
||||||
language: languageObject,
|
language: languageObject,
|
||||||
|
|
|
@ -48,7 +48,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
|
||||||
calendarTimezone: string
|
calendarTimezone: string
|
||||||
calendarDateFormat: string
|
calendarDateFormat: string
|
||||||
|
|
||||||
private schedulerInterval
|
private schedulerInterval: any
|
||||||
private firstPatchDone = false
|
private firstPatchDone = false
|
||||||
private initialVideoCaptions: string[] = []
|
private initialVideoCaptions: string[] = []
|
||||||
|
|
||||||
|
@ -77,13 +77,13 @@ export class VideoEditComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateForm () {
|
updateForm () {
|
||||||
const defaultValues = {
|
const defaultValues: any = {
|
||||||
nsfw: 'false',
|
nsfw: 'false',
|
||||||
commentsEnabled: 'true',
|
commentsEnabled: 'true',
|
||||||
waitTranscoding: 'true',
|
waitTranscoding: 'true',
|
||||||
tags: []
|
tags: []
|
||||||
}
|
}
|
||||||
const obj = {
|
const obj: any = {
|
||||||
name: this.videoValidatorsService.VIDEO_NAME,
|
name: this.videoValidatorsService.VIDEO_NAME,
|
||||||
privacy: this.videoValidatorsService.VIDEO_PRIVACY,
|
privacy: this.videoValidatorsService.VIDEO_PRIVACY,
|
||||||
channelId: this.videoValidatorsService.VIDEO_CHANNEL,
|
channelId: this.videoValidatorsService.VIDEO_CHANNEL,
|
||||||
|
|
|
@ -23,7 +23,7 @@ import { VideoImportService } from '@app/shared/video-import'
|
||||||
})
|
})
|
||||||
export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate {
|
export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate {
|
||||||
@Output() firstStepDone = new EventEmitter<string>()
|
@Output() firstStepDone = new EventEmitter<string>()
|
||||||
@ViewChild('torrentfileInput') torrentfileInput
|
@ViewChild('torrentfileInput') torrentfileInput: any
|
||||||
|
|
||||||
videoFileName: string
|
videoFileName: string
|
||||||
magnetUri = ''
|
magnetUri = ''
|
||||||
|
|
|
@ -30,7 +30,7 @@ export abstract class VideoSend extends FormReactive implements OnInit, CanCompo
|
||||||
protected videoService: VideoService
|
protected videoService: VideoService
|
||||||
protected videoCaptionService: VideoCaptionService
|
protected videoCaptionService: VideoCaptionService
|
||||||
|
|
||||||
abstract canDeactivate ()
|
abstract canDeactivate (): any
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.buildForm({})
|
this.buildForm({})
|
||||||
|
|
|
@ -25,7 +25,7 @@ import { VideoCaptionService } from '@app/shared/video-caption'
|
||||||
})
|
})
|
||||||
export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate {
|
export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate {
|
||||||
@Output() firstStepDone = new EventEmitter<string>()
|
@Output() firstStepDone = new EventEmitter<string>()
|
||||||
@ViewChild('videofileInput') videofileInput
|
@ViewChild('videofileInput') videofileInput: any
|
||||||
|
|
||||||
// So that it can be accessed in the template
|
// So that it can be accessed in the template
|
||||||
readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY
|
readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
|
import { getAbsoluteAPIUrl } from '@app/shared/misc/utils'
|
||||||
import * as linkify from 'linkifyjs'
|
const linkify = require('linkifyjs')
|
||||||
import * as linkifyHtml from 'linkifyjs/html'
|
const linkifyHtml = require('linkifyjs/html')
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LinkifierService {
|
export class LinkifierService {
|
||||||
|
@ -40,7 +40,7 @@ export class LinkifierService {
|
||||||
const TT_UNDERSCORE = TT.UNDERSCORE
|
const TT_UNDERSCORE = TT.UNDERSCORE
|
||||||
const TT_DOT = TT.DOT
|
const TT_DOT = TT.DOT
|
||||||
|
|
||||||
function MENTION (value) {
|
function MENTION (value: any) {
|
||||||
this.v = value
|
this.v = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ export class VideoCommentAddComponent extends FormReactive implements OnInit {
|
||||||
this.formValidated()
|
this.formValidated()
|
||||||
}
|
}
|
||||||
|
|
||||||
openVisitorModal (event) {
|
openVisitorModal (event: any) {
|
||||||
if (this.user === null) { // we only open it for visitors
|
if (this.user === null) { // we only open it for visitors
|
||||||
// fixing ng-bootstrap ModalService and the "Expression Changed After It Has Been Checked" Error
|
// fixing ng-bootstrap ModalService and the "Expression Changed After It Has Been Checked" Error
|
||||||
event.srcElement.blur()
|
event.srcElement.blur()
|
||||||
|
|
|
@ -26,7 +26,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {
|
||||||
@Output() resetReply = new EventEmitter()
|
@Output() resetReply = new EventEmitter()
|
||||||
|
|
||||||
sanitizedCommentHTML = ''
|
sanitizedCommentHTML = ''
|
||||||
newParentComments = []
|
newParentComments: any = []
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private linkifierService: LinkifierService,
|
private linkifierService: LinkifierService,
|
||||||
|
|
|
@ -14,7 +14,7 @@ export class VideoComment implements VideoCommentServerModel {
|
||||||
account: AccountInterface
|
account: AccountInterface
|
||||||
totalReplies: number
|
totalReplies: number
|
||||||
by: string
|
by: string
|
||||||
accountAvatarUrl
|
accountAvatarUrl: string
|
||||||
|
|
||||||
constructor (hash: VideoCommentServerModel) {
|
constructor (hash: VideoCommentServerModel) {
|
||||||
this.id = hash.id
|
this.id = hash.id
|
||||||
|
|
|
@ -32,7 +32,7 @@ export class VideoCommentService {
|
||||||
|
|
||||||
return this.authHttp.post(url, normalizedComment)
|
return this.authHttp.post(url, normalizedComment)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(data => this.extractVideoComment(data['comment'])),
|
map((data: any) => this.extractVideoComment(data['comment'])),
|
||||||
catchError(err => this.restExtractor.handleError(err))
|
catchError(err => this.restExtractor.handleError(err))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ export class VideoCommentService {
|
||||||
|
|
||||||
return this.authHttp.post(url, normalizedComment)
|
return this.authHttp.post(url, normalizedComment)
|
||||||
.pipe(
|
.pipe(
|
||||||
map(data => this.extractVideoComment(data[ 'comment' ])),
|
map((data: any) => this.extractVideoComment(data[ 'comment' ])),
|
||||||
catchError(err => this.restExtractor.handleError(err))
|
catchError(err => this.restExtractor.handleError(err))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
|
||||||
threadComments: { [ id: number ]: VideoCommentThreadTree } = {}
|
threadComments: { [ id: number ]: VideoCommentThreadTree } = {}
|
||||||
threadLoading: { [ id: number ]: boolean } = {}
|
threadLoading: { [ id: number ]: boolean } = {}
|
||||||
|
|
||||||
syndicationItems = []
|
syndicationItems: any = []
|
||||||
|
|
||||||
private sub: Subscription
|
private sub: Subscription
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-supp
|
||||||
import { MetaService } from '@ngx-meta/core'
|
import { MetaService } from '@ngx-meta/core'
|
||||||
import { NotificationsService } from 'angular2-notifications'
|
import { NotificationsService } from 'angular2-notifications'
|
||||||
import { forkJoin, Subscription } from 'rxjs'
|
import { forkJoin, Subscription } from 'rxjs'
|
||||||
import * as videojs from 'video.js'
|
const videojs = require('video.js')
|
||||||
import 'videojs-hotkeys'
|
import 'videojs-hotkeys'
|
||||||
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
|
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
|
||||||
import * as WebTorrent from 'webtorrent'
|
import * as WebTorrent from 'webtorrent'
|
||||||
|
@ -45,7 +45,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
@ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent
|
@ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent
|
||||||
@ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
|
@ViewChild('subscribeButton') subscribeButton: SubscribeButtonComponent
|
||||||
|
|
||||||
player: videojs.Player
|
player: any
|
||||||
playerElement: HTMLVideoElement
|
playerElement: HTMLVideoElement
|
||||||
userRating: UserVideoRateType = null
|
userRating: UserVideoRateType = null
|
||||||
video: VideoDetails = null
|
video: VideoDetails = null
|
||||||
|
@ -435,7 +435,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
this.zone.runOutsideAngular(async () => {
|
this.zone.runOutsideAngular(async () => {
|
||||||
videojs(this.playerElement, videojsOptions, function () {
|
videojs(this.playerElement, videojsOptions, function () {
|
||||||
self.player = this
|
self.player = this
|
||||||
this.on('customError', (event, data) => self.handleError(data.err))
|
this.on('customError', (data: any) => self.handleError(data.err))
|
||||||
|
|
||||||
addContextMenu(self.player, self.video.embedUrl)
|
addContextMenu(self.player, self.video.embedUrl)
|
||||||
})
|
})
|
||||||
|
@ -448,7 +448,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
this.checkUserRating()
|
this.checkUserRating()
|
||||||
}
|
}
|
||||||
|
|
||||||
private setRating (nextRating) {
|
private setRating (nextRating: string) {
|
||||||
let method
|
let method
|
||||||
switch (nextRating) {
|
switch (nextRating) {
|
||||||
case 'like':
|
case 'like':
|
||||||
|
@ -466,11 +466,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
.subscribe(
|
.subscribe(
|
||||||
() => {
|
() => {
|
||||||
// Update the video like attribute
|
// Update the video like attribute
|
||||||
this.updateVideoRating(this.userRating, nextRating)
|
this.updateVideoRating(this.userRating, nextRating as VideoRateType)
|
||||||
this.userRating = nextRating
|
this.userRating = nextRating as UserVideoRateType
|
||||||
},
|
},
|
||||||
|
|
||||||
err => this.notificationsService.error(this.i18n('Error'), err.message)
|
(err: any) => this.notificationsService.error(this.i18n('Error'), err.message)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,15 +40,15 @@ export class PeertubeChunkStore extends EventEmitter {
|
||||||
// If the store is full
|
// If the store is full
|
||||||
private memoryChunks: { [ id: number ]: Buffer | true } = {}
|
private memoryChunks: { [ id: number ]: Buffer | true } = {}
|
||||||
private databaseName: string
|
private databaseName: string
|
||||||
private putBulkTimeout
|
private putBulkTimeout: any
|
||||||
private cleanerInterval
|
private cleanerInterval: any
|
||||||
private db: ChunkDatabase
|
private db: ChunkDatabase
|
||||||
private expirationDB: ExpirationDatabase
|
private expirationDB: ExpirationDatabase
|
||||||
private readonly length: number
|
private readonly length: number
|
||||||
private readonly lastChunkLength: number
|
private readonly lastChunkLength: number
|
||||||
private readonly lastChunkIndex: number
|
private readonly lastChunkIndex: number
|
||||||
|
|
||||||
constructor (chunkLength: number, opts) {
|
constructor (chunkLength: number, opts: any) {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
this.databaseName = 'webtorrent-chunks-'
|
this.databaseName = 'webtorrent-chunks-'
|
||||||
|
@ -113,13 +113,13 @@ export class PeertubeChunkStore extends EventEmitter {
|
||||||
}, PeertubeChunkStore.BUFFERING_PUT_MS)
|
}, PeertubeChunkStore.BUFFERING_PUT_MS)
|
||||||
}
|
}
|
||||||
|
|
||||||
get (index: number, opts, cb) {
|
get (index: number, opts: any, cb: any): any {
|
||||||
if (typeof opts === 'function') return this.get(index, null, opts)
|
if (typeof opts === 'function') return this.get(index, null, opts)
|
||||||
|
|
||||||
// IndexDB could be slow, use our memory index first
|
// IndexDB could be slow, use our memory index first
|
||||||
const memoryChunk = this.memoryChunks[index]
|
const memoryChunk = this.memoryChunks[index]
|
||||||
if (memoryChunk === undefined) {
|
if (memoryChunk === undefined) {
|
||||||
const err = new Error('Chunk not found')
|
const err = new Error('Chunk not found') as any
|
||||||
err['notFound'] = true
|
err['notFound'] = true
|
||||||
|
|
||||||
return process.nextTick(() => cb(err))
|
return process.nextTick(() => cb(err))
|
||||||
|
@ -146,11 +146,11 @@ export class PeertubeChunkStore extends EventEmitter {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
close (db) {
|
close (db: any) {
|
||||||
return this.destroy(db)
|
return this.destroy(db)
|
||||||
}
|
}
|
||||||
|
|
||||||
async destroy (cb) {
|
async destroy (cb: any) {
|
||||||
try {
|
try {
|
||||||
if (this.pendingPut) {
|
if (this.pendingPut) {
|
||||||
clearTimeout(this.putBulkTimeout)
|
clearTimeout(this.putBulkTimeout)
|
||||||
|
@ -225,7 +225,7 @@ export class PeertubeChunkStore extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private nextTick (cb, err, val?) {
|
private nextTick (cb: any, err: Error, val?: any) {
|
||||||
process.nextTick(() => cb(err, val), undefined)
|
process.nextTick(() => cb(err, val), undefined)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import * as videojs from 'video.js'
|
|
||||||
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
||||||
import { buildVideoLink } from './utils'
|
import { buildVideoLink } from './utils'
|
||||||
|
|
||||||
const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button')
|
const Button: VideoJSComponentInterface = videojsUntyped.getComponent('Button')
|
||||||
class PeerTubeLinkButton extends Button {
|
class PeerTubeLinkButton extends Button {
|
||||||
|
|
||||||
constructor (player: videojs.Player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Compon
|
||||||
|
|
||||||
class PeerTubeLoadProgressBar extends Component {
|
class PeerTubeLoadProgressBar extends Component {
|
||||||
|
|
||||||
constructor (player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
this.partEls_ = []
|
this.partEls_ = []
|
||||||
this.on(player, 'progress', this.update)
|
this.on(player, 'progress', this.update)
|
||||||
|
|
|
@ -75,12 +75,12 @@ function getVideojsOptions (options: {
|
||||||
enableVolumeScroll: false,
|
enableVolumeScroll: false,
|
||||||
enableModifiersForNumbers: false,
|
enableModifiersForNumbers: false,
|
||||||
|
|
||||||
fullscreenKey: function (event) {
|
fullscreenKey: function (event: any) {
|
||||||
// fullscreen with the f key or Ctrl+Enter
|
// fullscreen with the f key or Ctrl+Enter
|
||||||
return event.key === 'f' || (event.ctrlKey && event.key === 'Enter')
|
return event.key === 'f' || (event.ctrlKey && event.key === 'Enter')
|
||||||
},
|
},
|
||||||
|
|
||||||
seekStep: function (event) {
|
seekStep: function (event: any) {
|
||||||
// mimic VLC seek behavior, and default to 5 (original value is 5).
|
// mimic VLC seek behavior, and default to 5 (original value is 5).
|
||||||
if (event.ctrlKey && event.altKey) {
|
if (event.ctrlKey && event.altKey) {
|
||||||
return 5 * 60
|
return 5 * 60
|
||||||
|
@ -95,26 +95,26 @@ function getVideojsOptions (options: {
|
||||||
|
|
||||||
customKeys: {
|
customKeys: {
|
||||||
increasePlaybackRateKey: {
|
increasePlaybackRateKey: {
|
||||||
key: function (event) {
|
key: function (event: any) {
|
||||||
return event.key === '>'
|
return event.key === '>'
|
||||||
},
|
},
|
||||||
handler: function (player) {
|
handler: function (player: any) {
|
||||||
player.playbackRate((player.playbackRate() + 0.1).toFixed(2))
|
player.playbackRate((player.playbackRate() + 0.1).toFixed(2))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
decreasePlaybackRateKey: {
|
decreasePlaybackRateKey: {
|
||||||
key: function (event) {
|
key: function (event: any) {
|
||||||
return event.key === '<'
|
return event.key === '<'
|
||||||
},
|
},
|
||||||
handler: function (player) {
|
handler: function (player: any) {
|
||||||
player.playbackRate((player.playbackRate() - 0.1).toFixed(2))
|
player.playbackRate((player.playbackRate() - 0.1).toFixed(2))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
frameByFrame: {
|
frameByFrame: {
|
||||||
key: function (event) {
|
key: function (event: any) {
|
||||||
return event.key === '.'
|
return event.key === '.'
|
||||||
},
|
},
|
||||||
handler: function (player, options, event) {
|
handler: function (player: any) {
|
||||||
player.pause()
|
player.pause()
|
||||||
// Calculate movement distance (assuming 30 fps)
|
// Calculate movement distance (assuming 30 fps)
|
||||||
const dist = 1 / 30
|
const dist = 1 / 30
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import * as videojs from 'video.js'
|
const videojs = require('video.js')
|
||||||
import * as WebTorrent from 'webtorrent'
|
import * as WebTorrent from 'webtorrent'
|
||||||
import { VideoFile } from '../../../../shared/models/videos/video.model'
|
import { VideoFile } from '../../../../shared/models/videos/video.model'
|
||||||
import { renderVideo } from './video-renderer'
|
import { renderVideo } from './video-renderer'
|
||||||
import './settings-menu-button'
|
import './settings-menu-button'
|
||||||
import { PeertubePluginOptions, UserWatching, VideoJSCaption, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
import { PeertubePluginOptions, UserWatching, VideoJSCaption, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
||||||
import { isMobile, timeToInt, videoFileMaxByResolution, videoFileMinByResolution } from './utils'
|
import { isMobile, timeToInt, videoFileMaxByResolution, videoFileMinByResolution } from './utils'
|
||||||
import * as CacheChunkStore from 'cache-chunk-store'
|
const CacheChunkStore = require('cache-chunk-store')
|
||||||
import { PeertubeChunkStore } from './peertube-chunk-store'
|
import { PeertubeChunkStore } from './peertube-chunk-store'
|
||||||
import {
|
import {
|
||||||
getAverageBandwidthInStore,
|
getAverageBandwidthInStore,
|
||||||
|
@ -61,11 +61,11 @@ class PeerTubePlugin extends Plugin {
|
||||||
|
|
||||||
private player: any
|
private player: any
|
||||||
private currentVideoFile: VideoFile
|
private currentVideoFile: VideoFile
|
||||||
private torrent: WebTorrent.Torrent
|
private torrent: any
|
||||||
private videoCaptions: VideoJSCaption[]
|
private videoCaptions: VideoJSCaption[]
|
||||||
|
|
||||||
private renderer
|
private renderer: any
|
||||||
private fakeRenderer
|
private fakeRenderer: any
|
||||||
private destoyingFakeRenderer = false
|
private destoyingFakeRenderer = false
|
||||||
|
|
||||||
private autoResolution = true
|
private autoResolution = true
|
||||||
|
@ -73,17 +73,17 @@ class PeerTubePlugin extends Plugin {
|
||||||
private isAutoResolutionObservation = false
|
private isAutoResolutionObservation = false
|
||||||
private playerRefusedP2P = false
|
private playerRefusedP2P = false
|
||||||
|
|
||||||
private videoViewInterval
|
private videoViewInterval: any
|
||||||
private torrentInfoInterval
|
private torrentInfoInterval: any
|
||||||
private autoQualityInterval
|
private autoQualityInterval: any
|
||||||
private userWatchingVideoInterval
|
private userWatchingVideoInterval: any
|
||||||
private addTorrentDelay
|
private addTorrentDelay: any
|
||||||
private qualityObservationTimer
|
private qualityObservationTimer: any
|
||||||
private runAutoQualitySchedulerTimer
|
private runAutoQualitySchedulerTimer: any
|
||||||
|
|
||||||
private downloadSpeeds: number[] = []
|
private downloadSpeeds: number[] = []
|
||||||
|
|
||||||
constructor (player: videojs.Player, options: PeertubePluginOptions) {
|
constructor (player: any, options: PeertubePluginOptions) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
|
|
||||||
// Disable auto play on iOS
|
// Disable auto play on iOS
|
||||||
|
@ -273,7 +273,7 @@ class PeerTubePlugin extends Plugin {
|
||||||
|
|
||||||
const oldTorrent = this.torrent
|
const oldTorrent = this.torrent
|
||||||
const torrentOptions = {
|
const torrentOptions = {
|
||||||
store: (chunkLength, storeOpts) => new CacheChunkStore(new PeertubeChunkStore(chunkLength, storeOpts), {
|
store: (chunkLength: any, storeOpts: any) => new CacheChunkStore(new PeertubeChunkStore(chunkLength, storeOpts), {
|
||||||
max: 100
|
max: 100
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@ class PeerTubePlugin extends Plugin {
|
||||||
|
|
||||||
if (err) return this.fallbackToHttp(options, done)
|
if (err) return this.fallbackToHttp(options, done)
|
||||||
|
|
||||||
return this.tryToPlay(err => {
|
return this.tryToPlay((err: Error) => {
|
||||||
if (err) return done(err)
|
if (err) return done(err)
|
||||||
|
|
||||||
if (options.seek) this.seek(options.seek)
|
if (options.seek) this.seek(options.seek)
|
||||||
|
@ -316,7 +316,7 @@ class PeerTubePlugin extends Plugin {
|
||||||
}, options.delay || 0)
|
}, options.delay || 0)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.torrent.on('error', err => console.error(err))
|
this.torrent.on('error', (err: any) => console.error(err))
|
||||||
|
|
||||||
this.torrent.on('warning', (err: any) => {
|
this.torrent.on('warning', (err: any) => {
|
||||||
// We don't support HTTP tracker but we don't care -> we use the web socket tracker
|
// We don't support HTTP tracker but we don't care -> we use the web socket tracker
|
||||||
|
@ -350,7 +350,7 @@ class PeerTubePlugin extends Plugin {
|
||||||
const playPromise = this.player.play()
|
const playPromise = this.player.play()
|
||||||
if (playPromise !== undefined) {
|
if (playPromise !== undefined) {
|
||||||
return playPromise.then(done)
|
return playPromise.then(done)
|
||||||
.catch(err => {
|
.catch((err: Error) => {
|
||||||
if (err.message.indexOf('The play() request was interrupted by a call to pause()') !== -1) {
|
if (err.message.indexOf('The play() request was interrupted by a call to pause()') !== -1) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -627,7 +627,7 @@ class PeerTubePlugin extends Plugin {
|
||||||
this.player.options_.inactivityTimeout = saveInactivityTimeout
|
this.player.options_.inactivityTimeout = saveInactivityTimeout
|
||||||
}
|
}
|
||||||
|
|
||||||
const settingsDialog = this.player.children_.find(c => c.name_ === 'SettingsDialog')
|
const settingsDialog = this.player.children_.find((c: any) => c.name_ === 'SettingsDialog')
|
||||||
|
|
||||||
this.player.controlBar.on('mouseenter', () => disableInactivity())
|
this.player.controlBar.on('mouseenter', () => disableInactivity())
|
||||||
settingsDialog.on('mouseenter', () => disableInactivity())
|
settingsDialog.on('mouseenter', () => disableInactivity())
|
||||||
|
@ -641,7 +641,7 @@ class PeerTubePlugin extends Plugin {
|
||||||
return this.videoFiles[Math.floor(this.videoFiles.length / 2)]
|
return this.videoFiles[Math.floor(this.videoFiles.length / 2)]
|
||||||
}
|
}
|
||||||
|
|
||||||
private stopTorrent (torrent: WebTorrent.Torrent) {
|
private stopTorrent (torrent: any) {
|
||||||
torrent.pause()
|
torrent.pause()
|
||||||
// Pause does not remove actual peers (in particular the webseed peer)
|
// Pause does not remove actual peers (in particular the webseed peer)
|
||||||
torrent.removePeer(torrent[ 'ws' ])
|
torrent.removePeer(torrent[ 'ws' ])
|
||||||
|
@ -703,7 +703,7 @@ class PeerTubePlugin extends Plugin {
|
||||||
const percent = time / this.player_.duration()
|
const percent = time / this.player_.duration()
|
||||||
return percent >= 1 ? 1 : percent
|
return percent >= 1 ? 1 : percent
|
||||||
}
|
}
|
||||||
SeekBar.prototype.handleMouseMove = function handleMouseMove (event) {
|
SeekBar.prototype.handleMouseMove = function handleMouseMove (event: any) {
|
||||||
let newTime = this.calculateDistance(event) * this.player_.duration()
|
let newTime = this.calculateDistance(event) * this.player_.duration()
|
||||||
if (newTime === this.player_.duration()) {
|
if (newTime === this.player_.duration()) {
|
||||||
newTime = newTime - 0.1
|
newTime = newTime - 0.1
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import * as videojs from 'video.js'
|
const videojs = require('video.js')
|
||||||
import { VideoFile } from '../../../../shared/models/videos/video.model'
|
import { VideoFile } from '../../../../shared/models/videos/video.model'
|
||||||
import { PeerTubePlugin } from './peertube-videojs-plugin'
|
import { PeerTubePlugin } from './peertube-videojs-plugin'
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ declare namespace videojs {
|
||||||
interface VideoJSComponentInterface {
|
interface VideoJSComponentInterface {
|
||||||
_player: videojs.Player
|
_player: videojs.Player
|
||||||
|
|
||||||
new (player: videojs.Player, options?: any)
|
new (player: videojs.Player, options?: any): any
|
||||||
|
|
||||||
registerComponent (name: string, obj: any)
|
registerComponent (name: string, obj: any): any
|
||||||
}
|
}
|
||||||
|
|
||||||
type VideoJSCaption = {
|
type VideoJSCaption = {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import * as videojs from 'video.js'
|
|
||||||
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
||||||
import { ResolutionMenuItem } from './resolution-menu-item'
|
import { ResolutionMenuItem } from './resolution-menu-item'
|
||||||
|
|
||||||
|
@ -7,7 +6,7 @@ const MenuButton: VideoJSComponentInterface = videojsUntyped.getComponent('MenuB
|
||||||
class ResolutionMenuButton extends MenuButton {
|
class ResolutionMenuButton extends MenuButton {
|
||||||
label: HTMLElement
|
label: HTMLElement
|
||||||
|
|
||||||
constructor (player: videojs.Player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
this.player = player
|
this.player = player
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import * as videojs from 'video.js'
|
|
||||||
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
||||||
|
|
||||||
const MenuItem: VideoJSComponentInterface = videojsUntyped.getComponent('MenuItem')
|
const MenuItem: VideoJSComponentInterface = videojsUntyped.getComponent('MenuItem')
|
||||||
class ResolutionMenuItem extends MenuItem {
|
class ResolutionMenuItem extends MenuItem {
|
||||||
|
|
||||||
constructor (player: videojs.Player, options) {
|
constructor (player: any, options: any) {
|
||||||
const currentResolutionId = player.peertube().getCurrentResolutionId()
|
const currentResolutionId = player.peertube().getCurrentResolutionId()
|
||||||
options.selectable = true
|
options.selectable = true
|
||||||
options.selected = options.id === currentResolutionId
|
options.selected = options.id === currentResolutionId
|
||||||
|
@ -18,7 +17,7 @@ class ResolutionMenuItem extends MenuItem {
|
||||||
player.peertube().on('autoResolutionUpdate', () => this.updateSelection())
|
player.peertube().on('autoResolutionUpdate', () => this.updateSelection())
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClick (event) {
|
handleClick (event: any) {
|
||||||
if (this.id === -1 && this.player_.peertube().isAutoResolutionForbidden()) return
|
if (this.id === -1 && this.player_.peertube().isAutoResolutionForbidden()) return
|
||||||
|
|
||||||
super.handleClick(event)
|
super.handleClick(event)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Author: Yanko Shterev
|
// Author: Yanko Shterev
|
||||||
// Thanks https://github.com/yshterev/videojs-settings-menu
|
// Thanks https://github.com/yshterev/videojs-settings-menu
|
||||||
|
|
||||||
import * as videojs from 'video.js'
|
const videojs = require('video.js')
|
||||||
import { SettingsMenuItem } from './settings-menu-item'
|
import { SettingsMenuItem } from './settings-menu-item'
|
||||||
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
||||||
import { toTitleCase } from './utils'
|
import { toTitleCase } from './utils'
|
||||||
|
@ -11,7 +11,7 @@ const Menu: VideoJSComponentInterface = videojsUntyped.getComponent('Menu')
|
||||||
const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component')
|
const Component: VideoJSComponentInterface = videojsUntyped.getComponent('Component')
|
||||||
|
|
||||||
class SettingsButton extends Button {
|
class SettingsButton extends Button {
|
||||||
constructor (player: videojs.Player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
|
|
||||||
this.playerComponent = player
|
this.playerComponent = player
|
||||||
|
@ -48,7 +48,7 @@ class SettingsButton extends Button {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onDisposeSettingsItem (event, name: string) {
|
onDisposeSettingsItem (name: string) {
|
||||||
if (name === undefined) {
|
if (name === undefined) {
|
||||||
let children = this.menu.children()
|
let children = this.menu.children()
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class SettingsButton extends Button {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onAddSettingsItem (event, data) {
|
onAddSettingsItem (data: any) {
|
||||||
const [ entry, options ] = data
|
const [ entry, options ] = data
|
||||||
|
|
||||||
this.addMenuItem(entry, options)
|
this.addMenuItem(entry, options)
|
||||||
|
@ -120,7 +120,7 @@ class SettingsButton extends Button {
|
||||||
this.resetChildren()
|
this.resetChildren()
|
||||||
}
|
}
|
||||||
|
|
||||||
getComponentSize (element) {
|
getComponentSize (element: any) {
|
||||||
let width: number = null
|
let width: number = null
|
||||||
let height: number = null
|
let height: number = null
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ class SettingsButton extends Button {
|
||||||
this.panelChild.addChild(this.menu)
|
this.panelChild.addChild(this.menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
addMenuItem (entry, options) {
|
addMenuItem (entry: any, options: any) {
|
||||||
const openSubMenu = function () {
|
const openSubMenu = function () {
|
||||||
if (videojsUntyped.dom.hasClass(this.el_, 'open')) {
|
if (videojsUntyped.dom.hasClass(this.el_, 'open')) {
|
||||||
videojsUntyped.dom.removeClass(this.el_, 'open')
|
videojsUntyped.dom.removeClass(this.el_, 'open')
|
||||||
|
@ -218,7 +218,7 @@ class SettingsButton extends Button {
|
||||||
}
|
}
|
||||||
|
|
||||||
class SettingsPanel extends Component {
|
class SettingsPanel extends Component {
|
||||||
constructor (player: videojs.Player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ class SettingsPanel extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
class SettingsPanelChild extends Component {
|
class SettingsPanelChild extends Component {
|
||||||
constructor (player: videojs.Player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ class SettingsPanelChild extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
class SettingsDialog extends Component {
|
class SettingsDialog extends Component {
|
||||||
constructor (player: videojs.Player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
this.hide()
|
this.hide()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Author: Yanko Shterev
|
// Author: Yanko Shterev
|
||||||
// Thanks https://github.com/yshterev/videojs-settings-menu
|
// Thanks https://github.com/yshterev/videojs-settings-menu
|
||||||
|
|
||||||
import * as videojs from 'video.js'
|
|
||||||
import { toTitleCase } from './utils'
|
import { toTitleCase } from './utils'
|
||||||
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
|
||||||
|
|
||||||
|
@ -10,7 +9,7 @@ const component: VideoJSComponentInterface = videojsUntyped.getComponent('Compon
|
||||||
|
|
||||||
class SettingsMenuItem extends MenuItem {
|
class SettingsMenuItem extends MenuItem {
|
||||||
|
|
||||||
constructor (player: videojs.Player, options, entry: string, menuButton: VideoJSComponentInterface) {
|
constructor (player: any, options: any, entry: string, menuButton: VideoJSComponentInterface) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
|
|
||||||
this.settingsButton = menuButton
|
this.settingsButton = menuButton
|
||||||
|
@ -55,7 +54,7 @@ class SettingsMenuItem extends MenuItem {
|
||||||
this.transitionEndHandler = this.onTransitionEnd.bind(this)
|
this.transitionEndHandler = this.onTransitionEnd.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
onSubmenuClick (event) {
|
onSubmenuClick (event: any) {
|
||||||
let target = null
|
let target = null
|
||||||
|
|
||||||
if (event.type === 'tap') {
|
if (event.type === 'tap') {
|
||||||
|
@ -150,7 +149,7 @@ class SettingsMenuItem extends MenuItem {
|
||||||
*
|
*
|
||||||
* @method PrefixedEvent
|
* @method PrefixedEvent
|
||||||
*/
|
*/
|
||||||
PrefixedEvent (element, type, callback, action = 'addEvent') {
|
PrefixedEvent (element: any, type: any, callback: any, action = 'addEvent') {
|
||||||
let prefix = ['webkit', 'moz', 'MS', 'o', '']
|
let prefix = ['webkit', 'moz', 'MS', 'o', '']
|
||||||
|
|
||||||
for (let p = 0; p < prefix.length; p++) {
|
for (let p = 0; p < prefix.length; p++) {
|
||||||
|
@ -166,7 +165,7 @@ class SettingsMenuItem extends MenuItem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onTransitionEnd (event) {
|
onTransitionEnd (event: any) {
|
||||||
if (event.propertyName !== 'margin-right') {
|
if (event.propertyName !== 'margin-right') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -229,7 +228,7 @@ class SettingsMenuItem extends MenuItem {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
update (event?: Event) {
|
update (event?: any) {
|
||||||
let target = null
|
let target = null
|
||||||
let subMenu = this.subMenu.name()
|
let subMenu = this.subMenu.name()
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ class TheaterButton extends Button {
|
||||||
|
|
||||||
private static readonly THEATER_MODE_CLASS = 'vjs-theater-enabled'
|
private static readonly THEATER_MODE_CLASS = 'vjs-theater-enabled'
|
||||||
|
|
||||||
constructor (player, options) {
|
constructor (player: any, options: any) {
|
||||||
super(player, options)
|
super(player, options)
|
||||||
|
|
||||||
const enabled = getStoredTheater()
|
const enabled = getStoredTheater()
|
||||||
|
|
|
@ -12,7 +12,7 @@ const dictionaryBytes: Array<{max: number, type: string}> = [
|
||||||
{ max: 1073741824, type: 'MB' },
|
{ max: 1073741824, type: 'MB' },
|
||||||
{ max: 1.0995116e12, type: 'GB' }
|
{ max: 1.0995116e12, type: 'GB' }
|
||||||
]
|
]
|
||||||
function bytes (value) {
|
function bytes (value: any) {
|
||||||
const format = dictionaryBytes.find(d => value < d.max) || dictionaryBytes[dictionaryBytes.length - 1]
|
const format = dictionaryBytes.find(d => value < d.max) || dictionaryBytes[dictionaryBytes.length - 1]
|
||||||
const calc = Math.floor(value / (format.max / 1024)).toString()
|
const calc = Math.floor(value / (format.max / 1024)).toString()
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
// Thanks: https://github.com/feross/render-media
|
// Thanks: https://github.com/feross/render-media
|
||||||
// TODO: use render-media once https://github.com/feross/render-media/issues/32 is fixed
|
// TODO: use render-media once https://github.com/feross/render-media/issues/32 is fixed
|
||||||
|
|
||||||
import * as MediaElementWrapper from 'mediasource'
|
const MediaElementWrapper = require('mediasource')
|
||||||
import { extname } from 'path'
|
import { extname } from 'path'
|
||||||
import * as videostream from 'videostream'
|
const videostream = require('videostream')
|
||||||
|
|
||||||
const VIDEOSTREAM_EXTS = [
|
const VIDEOSTREAM_EXTS = [
|
||||||
'.m4a',
|
'.m4a',
|
||||||
|
@ -17,7 +17,7 @@ type RenderMediaOptions = {
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderVideo (
|
function renderVideo (
|
||||||
file,
|
file: any,
|
||||||
elem: HTMLVideoElement,
|
elem: HTMLVideoElement,
|
||||||
opts: RenderMediaOptions,
|
opts: RenderMediaOptions,
|
||||||
callback: (err: Error, renderer: any) => void
|
callback: (err: Error, renderer: any) => void
|
||||||
|
@ -27,11 +27,11 @@ function renderVideo (
|
||||||
return renderMedia(file, elem, opts, callback)
|
return renderMedia(file, elem, opts, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) {
|
function renderMedia (file: any, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) {
|
||||||
const extension = extname(file.name).toLowerCase()
|
const extension = extname(file.name).toLowerCase()
|
||||||
let preparedElem = undefined
|
let preparedElem: any = undefined
|
||||||
let currentTime = 0
|
let currentTime = 0
|
||||||
let renderer
|
let renderer: any
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (VIDEOSTREAM_EXTS.indexOf(extension) >= 0) {
|
if (VIDEOSTREAM_EXTS.indexOf(extension) >= 0) {
|
||||||
|
@ -45,7 +45,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca
|
||||||
|
|
||||||
function useVideostream () {
|
function useVideostream () {
|
||||||
prepareElem()
|
prepareElem()
|
||||||
preparedElem.addEventListener('error', function onError (err) {
|
preparedElem.addEventListener('error', function onError (err: Error) {
|
||||||
preparedElem.removeEventListener('error', onError)
|
preparedElem.removeEventListener('error', onError)
|
||||||
|
|
||||||
return callback(err)
|
return callback(err)
|
||||||
|
@ -58,7 +58,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca
|
||||||
const codecs = getCodec(file.name, useVP9)
|
const codecs = getCodec(file.name, useVP9)
|
||||||
|
|
||||||
prepareElem()
|
prepareElem()
|
||||||
preparedElem.addEventListener('error', function onError (err) {
|
preparedElem.addEventListener('error', function onError (err: Error) {
|
||||||
preparedElem.removeEventListener('error', onError)
|
preparedElem.removeEventListener('error', onError)
|
||||||
|
|
||||||
// Try with vp9 before returning an error
|
// Try with vp9 before returning an error
|
||||||
|
@ -102,7 +102,7 @@ function renderMedia (file, elem: HTMLVideoElement, opts: RenderMediaOptions, ca
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateFile (file) {
|
function validateFile (file: any) {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
throw new Error('file cannot be null or undefined')
|
throw new Error('file cannot be null or undefined')
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ class WebtorrentInfoButton extends Button {
|
||||||
subDivHttp.appendChild(subDivHttpText)
|
subDivHttp.appendChild(subDivHttpText)
|
||||||
div.appendChild(subDivHttp)
|
div.appendChild(subDivHttp)
|
||||||
|
|
||||||
this.player_.peertube().on('torrentInfo', (event, data) => {
|
this.player_.peertube().on('torrentInfo', (data: any) => {
|
||||||
// We are in HTTP fallback
|
// We are in HTTP fallback
|
||||||
if (!data) {
|
if (!data) {
|
||||||
subDivHttp.className = 'vjs-peertube-displayed'
|
subDivHttp.className = 'vjs-peertube-displayed'
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { hmrBootstrap } from './hmr'
|
||||||
import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
|
import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
|
||||||
import { buildFileLocale } from '../../shared'
|
import { buildFileLocale } from '../../shared'
|
||||||
|
|
||||||
let providers = []
|
let providers: any[] = []
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
enableProdMode()
|
enableProdMode()
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,24 +18,26 @@
|
||||||
* BROWSER POLYFILLS
|
* BROWSER POLYFILLS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
|
/**
|
||||||
|
* IE9, IE10 and IE11 requires all of the following polyfills.
|
||||||
|
*/
|
||||||
|
|
||||||
// For Google Bot
|
// For Google Bot
|
||||||
import 'core-js/es6/symbol';
|
import 'core-js/es6/symbol'
|
||||||
import 'core-js/es6/object';
|
import 'core-js/es6/object'
|
||||||
import 'core-js/es6/function';
|
import 'core-js/es6/function'
|
||||||
import 'core-js/es6/parse-int';
|
import 'core-js/es6/parse-int'
|
||||||
import 'core-js/es6/parse-float';
|
import 'core-js/es6/parse-float'
|
||||||
import 'core-js/es6/number';
|
import 'core-js/es6/number'
|
||||||
import 'core-js/es6/math';
|
import 'core-js/es6/math'
|
||||||
import 'core-js/es6/string';
|
import 'core-js/es6/string'
|
||||||
import 'core-js/es6/date';
|
import 'core-js/es6/date'
|
||||||
import 'core-js/es6/array';
|
import 'core-js/es6/array'
|
||||||
import 'core-js/es6/regexp';
|
import 'core-js/es6/regexp'
|
||||||
import 'core-js/es6/map';
|
import 'core-js/es6/map'
|
||||||
import 'core-js/es6/weak-map';
|
import 'core-js/es6/weak-map'
|
||||||
import 'core-js/es6/set';
|
import 'core-js/es6/set'
|
||||||
import 'core-js/es7/object';
|
import 'core-js/es7/object'
|
||||||
|
|
||||||
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
|
||||||
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
// import 'classlist.js'; // Run `npm install --save classlist.js`.
|
||||||
|
@ -43,17 +45,18 @@ import 'core-js/es7/object';
|
||||||
/** IE10 and IE11 requires the following for the Reflect API. */
|
/** IE10 and IE11 requires the following for the Reflect API. */
|
||||||
|
|
||||||
// For Google Bot
|
// For Google Bot
|
||||||
import 'core-js/es6/reflect';
|
import 'core-js/es6/reflect'
|
||||||
|
|
||||||
/** Evergreen browsers require these. **/
|
/**
|
||||||
|
* Evergreen browsers require these.
|
||||||
|
*/
|
||||||
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
|
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
|
||||||
import 'core-js/es7/reflect'
|
import 'core-js/es7/reflect'
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Required to support Web Animations `@angular/platform-browser/animations`.
|
* Required to support Web Animations `@angular/platform-browser/animations`.
|
||||||
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
|
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
|
||||||
**/
|
*/
|
||||||
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,19 +73,17 @@ import 'core-js/es7/reflect'
|
||||||
*/
|
*/
|
||||||
// (window as any).__Zone_enable_cross_context_check = true;
|
// (window as any).__Zone_enable_cross_context_check = true;
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************************************
|
/***************************************************************************************************
|
||||||
* Zone JS is required by default for Angular itself.
|
* Zone JS is required by default for Angular itself.
|
||||||
*/
|
*/
|
||||||
import 'zone.js/dist/zone' // Included with Angular CLI.
|
import 'zone.js/dist/zone' // Included with Angular CLI.
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************************************
|
/***************************************************************************************************
|
||||||
* APPLICATION IMPORTS
|
* APPLICATION IMPORTS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// global/process polyfills
|
// global/process polyfills
|
||||||
|
|
||||||
;(window as any).global = window;
|
;(window as any).global = window
|
||||||
;(window as any).process = require('process/');
|
;(window as any).process = require('process/')
|
||||||
;(window as any).Buffer = require('buffer/').Buffer;
|
;(window as any).Buffer = require('buffer/').Buffer
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
// Does nothing. Used to shim out node.js modules
|
// Does nothing. Used to shim out node.js modules
|
||||||
// which are no-ops in the browser.
|
// which are no-ops in the browser.
|
||||||
export const NOOP = 0
|
export const NOOP = 0
|
||||||
|
|
|
@ -17,7 +17,7 @@ import 'core-js/es6/set'
|
||||||
// For google bot that uses Chrome 41 and does not understand fetch
|
// For google bot that uses Chrome 41 and does not understand fetch
|
||||||
import 'whatwg-fetch'
|
import 'whatwg-fetch'
|
||||||
|
|
||||||
import * as vjs from 'video.js'
|
const vjs = require('video.js')
|
||||||
import * as Channel from 'jschannel'
|
import * as Channel from 'jschannel'
|
||||||
|
|
||||||
import { peertubeTranslate, ResultList, VideoDetails } from '../../../../shared'
|
import { peertubeTranslate, ResultList, VideoDetails } from '../../../../shared'
|
||||||
|
@ -304,7 +304,7 @@ class PeerTubeEmbed {
|
||||||
|
|
||||||
this.playerOptions = videojsOptions
|
this.playerOptions = videojsOptions
|
||||||
this.player = vjs(this.videoContainerId, videojsOptions, () => {
|
this.player = vjs(this.videoContainerId, videojsOptions, () => {
|
||||||
this.player.on('customError', (event, data) => this.handleError(data.err))
|
this.player.on('customError', (data: any) => this.handleError(data.err))
|
||||||
|
|
||||||
window[ 'videojsPlayer' ] = this.player
|
window[ 'videojsPlayer' ] = this.player
|
||||||
|
|
||||||
|
|
|
@ -66,11 +66,11 @@ window.addEventListener('load', async () => {
|
||||||
updateRates()
|
updateRates()
|
||||||
})
|
})
|
||||||
|
|
||||||
let updateResolutions = resolutions => {
|
let updateResolutions = ((resolutions: any) => {
|
||||||
let resolutionListEl = document.querySelector('#resolution-list')
|
let resolutionListEl = document.querySelector('#resolution-list')
|
||||||
resolutionListEl.innerHTML = ''
|
resolutionListEl.innerHTML = ''
|
||||||
|
|
||||||
resolutions.forEach(resolution => {
|
resolutions.forEach((resolution: any) => {
|
||||||
if (resolution.active) {
|
if (resolution.active) {
|
||||||
let itemEl = document.createElement('strong')
|
let itemEl = document.createElement('strong')
|
||||||
itemEl.innerText = `${resolution.label} (active)`
|
itemEl.innerText = `${resolution.label} (active)`
|
||||||
|
@ -87,7 +87,7 @@ window.addEventListener('load', async () => {
|
||||||
resolutionListEl.appendChild(itemEl)
|
resolutionListEl.appendChild(itemEl)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
|
|
||||||
player.getResolutions().then(
|
player.getResolutions().then(
|
||||||
resolutions => updateResolutions(resolutions))
|
resolutions => updateResolutions(resolutions))
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
declare var module: NodeModule;
|
declare var module: NodeModule;
|
||||||
interface NodeModule {
|
interface NodeModule {
|
||||||
id: string;
|
id: string;
|
||||||
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": true,
|
||||||
|
"suppressImplicitAnyIndexErrors":true,
|
||||||
"alwaysStrict": true,
|
"alwaysStrict": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
export const LOCALE_FILES = [ 'player', 'server' ]
|
export const LOCALE_FILES = [ 'player', 'server' ]
|
||||||
|
|
||||||
export const I18N_LOCALES = {
|
export const I18N_LOCALES: any = {
|
||||||
'en-US': 'English',
|
'en-US': 'English',
|
||||||
'fr-FR': 'Français',
|
'fr-FR': 'Français',
|
||||||
'eu-ES': 'Euskara',
|
'eu-ES': 'Euskara',
|
||||||
|
@ -17,7 +17,7 @@ export const I18N_LOCALES = {
|
||||||
'zh-Hans-CN': '简体中文(中国)'
|
'zh-Hans-CN': '简体中文(中国)'
|
||||||
}
|
}
|
||||||
|
|
||||||
const I18N_LOCALE_ALIAS = {
|
const I18N_LOCALE_ALIAS: any = {
|
||||||
'en': 'en-US',
|
'en': 'en-US',
|
||||||
'fr': 'fr-FR',
|
'fr': 'fr-FR',
|
||||||
'eu': 'eu-ES',
|
'eu': 'eu-ES',
|
||||||
|
|
|
@ -15,4 +15,5 @@ export interface VideosOverview {
|
||||||
tag: string
|
tag: string
|
||||||
videos: Video[]
|
videos: Video[]
|
||||||
}[]
|
}[]
|
||||||
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ export interface CustomConfig {
|
||||||
'480p': boolean
|
'480p': boolean
|
||||||
'720p': boolean
|
'720p': boolean
|
||||||
'1080p': boolean
|
'1080p': boolean
|
||||||
|
[key: string]: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,4 +20,5 @@ export interface User {
|
||||||
blockedReason?: string
|
blockedReason?: string
|
||||||
|
|
||||||
videoQuotaUsed?: number
|
videoQuotaUsed?: number
|
||||||
|
[key: string]: any
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue