mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
feat: add JASSUB type definitions and update common.js references feat: add JASSUB plugin for advanced subtitle rendering in HTML5 video - Implemented a new JASSUB class for handling subtitle rendering with options for video and canvas targets. - Added support for both synchronous and asynchronous rendering modes. - Integrated Web Worker for offloading rendering tasks, improving performance. - Included methods for managing subtitle tracks, styles, and events. - Added color space verification and handling to ensure accurate subtitle display. - Implemented local font access for enhanced typography options in subtitles. - Introduced a benchmarking feature to assess rendering performance. refactor: update README and type definitions for artplayer-plugin-jassub - Removed installation and usage instructions from README.md for clarity. - Updated index.js to remove direct assignment of jassub instance to art. - Enhanced type definitions in artplayer-plugin-jassub.d.ts to include detailed JassubOption and JassubInstance interfaces.
28 lines
1006 B
JavaScript
28 lines
1006 B
JavaScript
// https://github.com/ThaUnknown/jassub
|
|
// npm i artplayer-plugin-jassub
|
|
// import artplayerPluginJassub from 'artplayer-plugin-jassub';
|
|
|
|
var art = new Artplayer({
|
|
container: '.artplayer-app',
|
|
url: '/assets/jassub/FateGrandOrderBabylonia-OP1v2-NCBD1080.webm',
|
|
autoSize: true,
|
|
fullscreen: true,
|
|
fullscreenWeb: true,
|
|
plugins: [
|
|
artplayerPluginJassub({
|
|
subUrl: '/assets/jassub/FGOBD.ass',
|
|
workerUrl: '/assets/jassub/jassub-worker.js',
|
|
wasmUrl: '/assets/jassub/jassub-worker.wasm',
|
|
modernWasmUrl: '/assets/jassub/jassub-worker-modern.wasm',
|
|
availableFonts: {
|
|
'liberation sans': '/assets/jassub/default.woff2'
|
|
},
|
|
fonts: [
|
|
'/assets/jassub/fonts/Averia Sans Libre Light.ttf',
|
|
'/assets/jassub/fonts/Averia Serif Simple Light.ttf',
|
|
'/assets/jassub/fonts/Gramond.ttf'
|
|
],
|
|
timeOffset: -0.041
|
|
}),
|
|
],
|
|
}); |