mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-03 12:12:39 +00:00
fe129dd207
* docs: improve error message clarity for shortcode parent block validation * feat: add APlayer shortcode and audio support * feat: support both APlayer and MetingJS * feat: initialize APlayer when content decrypted
20 lines
593 B
JavaScript
20 lines
593 B
JavaScript
window.FixItAPlayer = {
|
|
init: () => {
|
|
Array.from(document.getElementsByClassName("aplayer-shortcode")).forEach((aplayer) => {
|
|
if (aplayer.dataset.processed) return
|
|
const audio = JSON.parse(aplayer.dataset.audio)
|
|
const options = JSON.parse(aplayer.dataset.options)
|
|
options.audio = audio
|
|
options.container = aplayer
|
|
new APlayer(options)
|
|
aplayer.dataset.processed = true
|
|
})
|
|
},
|
|
}
|
|
|
|
if (document.readyState !== 'loading') {
|
|
window.FixItAPlayer.init()
|
|
} else {
|
|
document.addEventListener('DOMContentLoaded', window.FixItAPlayer.init, false)
|
|
}
|