Fix live/upload redirection
This commit is contained in:
parent
586a7478b6
commit
2e80d256cc
4 changed files with 16 additions and 7 deletions
|
@ -26,8 +26,11 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
|
||||||
isInUpdateForm = false
|
isInUpdateForm = false
|
||||||
|
|
||||||
liveVideo: LiveVideo
|
liveVideo: LiveVideo
|
||||||
|
|
||||||
videoId: number
|
videoId: number
|
||||||
videoUUID: string
|
videoUUID: string
|
||||||
|
videoShortUUID: string
|
||||||
|
|
||||||
error: string
|
error: string
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
@ -79,6 +82,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
|
||||||
next: res => {
|
next: res => {
|
||||||
this.videoId = res.video.id
|
this.videoId = res.video.id
|
||||||
this.videoUUID = res.video.uuid
|
this.videoUUID = res.video.uuid
|
||||||
|
this.videoShortUUID = res.video.shortUUID
|
||||||
this.isInUpdateForm = true
|
this.isInUpdateForm = true
|
||||||
|
|
||||||
this.firstStepDone.emit(name)
|
this.firstStepDone.emit(name)
|
||||||
|
@ -113,6 +117,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
|
||||||
video.patch(this.form.value)
|
video.patch(this.form.value)
|
||||||
video.id = this.videoId
|
video.id = this.videoId
|
||||||
video.uuid = this.videoUUID
|
video.uuid = this.videoUUID
|
||||||
|
video.shortUUID = this.videoShortUUID
|
||||||
|
|
||||||
const liveVideoUpdate: LiveVideoUpdate = {
|
const liveVideoUpdate: LiveVideoUpdate = {
|
||||||
saveReplay: this.form.value.saveReplay,
|
saveReplay: this.form.value.saveReplay,
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { genericUploadErrorHandler, scrollToTop } from '@app/helpers'
|
||||||
import { FormValidatorService } from '@app/shared/shared-forms'
|
import { FormValidatorService } from '@app/shared/shared-forms'
|
||||||
import { BytesPipe, Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
|
import { BytesPipe, Video, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main'
|
||||||
import { LoadingBarService } from '@ngx-loading-bar/core'
|
import { LoadingBarService } from '@ngx-loading-bar/core'
|
||||||
import { HttpStatusCode, VideoPrivacy } from '@shared/models'
|
import { HttpStatusCode, VideoCreateResult, VideoPrivacy } from '@shared/models'
|
||||||
import { UploaderXFormData } from './uploaderx-form-data'
|
import { UploaderXFormData } from './uploaderx-form-data'
|
||||||
import { VideoSend } from './video-send'
|
import { VideoSend } from './video-send'
|
||||||
|
|
||||||
|
@ -33,9 +33,10 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
|
||||||
|
|
||||||
videoUploaded = false
|
videoUploaded = false
|
||||||
videoUploadPercents = 0
|
videoUploadPercents = 0
|
||||||
videoUploadedIds = {
|
videoUploadedIds: VideoCreateResult = {
|
||||||
id: 0,
|
id: 0,
|
||||||
uuid: ''
|
uuid: '',
|
||||||
|
shortUUID: ''
|
||||||
}
|
}
|
||||||
formData: FormData
|
formData: FormData
|
||||||
|
|
||||||
|
@ -237,6 +238,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
|
||||||
video.patch(this.form.value)
|
video.patch(this.form.value)
|
||||||
video.id = this.videoUploadedIds.id
|
video.id = this.videoUploadedIds.id
|
||||||
video.uuid = this.videoUploadedIds.uuid
|
video.uuid = this.videoUploadedIds.uuid
|
||||||
|
video.shortUUID = this.videoUploadedIds.shortUUID
|
||||||
|
|
||||||
this.isUpdatingVideo = true
|
this.isUpdatingVideo = true
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,13 @@ export class VideoEdit implements VideoUpdate {
|
||||||
previewfile?: any
|
previewfile?: any
|
||||||
thumbnailUrl: string
|
thumbnailUrl: string
|
||||||
previewUrl: string
|
previewUrl: string
|
||||||
uuid?: string
|
|
||||||
id?: number
|
|
||||||
scheduleUpdate?: VideoScheduleUpdate
|
scheduleUpdate?: VideoScheduleUpdate
|
||||||
originallyPublishedAt?: Date | string
|
originallyPublishedAt?: Date | string
|
||||||
|
|
||||||
|
id?: number
|
||||||
|
uuid?: string
|
||||||
|
shortUUID?: string
|
||||||
|
|
||||||
pluginData?: any
|
pluginData?: any
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { catchError } from 'rxjs/operators'
|
||||||
import { HttpClient } from '@angular/common/http'
|
import { HttpClient } from '@angular/common/http'
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { RestExtractor } from '@app/core'
|
import { RestExtractor } from '@app/core'
|
||||||
import { LiveVideo, LiveVideoCreate, LiveVideoUpdate } from '@shared/models'
|
import { LiveVideo, LiveVideoCreate, LiveVideoUpdate, VideoCreateResult } from '@shared/models'
|
||||||
import { environment } from '../../../environments/environment'
|
import { environment } from '../../../environments/environment'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -16,7 +16,7 @@ export class LiveVideoService {
|
||||||
|
|
||||||
goLive (video: LiveVideoCreate) {
|
goLive (video: LiveVideoCreate) {
|
||||||
return this.authHttp
|
return this.authHttp
|
||||||
.post<{ video: { id: number, uuid: string } }>(LiveVideoService.BASE_VIDEO_LIVE_URL, video)
|
.post<{ video: VideoCreateResult }>(LiveVideoService.BASE_VIDEO_LIVE_URL, video)
|
||||||
.pipe(catchError(err => this.restExtractor.handleError(err)))
|
.pipe(catchError(err => this.restExtractor.handleError(err)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue