Skip to content

Commit

Permalink
Experimental hls processing (#263)
Browse files Browse the repository at this point in the history
* Add support for HLS segmenting when a flag is set'

* exposing it further;

* Don't show broken content when there's no content;
stef-coenen authored Sep 10, 2024
1 parent 4862625 commit 8abf177
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions packages/js-lib/src/media/Video/VideoProcessor.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,8 @@ const megaByte = 1024 * 1024;
export const processVideoFile = async (
videoFile: { file: File | Blob; thumbnail?: ThumbnailFile },
payloadKey: string,
encryptionKey?: KeyHeader
encryptionKey?: KeyHeader,
experimentalHls?: boolean
): Promise<{
tinyThumb: EmbeddedThumb | undefined;
payloads: PayloadFile[];
@@ -47,7 +48,8 @@ export const processVideoFile = async (
// Processing video
const { metadata, ...videoData } = await segmentVideoFileWithFfmpeg(
videoFile.file,
encryptionKey
encryptionKey,
experimentalHls
);

if ('segments' in videoData) {
Original file line number Diff line number Diff line change
@@ -353,7 +353,9 @@ const FileState = ({
const parsedContent = await decryptJsonContent(file.fileMetadata, keyheader);

setIsBroken(
file.fileMetadata.isEncrypted && typeof parsedContent === 'object'
file.fileMetadata?.appData.content?.length &&
file.fileMetadata.isEncrypted &&
typeof parsedContent === 'object'
? Object.keys(parsedContent).length === 0
: false
);

0 comments on commit 8abf177

Please sign in to comment.