[feat] audio: netease

This commit is contained in:
xaoxuu 2024-01-14 11:36:47 +08:00
parent a8c21b28a4
commit 3c01b510b8
1 changed files with 9 additions and 4 deletions

View File

@ -9,14 +9,19 @@
'use strict'; 'use strict';
module.exports = ctx => function(args) { module.exports = ctx => function(args) {
args = ctx.args.map(args, ['type'], ['src']) args = ctx.args.map(args, ['type', 'netease', 'autoplay'], ['src'])
if (args.type == null) { if (args.netease) {
args.type = 'audio/mp3' return `
<div class="tag-plugin audio">
<iframe src="//music.163.com/outchain/player?type=${args.type || '2'}&id=${args.netease}&auto=${args.autoplay == 'true' ? '1' : '0'}&height=32" frameborder="no" border="0" marginwidth="0" marginheight="0" width=288px height=52>
</iframe>
</div>
`
} }
return ` return `
<div class="tag-plugin audio"> <div class="tag-plugin audio">
<audio controls preload> <audio controls preload>
<source src="${args.src}" type="${args.type}">Your browser does not support the audio tag. <source src="${args.src}" type="${args.type || 'audio/mp3'}">Your browser does not support the audio tag.
</audio> </audio>
</div> </div>
` `