[feat] audio: netease
This commit is contained in:
parent
a8c21b28a4
commit
3c01b510b8
|
@ -9,14 +9,19 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = ctx => function(args) {
|
||||
args = ctx.args.map(args, ['type'], ['src'])
|
||||
if (args.type == null) {
|
||||
args.type = 'audio/mp3'
|
||||
args = ctx.args.map(args, ['type', 'netease', 'autoplay'], ['src'])
|
||||
if (args.netease) {
|
||||
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 `
|
||||
<div class="tag-plugin audio">
|
||||
<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>
|
||||
</div>
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue