import { mapValues, pickBy } from 'lodash-es'
-import { buildVideoLink, buildVideoOrPlaylistEmbed } from 'src/assets/player/utils'
import { Component, Input, OnInit, ViewChild } from '@angular/core'
-import { DomSanitizer, SafeHtml } from '@angular/platform-browser'
+import { DomSanitizer } from '@angular/platform-browser'
import { Notifier } from '@app/core'
import { ABUSE_REASON_VALIDATOR } from '@app/shared/form-validators/abuse-validators'
import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
error: string = null
predefinedReasons: { id: AbusePredefinedReasonsString, label: string, description?: string, help?: string }[] = []
- embedHtml: SafeHtml
private openedModal: NgbModalRef
return this.form.get('timestamp').value
}
- getVideoEmbed () {
- return this.sanitizer.bypassSecurityTrustHtml(
- buildVideoOrPlaylistEmbed(
- buildVideoLink({
- baseUrl: this.video.embedUrl,
- title: false,
- warningTitle: false
- })
- )
- )
- }
-
ngOnInit () {
this.buildForm({
reason: ABUSE_REASON_VALIDATOR,
})
this.predefinedReasons = this.abuseService.getPrefefinedReasons('video')
-
- this.embedHtml = this.getVideoEmbed()
}
show () {
startAt: hasStart && startAt ? startAt : undefined,
endAt: hasEnd && endAt ? endAt : undefined
}
- }).subscribe(
- () => {
+ }).subscribe({
+ next: () => {
this.notifier.success($localize`Video reported.`)
this.hide()
},
- err => this.notifier.error(err.message)
- )
+ error: err => this.notifier.error(err.message)
+ })
}
isRemote () {