fix: youtube iframe (#517)

This commit is contained in:
abc1763613206 2024-09-03 18:04:57 +08:00 committed by GitHub
parent 7321d7cd8d
commit 0ca983f992
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -21,8 +21,13 @@ module.exports = ctx => function (args) {
`
}
if (args.youtube) {
if(args.autoplay == 'true' || args.autoplay == '1') {
args.autoplay = '1&mute=1'
} else {
args.autoplay = '0'
}
return `<div class="tag-plugin video" style="aspect-ratio:${args.ratio || 16 / 9};max-width:${args.width};">
<iframe src="https://www.youtube.com/embed/${args.youtube}?rel=0&color=white&disablekb=1&playsinline=1&&rel=0&autoplay=${args.autoplay || '0'}" picture-in-picture="true" allowfullscreen="true" >
<iframe style="border:none" src="https://www.youtube.com/embed/${args.youtube}?rel=0&disablekb=1&playsinline=1&autoplay=${args.autoplay}" picture-in-picture="true" allowfullscreen="true" >
</iframe>
</div>
`