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

24 lines
456 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'video/{mtype}'
return {
"widgettype":"Video",
"id":"player",
"options":{
"url":entire_url('/idfile') + "?path=" + r.mlocation,
"height":"99%",
"width":"99%",
"type":typ,
"autounmute":True,
"autoplay":True
}
}