media/wwwroot/audio/audioplay.dspy
2025-06-24 11:45:33 +08:00

22 lines
423 B
Plaintext

ns = {
'id':params_kw.id
}
db = DBPools()
async with db.sqlorContext('mediadb') as sor:
recs = await sor.R('media', ns)
if len(recs) >= 1:
r = recs[0]
mtype = r.mlocation.rsplit('.',1)[-1]
typ = f'audio/{mtype}'
return {
"widgettype":"AudioPlayer",
"id":"player",
"options":{
"height":"99%",
"width":"30%",
"url":entire_url('/idfile') + "?path=" + r.mlocation,
"autoplay":True
}
}