Skip to content

Commit

Permalink
added check for cover is base64
Browse files Browse the repository at this point in the history
  • Loading branch information
gitbrent committed Mar 18, 2023
1 parent 20a1b90 commit 62932e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gen-objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,8 @@ export function addMediaDefinition (target: PresSlide, opt: MediaProps): void {
throw new Error('addMedia() error: either `data` or `path` are required!')
} else if (strData && !strData.toLowerCase().includes('base64,')) {
throw new Error('addMedia() error: `data` value lacks a base64 header! Ex: \'video/mpeg;base64,NMP[...]\')')
} else if (strCover && !strCover.toLowerCase().includes('base64,')) {
throw new Error('addMedia() error: `cover` value lacks a base64 header! Ex: \'data:image/png;base64,iV[...]\')')
}
// Online Video: requires `link`
if (strType === 'online' && !strLink) {
Expand Down

0 comments on commit 62932e9

Please sign in to comment.