Compare commits

...

2 Commits

Author SHA1 Message Date
097459884c Merge branch 'main' of git.opencomputing.cn:yumoqing/bricks 2025-11-10 15:13:48 +08:00
a34a9bf77e bugfix 2025-11-10 15:13:24 +08:00

View File

@ -16,22 +16,25 @@ bricks.UserInputView = class extends bricks.VBox {
this.input_fields.forEach(f =>{ this.input_fields.forEach(f =>{
if (data[f.name]){ if (data[f.name]){
if (f.name.startsWith('video')){ if (f.name.startsWith('video')){
var url = URL.createObjectURL(data[f.name]);
this.v_w = new bricks.VideoPlayer({ this.v_w = new bricks.VideoPlayer({
url:data[f.name], url:url,
autoplay:true, autoplay:true,
width: '100%' width: '100%'
}); });
} else if (f.name.startsWith('audio')){ } else if (f.name.startsWith('audio')){
var url = URL.createObjectURL(data[f.name]);
console.log('audio:', f.name, data[f.name]); console.log('audio:', f.name, data[f.name]);
this.a_w = new bricks.AudioPlayer({ this.a_w = new bricks.AudioPlayer({
url:data[f.name], url:url,
autoplay:true, autoplay:true,
width: '100%' width: '100%'
}); });
} else if (f.name.startsWith('image')){ } else if (f.name.startsWith('image')){
var url = URL.createObjectURL(data[f.name]);
mdtext += ` mdtext += `
* ${f.label || f.name} * ${f.label || f.name}
![${f.label || f.name}](${data[f.name]}) ![${f.label || f.name}](${url})
`; `;
} else { } else {
mdtext += ` mdtext += `