diff --git a/pods/external/services.d/stream.service b/pods/external/services.d/stream.service index 7292e2dbb7..f4bc340e26 100644 --- a/pods/external/services.d/stream.service +++ b/pods/external/services.d/stream.service @@ -1 +1 @@ -stream hardcoreeng/service_stream:0.4.0 +stream hardcoreeng/service_stream:0.4.5 diff --git a/pods/media/src/handler.ts b/pods/media/src/handler.ts index c4ba0b92e6..6835f34877 100644 --- a/pods/media/src/handler.ts +++ b/pods/media/src/handler.ts @@ -17,6 +17,15 @@ import core, { type Blob, type Doc, type MeasureContext, type TxCUD, type TxCrea import { PlatformQueueProducer } from '@hcengineering/server-core' import { VideoTranscodeRequest, VideoTranscodeResult } from './types' +const transcodeIgnoredContentTypes = [ + 'video/x-mpegurl', // HLS playlist + 'video/mp2t' // MPEG-2 Transport Stream +] + +function shouldTranscode (contentType: string): boolean { + return contentType.startsWith('video/') && !transcodeIgnoredContentTypes.includes(contentType) +} + export async function handleTx ( ctx: MeasureContext, workspaceUuid: string, @@ -27,15 +36,15 @@ export async function handleTx ( if (tx._class !== core.class.TxCreateDoc) return const createTx = tx as TxCreateDoc - if (createTx.attributes.contentType.startsWith('video/')) { + if (shouldTranscode(createTx.attributes.contentType)) { const msg: VideoTranscodeRequest = { workspaceUuid, blobId: createTx.objectId, contentType: createTx.attributes.contentType } - ctx.info('Transcode request', { msg }) - await producer.send(createTx.objectId, [msg]) + ctx.info('Transcode request', { workspaceUuid, msg }) + await producer.send(workspaceUuid, [msg]) } } diff --git a/pods/media/src/types.ts b/pods/media/src/types.ts index 0891d25871..09c9ee4965 100644 --- a/pods/media/src/types.ts +++ b/pods/media/src/types.ts @@ -24,5 +24,5 @@ export interface VideoTranscodeResult { workspaceUuid: string thumbnail?: string - hls?: string + playlist?: string }