Просмотр исходного кода

Merge branch 'release/5.1.0' into develop

tags/v5.1.0
Chocobozzz 2 месяцев назад
Родитель
Сommit
0e3026f315
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 583A612D890159BE
4 измененных файлов: 11 добавлений и 12 удалений
  1. +5
    -3
      client/src/app/+videos/+video-edit/shared/video-edit.component.html
  2. +1
    -2
      client/src/assets/player/shared/manager-options/hls-options-builder.ts
  3. +3
    -7
      client/src/assets/player/shared/p2p-media-loader/segment-validator.ts
  4. +2
    -0
      scripts/create-move-video-storage-job.ts

+ 5
- 3
client/src/app/+videos/+video-edit/shared/video-edit.component.html Просмотреть файл

@@ -45,9 +45,11 @@

<my-help helpType="markdownText">
<ng-template ptTemplate="preHtml">
<ng-container i18n>
Video descriptions are truncated by default and require manual action to expand them.
</ng-container>
<ng-container i18n>Video descriptions are truncated by default and require manual action to expand them.</ng-container>

<br />

<ng-container i18n>A timestamp (<i>00:05</i> for example) is automatically converted into a link to a part of the video.</ng-container>
</ng-template>
</my-help>



+ 1
- 2
client/src/assets/player/shared/manager-options/hls-options-builder.ts Просмотреть файл

@@ -96,7 +96,6 @@ export class HLSOptionsBuilder {

segmentValidator: segmentValidatorFactory({
segmentsSha256Url: this.options.p2pMediaLoader.segmentsSha256Url,
isLive: this.options.common.isLive,
authorizationHeader: this.options.common.authorizationHeader,
requiresAuth: this.options.common.requiresAuth,
serverUrl: this.options.common.serverUrl
@@ -129,7 +128,7 @@ export class HLSOptionsBuilder {
...base,

useP2P: false,
httpDownloadProbability: 1
requiredSegmentsPriority: 10
}

case LiveVideoLatencyMode.HIGH_LATENCY:


+ 3
- 7
client/src/assets/player/shared/p2p-media-loader/segment-validator.ts Просмотреть файл

@@ -7,24 +7,20 @@ import { isSameOrigin } from '../common'

type SegmentsJSON = { [filename: string]: string | { [byterange: string]: string } }

const maxRetries = 3
const maxRetries = 10

function segmentValidatorFactory (options: {
serverUrl: string
segmentsSha256Url: string
isLive: boolean
authorizationHeader: () => string
requiresAuth: boolean
}) {
const { serverUrl, segmentsSha256Url, isLive, authorizationHeader, requiresAuth } = options
const { serverUrl, segmentsSha256Url, authorizationHeader, requiresAuth } = options

let segmentsJSON = fetchSha256Segments({ serverUrl, segmentsSha256Url, authorizationHeader, requiresAuth })
const regex = /bytes=(\d+)-(\d+)/

return async function segmentValidator (segment: Segment, _method: string, _peerId: string, retry = 1) {
// Wait for hash generation from the server
if (isLive) await wait(1000)

const filename = basename(removeQueryParams(segment.url))

const segmentValue = (await segmentsJSON)[filename]
@@ -36,7 +32,7 @@ function segmentValidatorFactory (options: {
if (!segmentValue) {
logger.info(`Refetching sha segments for ${filename}`)

await wait(1000)
await wait(500)

segmentsJSON = fetchSha256Segments({ serverUrl, segmentsSha256Url, authorizationHeader, requiresAuth })
await segmentValidator(segment, _method, _peerId, retry + 1)


+ 2
- 0
scripts/create-move-video-storage-job.ts Просмотреть файл

@@ -72,6 +72,8 @@ async function run () {
for (const id of ids) {
const videoFull = await VideoModel.loadFull(id)

if (videoFull.isLive) continue

const files = videoFull.VideoFiles || []
const hls = videoFull.getHLSPlaylist()



Загрузка…
Отмена
Сохранить