Add unescape utility function and

artplayerPluginMultipleSubtitles plugin
This commit is contained in:
Harvey Zack committed 2023-11-23 23:23:51 +08:00
1 parent 3db53c425e
commit 89b8525f2f
47 files changed
+2982 -75

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
plugins: [
artplayerPluginMultipleSubtitles({
subtitles: [
{
name: 'chinese',
url: '/assets/sample/subtitle.cn.srt',
},
{
name: 'japanese',
url: '/assets/sample/subtitle.jp.srt',
}
]
})
]
});
// 自定义你自己的样式,请勿复制以下代码
// Customize your own style, please do not copy the following code
const style = `
.art-subtitle-chinese {
color: red;
font-size: 18px;
}
.art-subtitle-japanese {
color: yellow;
font-size: 12px;
}
`;
const $style = document.getElementById('artplayer-subtitle-style');
if ($style) {
$style.textContent = style;
} else {
const $style = document.createElement('style');
$style.id = 'artplayer-subtitle-style';
$style.textContent = style;
document.head.appendChild($style);
}