Repository navigation
Releases
LivLiv Player 0.6.1
A fix. A page written for 0.6.0 needs no change.
Fixed: a character loaded while its canvas had no size (display: none, a collapsed panel, a stage laid out after its first frame) lost its irises once shown, until it was loaded again, and logged GL_INVALID_FRAMEBUFFER_OPERATION every frame (#21). From 0.3.0 a frame drawn at no size with the eyes glancing aside did it; from 0.6.0 any first frame drawn at no size did.
npm install @livliv-dev/[email protected]LivLiv Player 0.6.0
Long hair that swings and rests on the shoulders, feel settings an editor can change while the character plays, an
advanced entry for code that runs the renderer itself, and VRM files from Blender that play. A page written for 0.5
needs no change. What it will see change, all on purpose (below): long hair swings, and long hair lying on the body
moves less with the head; a model whose file sets tuning.blink, expr or mouth plays them; the idle motion
turned back on eases in instead of jumping; and blinks no longer show a see-through iris halfway.
New
- Feel settings, live.
player.tuningis the character's feel settings as it plays (its model'stuning; a frozen
copy), andplayer.setTuning(changes)changes some of them without loading the character again:undefinedputs
one back to the model's own, each load starts from the new character's own. OnPlayerandBodyPlayer. Changing
turn,nod,fringeorhairReston a model with keyforms measures its key poses again, so it draws exactly as
it would loaded with those settings. See API.md. blink,exprandmouthfrom the model'stuningcount, as on livliv.ai: how often the idle motion blinks,
how readily face tracking reads a smile, how far face tracking and live lip sync open the mouth (lip sync's own
gainmultiplies with it). AHostmay carrytuning(optional): drivers read it there. A model whose file sets
them to other than 1 plays differently from 0.5 ({ "blink": 2, "mouth": 0.5 }blinks twice as often and opens its
mouth half as far); the featured characters set them to 1 or not at all.load(source, { continueMotion: true }): the same character loaded again (an editor's change) goes on moving
from its last frame (its springs, the body's lag, the long hair's swing, the expression showing) instead of starting
again at rest.@livliv-dev/player/runtime, an advanced entry: the renderer (Puppet) and the motion modules, for code that
runs its own frame loop, withmeshes(),rgbaAt()andlayersAt()to ask what is drawn where. Outside the
compatibility promise of the other entries: pin the exact version. See API.md.packageModelJson(paths): whichmodel.jsonamong a package's files is its own, asload()picks it.- Format 4.2 (FORMAT.md):
tuning.gaze,tuning.fringe,
tuning.hair_swayandtuning.hair_restin the schema, all optional. The player readgazeandfringebefore, but
the schema refused a file that had them. TheTuningtype is exported.
Changed
- Blinks without a see-through iris. Halfway through a blink the open eye used to fade out from eye-open 0.2 down
while the closed eye faded in under it: for a few frames of every blink the iris showed as a grey, see-through smear
(most on pale irises, and for as long as a face-tracked eye stays half shut). The open eye now stays whole until it is
squashed to a thin slit and goes in a short step (eye-open 0.06 to 0.03), and the idle motion holds each blink shut
for 35 ms: the close takes 75 ms and a frame often missed its bottom (a third of the blinks at 60 fps, two in three in
a 30 fps recording never showed the closed eye); now every one does. Every character blinks this way at default
settings. A frame with the eyes open 0.2 or more, or shut, draws exactly as in 0.5; between 0.08 and 0.05 the open
eye shows as a thin slit where it used to be a fading smear. Each of the idle motion's blinks ends 35 ms later, so
its later blinks and small glances fall a little differently. A new switch,player.blinkHandover = false, blinks as
before (API.md).BodyPlayer(VRM, PNGTuber) is unchanged. In the runtime entry:
Puppet.blinkHandover,blinkHoldonLivelyIdleandIdleDriver(0 unless set),BLINK_HOLD,eyeFade,
blinkOpen,blinkOver. - Long hair swings below the shoulders (#15). Below the jaw, long
hair used to follow the torso, so its tips moved less than the hair at the shoulders. A gentle pendulum, thrown by the
head's and the torso's moves and settling by itself, now swings it sideways, more toward the tips (twin tails and
ponytails included); hair over the body swings less. Characters you already have move this way too: at their
default settings their hair tips sway when the head turns or the body leans. The rest pose is unchanged, and a
character whosetuning.hairBack(format 4:hair_back) or newhairSway(hair_sway) is 0 draws every frame as
in 0.5. - Long hair lying on the body goes with the body. From the neck down, long hair over the shoulders and chest used to go
almost wholly with the head, so a large move of the head and the torso together slid it over the clothes and showed
what it covered between the strands (light clothes in fragments through dark hair, a hard edge along a collar). Where
hair lies over the body it now takes less of the head's motion and more of the body's; hair beside the body, the bangs
and the long hair's swing are as before. Characters you already have move this way too: their chest hair moves less
when the head turns. The rest pose is unchanged, and a character whose newtuning.hairRest(format 4:
hair_rest) is 0 draws every frame as before. - VRM files from Blender (#1): a VRM 1.0 whose licence URL is not
VRM's own (the author's terms page) plays, with that URL in its terms; node constraints that depend on each other in a
circle are left out with a warning instead of refusing the file; a file that cannot play says why in the exporter's
terms (bones the humanoid lacks, no meta, a VRM version this player does not read). A.vrmURL given to aPlayer
says to use aBodyPlayer. modelFiles()takes names with#and?, which it refused before, asload()takes them. Its paths stay safe
to write out: it refuses a name that would leave the package (as opening a.livlivdoes), and one with a control
character or:, now from a package too. Its errors name the file.- A model's first frame draws everything once, out of sight (Player only): every layer's pictures, the eyes'
masks, the stencil. Some browsers put off a texture's upload until it is first drawn, so the first blink, glance or
expression after a load could stall a frame. The renderer underneath has it as a switch (Puppet.prewarm), off. - The idle motion going on again doesn't jump. After frames drawn with
idleoff, it used to go on from where it
had stopped, in one frame; now it eases in from the pose those frames showed, over 0.4 s. A player whose idle motion
is never turned off plays exactly as before. - The model schema compiles without warnings in ajv's default settings (it logged two); it accepts and refuses the same
files. - The repository's featured characters are livliv.ai's current builds: 13 refreshed, Mochi and Kotaro gone (23). A page
that loads Mochi or Kotaro from GitHub Pages keeps working: their folders and packages stay there, unlisted.
LivLiv Player 0.5.1
Two optional settings for how strongly a character moves. A page that doesn't use them draws exactly as with 0.5.0.
New
act(action, strength): a short move at a share of its full size, from 0 to 1 (default 1). It takes as long as
before. See API.md.bodyMotion(0 to 1, default 1): scales the live torso turn and lean, beforeparameterProfile. Recorded poses
already include it, so replaying them doesn't scale them again.- The repository's featured characters now include four full-body ones: Tsubaki, Neve, Juno and Viola.
Changed
- The package builds itself when it is installed straight from GitHub (
prepareinstead ofprepack), so
npm install github:livliv-dev/player#<commit>gives a working copy.
npm install @livliv-dev/[email protected]LivLiv Player 0.5.0
Full-body characters, standing on the ground, with a choice of shot. Half-body characters draw exactly as in 0.4, and a
page written for 0.4 needs no change.
New
- Full-body characters, livliv.ai's newer kind: drawn head to feet, the feet on the ground. The upper body moves as a
half-body character's; the whole figure sways from the ankles, the hips shift their weight, a skirt's or coat's hem
trails behind; leaning toward the camera or a hop crouches it, a hop lands, and lip sync dips the upper body. See
API.md. - Choose the shot with
view.fit:'frame'(head and chest, the default),'knee'or'whole'. - For drivers and recordings:
ModelInfo.fullBody,frame.talk(the talking bob, apart fromframe.move),
frame.groundedand theFittype. A full-body character'sPlaybackPosekeepscrouch,dipandtalk, and
renderPose()draws them again. - Format 4.1 (FORMAT.md):
anchors.frame,anchors.body,anchors.hair_bottom_y,rig.latticeand the featurefull_body, in the schema too. - A model's
tuning.fringe(how far the bangs stand off the face) is read.
Changed
- Lip sync puts its talking bob in
frame.talkinstead of adding it toframe.move.y; the picture moves as before. - What drivers write to
frame.moveandframe.talkis kept to numbers: a NaN counts as no move. - TypeScript code that builds a
Frameor aModelInfoof its own (a test's stand-in) adds the new fields.
npm install @livliv-dev/[email protected]LivLiv Player 0.4.0
Ways to record a character and show it in more than one place, and two changes to what a character does: the chest
spring is off, and full-body characters wait for a later version. A page written for 0.3 needs no change.
New
- Recorded poses:
getPose(),onFrameandrenderPose(pose, dt, size)onPlayerandBodyPlayer, to keep each
frame's pose and draw it again, in another window or at a video's exact size. See API.md. renderWhenHidden: keep drawing while the canvas is out of view, for a live output or a recording.- Response profiles, which reshape params one by one (range, curve, smoothing):
parameterProfileand
parameterSampleon both players,profileandsampleon face tracking, andTrackingFilter,
readTrackingProfile(),parameterRule()andTRACKING_PARAMETERSfrom@livliv-dev/player/tracking. See
API.md. getAnchor('head' | 'body'): where the head and the torso were drawn, to attach things that follow the character. A
Bodyof your own can give its own withanchor().- Face tracking:
deviceIdpicks the camera, andtracking.videois its preview. - Speech:
say()takes a fetchResponse, played as it streams in, and hooks (onStart, thenonEndoronFail);
volume,level,vowel, andstream, the voice as aMediaStreamfor a call or a recording. modelFiles(): a model's own files, to save or package a character with a project.new PngBody({ pixelated: true }), for pixel art.
Changed
- The chest spring is off, as on livliv.ai: the player ignores a saved
rig.body.bust, so packages exported before
keep still there too, and the featured characters now say 0. Breathing stays. At rest a character draws as in 0.3, to
the pixel; the difference shows only on characters that had it, around the chest, while they breathe and move. - Full-body characters, livliv.ai's newer kind (
anchors.bodyinmodel.json), are refused with
missing-feature: this version would show the whole tall canvas with the feet sliding. A later version plays them,
and aPlaybackPosealready has room for their moves (crouch,dip,talk, unused here).
Fixed
- The expressions'
labelandlabelskeep their types on both players (#8). - A streamed WAV plays at its own sample rate (#6).
- Face tracking tilts the head the same way as the face (#5).
Featured characters
They are not in the npm package.
- 17 of the 21 rebuilt, as livliv.ai now shows them, and their covers redrawn.
rig.body.bustis 0 in all of them.
npm install @livliv-dev/[email protected]LivLiv Player 0.3.0
The first version of LivLiv Player on npm. The interface settled first, so a page written for 0.2 needs a few changes. Format 4 is unchanged.
What to change from 0.2
| 0.2 | 0.3 |
|---|---|
import ... from '@livliv/player' and its subpaths |
'@livliv-dev/player', the package's name on npm. |
player.act('away') |
player.setAway(true) and setAway(false). act('away') now throws: it was a switch among one-off moves. |
player.puppet |
No longer in the types. player.poke() and player.canvasToModel() are what pages used it for. The field still exists and can change in any version. |
player.load(a); player.load(b) played a, then b |
The new load replaces the one running, which rejects with an AbortError. If you catch errors, let this one through: if (e.name === 'AbortError') return. |
dispose() on a load running rejected with an Error |
It rejects with an AbortError, as load() on a disposed player does. |
| Errors told apart by their message | e.code, on a LivLivError. The messages can change. |
Install
npm install @livliv-dev/playerThe npm package is the player alone, without characters/. The featured characters are in this repository's characters/: copy the ones you use next to your page, with their licence. Kujira, Kujira Q and Pen come from other people's work; their sources, credits and terms are in characters/CREDITS.md.
Face tracking also needs @mediapipe/tasks-vision (1.1.1), and VRM characters need three and @pixiv/three-vrm. All three are optional peer dependencies.
New
load(source, { signal, onProgress, poster }): call a load off, follow how far it has come, show a picture until the first frame.LivLivError, with acodefor each reason, from@livliv-dev/playerand@livliv-dev/player/body.player.contextLostandplayer.onContextLost: the page hears when the WebGL context is gone. See API.md.dispose({ release: true }): gives the WebGL context up, for a canvas leaving the page.player.setAway(),player.poke(),player.canvasToModel().example/react.html, which loads React from esm.sh.
Changed
- A model that breaks while it is built leaves the character before as it was. It used to leave an empty canvas.
- The pose stays in the ranges of
PARAM_RANGESonPlayertoo, as it did onBodyPlayer. A value that is not a number counts as the default. maxPixelRatiocan be read and changed on aPlayer.snapshot()on aPlayerdraws first, so it is the pose as it is now, on a paused player too.- A
BodyPlayer'sFrame.timecounts the frames before this one, as aPlayer's does. Its idle motion runs one frame later. PlayerandBodyPlayernow share their code. Nothing aPlayerdraws changed in our frame-by-frame comparison.
Requirements
WebGL2 and ES2023: Chrome / Edge 97+, Firefox 104+, Safari 15.4+. Tested on current desktop Chromium, Firefox and WebKit; not yet on real phones or in in-app WebViews.
Known
Issue #1 is still open, and a fresh export from Blender hasn't been tested.
License
Code: Apache License 2.0. Featured characters, which are not in the npm package: characters/LICENSE.md and characters/CREDITS.md.
All changes: CHANGELOG.md and v0.2.1...v0.3.0
中文:这是第一个发布到 npm 的版本。接口先定了下来,所以为 0.2 写的页面要改几处:act('away')、player.puppet、连续调用 load()、靠错误信息判断错误,改法见上面的表。安装:npm install @livliv-dev/player。npm 包里只有播放器,不含 characters/;精选角色在这个仓库里,把要用的角色连同许可一起复制到你的页面旁边。Kujira、Kujira Q 和 Pen 来自别人的作品,来源和条款见 characters/CREDITS.md。目前在桌面的 Chromium、Firefox、WebKit 上测过,手机还没有测。issue #1 还开着,从 Blender 新导出的文件也没有测过。
日本語:npm で公開する最初のバージョンです。先に API を確定したため、0.2 向けのページは数か所の変更が必要です。act('away')、player.puppet、続けて呼ぶ load()、メッセージによるエラー判定が対象で、変更方法は上の表にあります。インストールは npm install @livliv-dev/player です。npm パッケージに入っているのはプレイヤーだけで、characters/ は含まれません。厳選キャラクターはこのリポジトリにあるので、使うキャラクターをライセンスと一緒にページの横にコピーしてください。Kujira、Kujira Q、Pen は他の方の作品がもとになっており、出典と利用条件は characters/CREDITS.md にあります。テストはデスクトップの Chromium、Firefox、WebKit のみで、スマートフォンではまだ行っていません。issue #1 は未解決で、Blender から新たに書き出したファイルもテストしていません。
LivLiv Player 0.2.1
This release corrects the sources and terms of three featured characters, and makes the player lighter and quicker. Format 4 is unchanged.
Character sources and terms, corrected
The characters/LICENSE.md in 0.2.0 said all 21 featured characters were made by the LivLiv team, and each character's meta.license pointed to that license. That was wrong for Kujira, Kujira Q and Pen, which come from other people's work. From this version:
- Kujira and Kujira Q are under CC BY-NC-SA 4.0, not the LivLiv Featured Characters License. They are based on the community "whale girl" (鲸鱼娘): original character 溟月 by 上善无形, maid design by ZipZipPipe. Credit: "Kujira: 上善无形, ZipZipPipe (CC BY-NC-SA 4.0); model by LivLiv".
- Pen is covered by neither the Apache License nor the LivLiv Featured Characters License. It is based on the fan character known as 咕咕嘎嘎 (Gugu Gaga penguin), made by 贱兔死顺盖 from the Administrator in Arknights: Endfield (Hypergryph), and on a photo of a figure marked "GUGA", maker unknown. LivLiv holds no rights in this character and grants none. If you hold rights in it, CREDITS.md says how to reach us.
- The other 18 keep their terms.
The art and models of the three are unchanged; only the author and license in their meta are different. If you took them from 0.2.0, follow characters/CREDITS.md, which has the sources and credit lines, and not the license in the 0.2.0 tag.
Lighter and quicker
- The core is about 30 KB gzipped, down from about 34. PNGTuber and VRM no longer pull in the renderer.
- Keyforms and a layer's images are fetched together, and keyforms decode 5-7 times faster. On the refined Nana, a load blocks the page less than half as long, and a frame takes about 25 % less time.
- Face tracking has a new option,
maxFps,'auto'by default: it looks for the face less often when that would take over half of the main thread. - A refused camera stops the face model's download.
dispose()frees every GPU buffer of a layer at once, and during a load or a start it leaves nothing behind.
VRM
- Fixed: arms and the nod were backwards on 0.x, and the eyes looked the wrong way up and down on every VRM. The head now turns without a neck bone. Framing follows the model's own units and shape, so a model in other units no longer leaves an empty picture.
- A file's own expressions are listed. One-sided blinks work, and so do mouths with only
ihandoh. load()gives the file's author and terms inmodel.meta, in the same shape for 1.0 and 0.x. The player does not enforce them.- A file is looked through before three.js parses it, and a refusal says what to do. One that names an outside URL is refused. A file compressed with Draco, Meshopt or KTX2 says it needs decoders, and
configureLoaderis where yours go. - A
.vrmopened on the wrong example page says where it belongs, and the examples site brings its own three.js.
Tested on three.js 0.170, 0.186 and 0.187 with three-vrm 3.5.5, in desktop Chromium, on these files:
- VRoid Studio: AvatarSample_A, Vita. UniVRM: AliciaSolid. VRM 1.0: Seed-san, Constraint_Twist.
- A Meebit made with the VRM add-on for Blender. It plays; it has no expressions or eye bones, so only the head and body move.
- The add-on's own 70 test files: 54 load and 16 are refused with an error. Many are tiny test scenes rather than characters, so this shows they load, not that they are framed well.
Not tested: a fresh export from Blender, real decoders through configureLoader, and real phones. Issue #1 is still open.
Changes that may refuse what worked before
- The format check now holds what a model's meshes would cost to a limit before anything is built, and checks every number the rig computes with. Every model we tested still loads; a damaged or hand-edited file that got through before may now be refused with a message.
- On the example pages,
?model=opens files on the same site only.
Also
Player.isSupported()lets a page ask before it starts.- A damaged file leaves the character on screen in place.
- Types work with
node16andnodenext.
Examples
- Every character has a
cover.webp(512 x 768, about 50 KB). The pages show it at once and fade the character in over it. - The examples site loads one file per character. A dropped download is tried again, then falls back to the character's folder.
- The camera button says what the camera is for before the browser asks. A refused or missing camera gets a short note and a demo motion.
- The gallery opens on the refined Nana and no longer switches characters by itself.
Requirements
WebGL2 and ES2023: Chrome / Edge 97+, Firefox 104+, Safari 15.4+. Tested on current desktop browsers, not yet on real phones. The notes for 0.2.0 first said "on desktop and mobile", which went further than our testing, and have been corrected.
Install
Not on npm yet: build from this repository (npm install && npm run build) and import dist/index.js.
License
Code: Apache License 2.0. Featured characters: characters/LICENSE.md and characters/CREDITS.md.
All changes: v0.2.0...v0.2.1
中文:这一版更正了三个精选角色的来源和条款,也让播放器更轻、更快。0.2.0 的角色许可写的是 21 个角色都由 LivLiv 团队制作,这对 Kujira、Kujira Q 和 Pen 不对,它们来自别人的作品。Kujira 和 Kujira Q 采用 CC BY-NC-SA 4.0;Apache 许可和 LivLiv 精选角色许可都不适用于 Pen,LivLiv 对这个角色不持有任何权利,也不授予任何权利。如果你用的是 0.2.0 里的这三个角色,请以 characters/CREDITS.md 为准。另外:核心约 30 KB(gzip),加载和每帧都更快,修了 VRM 的几处问题,格式检查更严,示例页先显示封面。目前只在桌面浏览器上测过,手机还没有测。还没有上 npm,请从仓库构建。
日本語:このバージョンでは、厳選キャラクター 3 体の出典と利用条件を訂正し、プレイヤーを軽く、速くしました。0.2.0 のキャラクターライセンスには 21 体すべてを LivLiv チームが制作したとありましたが、Kujira、Kujira Q、Pen については誤りで、この 3 体は他の方の作品がもとになっています。Kujira と Kujira Q は CC BY-NC-SA 4.0 です。Pen には Apache License も LivLiv Featured Characters License も適用されず、LivLiv はこのキャラクターについて権利を持たず、許諾もしません。0.2.0 のこの 3 体をお使いの場合は、characters/CREDITS.md に従ってください。そのほか、コアは gzip で約 30 KB になり、読み込みと毎フレームの処理が速くなりました。VRM の不具合をいくつか修正し、フォーマットの検査を厳しくし、サンプルページは最初にカバー画像を表示します。テストはデスクトップのブラウザのみで、スマートフォンではまだ行っていません。npm にはまだ公開していないので、リポジトリからビルドしてください。
LivLiv Player 0.2.0
The first public release of LivLiv Player: a lightweight 2.5D character player for the web, with lip sync and webcam face tracking. It comes with 21 featured characters, ready to use.
What's in it
Playerplays a LivLiv model (a.livlivfile, or its folder) on a<canvas>with WebGL2: layered 2D art that turns its head with depth. No dependencies; about 34 KB gzipped for the core, idle motion included.- Idle motion: breathing, blinking, and following the pointer with the eyes and head.
setExpression(),act()(nod,shake,tilt,hop,shy,away),lookAt()andblink()on top. - Lip sync (
@livliv-dev/player/voice): from the microphone, aMediaStream, an<audio>or<video>element, or clips queued withspeech.say(). - Face tracking (
@livliv-dev/player/tracking): webcam tracking with MediaPipe, in the browser. Camera images stay on the device; API.md has the networking details. - VRM and PNGTuber characters (
@livliv-dev/player/body,/vrm,/png): the same API, lip sync and face tracking included. VRM 0.x and 1.0 needthreeand@pixiv/three-vrm, both optional.
(Corrected after release: the package name is @livliv-dev/player. These notes first used a name that is not ours on npm.)
- Format 4:
.livlivandmodel.jsonv4, described in FORMAT.md with a JSON Schema inschema/. Packages exported before v4 still play. - Untrusted files: sizes, layer counts, paths and ZIP entries are checked before anything reaches the GPU, and the readers are fuzz-tested. Limits are in API.md.
- Examples:
example/demo.html(expressions, actions, microphone, camera),gallery.html(all 21 characters),png.html,vrm.html.
Featured characters
21 characters in characters/, each with four expressions (smile, shy, angry, sad). None of them are under the Apache License.
- 18 are LivLiv's own, carefully made with AI: free for personal, non-commercial use with credit ("Characters: LivLiv (livliv.ai)"); no selling or AI training. For commercial use, ask by email ([email protected]). They carry a small LivLiv mark in the bottom-right corner. Nana is LivLiv's mascot. Full terms: characters/LICENSE.md.
- Kujira, Kujira Q and Pen come from other people's work. That license doesn't cover them, and LivLiv can't grant commercial use for them. Their sources, credits and terms: characters/CREDITS.md.
Install
Not on npm yet: build from this repository (npm install && npm run build) and import dist/index.js.
Requirements
WebGL2 and ES2023: Chrome / Edge 97+, Firefox 104+, Safari 15.4+. Tested on current desktop browsers, not yet on real phones (corrected: this line first said "on desktop and mobile"). The tests need Node 22.18 or newer; CI draws every featured character in headless Chromium.
License
Code: Apache License 2.0. Featured characters: characters/LICENSE.md and characters/CREDITS.md. Neither covers the LivLiv name and logos.
中文:LivLiv Player 的第一个公开版本。超轻量的 2.5D 网页角色播放器,支持口型同步和摄像头面捕,VRM 和 PNGTuber 角色用同一套接口;附带 21 个精选角色,每个都有四种表情。其中 18 个是我们精心制作的(AI 参与制作),个人非商业使用免费,请署名;Kujira、Kujira Q、Pen 来自别人的作品,来源和条款见 characters/CREDITS.md。详见 README.zh-CN.md。
日本語:LivLiv Player の最初の公開バージョンです。リップシンクと Web カメラのフェイストラッキングに対応した軽量の Web 向けキャラクタープレイヤーで、VRM と PNGTuber も同じ API で再生できます。厳選キャラクター 21 体つき(表情は各 4 種)。うち 18 体は AI を使って丁寧に作ったもので、個人の非商用利用は無料、クレジット表記が必要です。Kujira、Kujira Q、Pen は他の方の作品がもとで、出典と条件は characters/CREDITS.md にあります。詳しくは README.ja.md へ。