feat: vod display (#686)
* feat: preview for html5 supported videos * fix: handle out of limit tags * feat: support preview on the donwload screen * refactor: rework meta and preview handling to be more general * fix: missing meta * fix: do not allow maybe or probably types * fix: make the media check more strict --------- Co-authored-by: Levente Kiss <levente.kiss@solarpunk.bzz>
This commit is contained in:
+7
-2
@@ -1,3 +1,6 @@
|
||||
import { isSupportedImageType } from './image'
|
||||
import { isSupportedVideoType } from './video'
|
||||
|
||||
const indexHtmls = ['index.html', 'index.htm']
|
||||
|
||||
interface DetectedIndex {
|
||||
@@ -83,12 +86,14 @@ export function getAssetNameFromFiles(files: FilePath[]): string {
|
||||
|
||||
export function getMetadata(files: FilePath[]): Metadata {
|
||||
const size = files.reduce((total, item) => total + item.size, 0)
|
||||
const isWebsite = Boolean(detectIndexHtml(files))
|
||||
const name = getAssetNameFromFiles(files)
|
||||
const type = files.length === 1 ? files[0].type : 'folder'
|
||||
const count = files.length
|
||||
const isWebsite = Boolean(detectIndexHtml(files))
|
||||
const isVideo = isSupportedVideoType(type)
|
||||
const isImage = isSupportedImageType(type)
|
||||
|
||||
return { size, name, type, isWebsite, count }
|
||||
return { size, name, type, isWebsite, count, isVideo, isImage }
|
||||
}
|
||||
|
||||
export function getPath(file: FilePath): string {
|
||||
|
||||
Reference in New Issue
Block a user