ํ๋ ์ด์ด API
์ด ํ์ด์ง์ ๋ด์ฉ
ํ๋ ์ด์ด๋ฅผ ์ ์ดํ๊ณ ์ด๋ฒคํธ๋ฅผ ์์ ํ๋ ๋ฐฉ๋ฒ์ ๋ ๊ฐ์ง์
๋๋ค. <pellio-player> ์น ์ปดํฌ๋ํธ๋ฅผ ์ฌ์ฉํ๊ฑฐ๋, iframe ์๋ฒ ๋์์ postMessage๋ฅผ ์ฌ์ฉํฉ๋๋ค.
์น ์ปดํฌ๋ํธ
๋์์์ Embed & share ํญ์์ Web component๋ฅผ ์ ํํ๊ฑฐ๋ ์ง์ ์์ฑํ์ธ์.
<script src="https://play.pellio.io/assets/embed.js" async></script>
<pellio-player video="VIDEO_ID" muted start="30" color="#e8492f"></pellio-player>
- ์์ฑ:
video(์ฌ์๋ชฉ๋ก์playlist),start,color,title, ๊ณ ์ ํฌ๊ธฐ๋ฅผ ์ํwidth์height๋๋aspect-ratio(๊ธฐ๋ณธ๊ฐ16/9),controls="false", ๊ทธ๋ฆฌ๊ณ ํ๋๊ทธautoplay,muted,loop,captions,background,resume,dnt๊ฐ ์์ต๋๋ค. ํ๋ ์ด์ด๋ ์คํฌ๋กคํด์ ํ๋ฉด์ ๋ณด์ผ ๋ ๋ก๋๋๋ฉฐ, ๋ฐ๋ก ๋ก๋ํ๋ ค๋ฉดeager๋ฅผ ์ถ๊ฐํ์ธ์. - ํ์ค๋ฒ:
popover๋ฅผ ์ถ๊ฐํ๋ฉด ์ฌ์ ๋ฒํผ์ด ์๋ ์ธ๋ค์ผ์ด ํ์๋๊ณ , ํ๊ทธ ์์ ์ง์ ํ ์คํธ๋ ๋ฒํผ์ ๋ฃ์ ์๋ ์์ต๋๋ค. ํด๋ฆญํ๋ฉด ํ๋ ์ด์ด๊ฐ ๋ผ์ดํธ๋ฐ์ค๋ก ์ด๋ฆฝ๋๋ค. - ๋ฉ์๋:
play(),pause(),seek(seconds),mute(true|false),volume(0โ1),rate(n),identify(email) - ํ๋กํผํฐ(์ฝ๊ธฐ ์ ์ฉ):
currentTime,duration,paused - ์ด๋ฒคํธ: ์๋์ ๋ชจ๋ ํ๋ ์ด์ด ์ด๋ฒคํธ๊ฐ ์์์์
pellio:<event>๋ก ๋ฐ์ํ๋ฉฐ, ๋ฉ์์ง๋event.detail์ ๋ด๊น๋๋ค. ํ์ค๋ฒ๋pellio:open๊ณผpellio:close๋ ๋ฐ์์ํต๋๋ค.
const player = document.querySelector('pellio-player');
player.addEventListener('pellio:progress', (e) => console.log(e.detail.percent));
player.seek(42);
์น ์ปดํฌ๋ํธ๋ ๋์์ ์ด๋ฒคํธ๋ฅผ Google Analytics์ Tag Manager๋ก๋ ๋ณด๋ ๋๋ค(๋ถ์ ์ฐธ๊ณ ).
postMessage ๋ช ๋ น
const player = document.querySelector('iframe').contentWindow;
player.postMessage({ pellio: true, method: 'play' }, '*');
player.postMessage({ pellio: true, method: 'seek', value: 42 }, '*');
| method | value |
|---|---|
play, pause |
์์ |
seek |
์ด(๊ฑด๋๋ฐ๊ธฐ ๊ธ์ง๊ฐ ์ผ์ ธ ์์ผ๋ฉด ์ด๋ฏธ ์์ฒญํ ๋ฒ์ ์์์๋ง) |
mute |
true ๋๋ false |
volume |
0~1 |
rate |
์ฌ์ ์๋(์: 1.5, ํ๋ฆฌ์ ์ ์๋ ์ ํ๊น์ง) |
identify |
์์ฒญ์์ ์ด๋ฉ์ผ(๋ถ์์์ ์ด๋ฆ์ผ๋ก ํ์ํ๊ณ ์์์ ๊ฑด๋๋ฐ๊ธฐ ์ํจ) |
์ด๋ฒคํธ
ํ๋ ์ด์ด๋ ์์ ํ์ด์ง๋ก { pellio: true, id, title, event, currentTime, duration }๋ฅผ ๋ณด๋ด๋ฉฐ, ์ผ๋ถ ์ด๋ฒคํธ์๋ ์ถ๊ฐ ํ๋๊ฐ ํฌํจ๋ฉ๋๋ค.
| event | ๋ฐ์ ์์ |
|---|---|
ready, play, pause, seeked, timeupdate, ratechange, volumechange |
video ์์๊ฐ ํด๋น ์ด๋ฒคํธ๋ฅผ ๋ฐ์์ํฌ ๋ |
ended, complete |
๋์์์ด ๋์ ๋๋ฌํ์ ๋(๋์ด ํจ๊ป ๋ฐ์) |
progress |
์ฌ์ ์์น๊ฐ 25, 50, 75, 90%๋ฅผ ์ง๋ฌ์ ๋(percent). ๊ณ ์ ์์ฒญ ์ด๊ฐ ์๋๋ผ ์์น ๊ธฐ์ค์
๋๋ค. |
interaction |
์ธํฐ๋์
์ด ํ์, ํด๋ฆญ, ๊ฑด๋๋ฐ๊ธฐ ๋์์ ๋(interaction, type, kind: view, click, skip) |
lead |
์์์ด ์ ์ถ๋์์ ๋(interaction, email) |
chapter |
์ฑํฐ๋ฅผ ์ ํํ์ ๋(chapter, t) |
download |
์์ฒญ์๊ฐ ๋์์์ ๋ค์ด๋ก๋ํ์ ๋ |
logo |
์์ฒญ์๊ฐ ํ๋ฆฌ์
์ ๋ก๊ณ ๋ฅผ ํด๋ฆญํ์ ๋(href) |
transcript |
์คํฌ๋ฆฝํธ ํจ๋์ด ์ด๋ฆฌ๊ฑฐ๋ ๋ซํ์ ๋(open) |
attention |
โStill watching?โ ํ์ธ์ด ํ์๋๊ฑฐ๋ ์๋ต๋์์ ๋(prompt) |
cast |
TV๋ก ์บ์คํ
์ด ์์๋๊ฑฐ๋ ์ค์ง๋์์ ๋(state) |
window.addEventListener('message', (e) => {
if (e.data?.pellio && e.data.event === 'progress') console.log(e.data.id, e.data.percent);
});
์ฌ์๋ชฉ๋ก ์๋ฒ ๋(/p/โฆ)๋ ๊ฐ์ ์ด๋ฒคํธ์ playlist ํ๋๋ฅผ ๋ํด ๋ณด๋ด๋ฉฐ, ๋์์์ด ์ ํ๋๋ฉด select๋ ๋ณด๋
๋๋ค. ์ฌ์๋ชฉ๋ก ์๋ฒ ๋๋ ๋ช
๋ น์ ๋ฐ์ง ์์ต๋๋ค.
์ด ๊ธ์ด ๋์์ด ๋์๋์?
๊ด๋ จ ๊ธ
- API keys and the REST APIAuthenticate, upload and manage videos from your own code.
- ์นํ ๋์์์ด ์์ฑ, ์ค๋น, ์คํจ, ์ญ์ ๋์์ ๋์ ๋ฆฌ๋๊ฐ ๋ค์ด์์ ๋ ์๋ฆผ์ ๋ฐ์ต๋๋ค.
- AI ์ด์์คํดํธ(MCP)Pellio์ MCP ์๋ฒ๋ก Claude, ChatGPT, Cursor, Claude Code๋ฅผ Pellio์ ์ฐ๊ฒฐํฉ๋๋ค.
- WordPress pluginA fast, private video player for any WordPress site, and Pellio hosting when you connect an account.