팁/튜토리얼

기존 모듈에서 지원하지 않던 gif -> mp4 전환 기능을 스티커 모듈에 추가하였습니다.

https://rhymix.org/pds/1953667

- 요구사항 : 라이믹스 코어 비동기 작업 활성화, ffmpeg 실행 가능 필요

 

수정할 범위는 사용하시는 게시판 스킨의 스티커를 추가하는 폼입니다.

 

스크린샷 2026-08-16 오후 2.30.57.png

 

크게 스티커 대분류, 스티커 목록으로 나뉘어있으며, 수정하실 항목도 2개입니다.

 

일반적으로 board/skins/[사용하시는스킨]/js 폴더 아래에 sticker.js 같은 파일명이 있다면, 그 파일을 열어보시면 됩니다.

 

해당 코드 내에서 html += '<img src="'+sticker[i].main_image+'" width="30" height="30">';

과 같은 코드가 보이신다면, 아래와 같이 수정해주시면 됩니다.

 

if (sticker[i].main_image.match(/\.mp4$/)) {

    var poster = sticker[i].main_image.replace(/\.mp4$/, '.webp');

    html += '<video width="30" height="30" poster="'+poster+'" preload="metadata" loading="lazy" autoplay loop muted playsinline>';

    html += '<source src="'+sticker[i].main_image+'" type="video/mp4">';

    html += '</video>';

} else {

    html += '<img src="'+sticker[i].main_image+'" width="30" height="30">';

}

 

두 군데가 비슷한 코드 유형을 하고 있을 것이라 찾는데 어려움은 없으실겁니다.

 

예시로 변환 코드를 링크에 달아두겠습니다.

https://github.com/moonhouse-80san/SketchBook5_MH/pull/1/changes

리버스 Lv. 8
모듈만드는 대학생입니다.
https://potatosoft.kr

댓글 0