diff --git a/src/ts/parser.ts b/src/ts/parser.ts
index 6e2d8f0f..feef69f4 100644
--- a/src/ts/parser.ts
+++ b/src/ts/parser.ts
@@ -85,19 +85,30 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
if(char.additionalAssets){
- let assetPaths:{[key:string]:string} = {}
- let emoPaths:{[key:string]:string} = {}
+ let assetPaths:{[key:string]:{
+ path:string
+ ext?:string
+ }} = {}
+ let emoPaths:{[key:string]:{
+ path:string
+ }} = {}
for(const asset of char.additionalAssets){
const assetPath = await getFileSrc(asset[1])
- assetPaths[asset[0].toLocaleLowerCase()] = assetPath
+ assetPaths[asset[0].toLocaleLowerCase()] = {
+ path: assetPath,
+ ext: asset[2]
+ }
}
if(char.emotionImages){
for(const emo of char.emotionImages){
const emoPath = await getFileSrc(emo[1])
- emoPaths[emo[0].toLocaleLowerCase()] = emoPath
+ emoPaths[emo[0].toLocaleLowerCase()] = {
+ path: emoPath,
+ }
}
}
+ const videoExtention = ['mp4', 'webm', 'avi', 'm4p', 'm4v']
data = data.replaceAll(assetRegex, (full:string, type:string, name:string) => {
name = name.toLocaleLowerCase()
if(type === 'emotion'){
@@ -114,18 +125,26 @@ async function parseAdditionalAssets(data:string, char:simpleCharacterArgument|c
}
switch(type){
case 'raw':
- return path
+ return path.path
case 'img':
- return ``
+ return `
`
case 'video':
- return ``
+ return ``
+ case 'video-img':
+ return ``
case 'audio':
- return ``
+ return ``
case 'bg':
if(mode === 'back'){
- return `