INNER CODE UNIT · JavaScript

artplayerPluginVttThumbnail

jamebal/jmal-cloud-view · src/components/preview/artplayer-plugin-vtt-thumbnail/index.js:3

export default function artplayerPluginVttThumbnail(option) {
    return async (art) => {
        const {
            constructor: {
                utils: { setStyle, isMobile },
            },
            template: { $progress },
        } = art;

        let timer = null;
        const thumbnails = await getVttArray(option.vtt);
        function showThumbnails($control, find, width) {
            setStyle($control, 'backgroundImage', `url(${find.url})`);
            setStyle($control, 'height', `${find.h}px`);
            setStyle($control, 'width', `${find.w}px`);
            setStyle($control, 'backgroundPosition', `-${find.x}px -${find.y}px`);
            if (width <= find.w / 2) {
                setStyle($control, 'left', 0);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…