@celljs/ta-web 4.28.0 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/esm/browser/assistant/assistant-thread.js +15 -2
- package/esm/browser/assistant/call-scenes.d.ts +5 -4
- package/esm/browser/assistant/call-scenes.js +10 -7
- package/esm/browser/chat/chat-protocol.d.ts +2 -0
- package/esm/browser/chat/chat-shown.d.ts +3 -1
- package/esm/browser/chat/chat-shown.js +25 -3
- package/esm/browser/chat/chat.d.ts +5 -1
- package/esm/browser/chat/chat.js +32 -16
- package/esm/browser/components/account-menu.d.ts +6 -16
- package/esm/browser/components/account-menu.js +47 -101
- package/esm/browser/components/app-contexts.js +3 -2
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/composer-box-protocol.d.ts +2 -0
- package/esm/browser/components/composer-box.js +20 -1
- package/esm/browser/components/composer-emoji.d.ts +22 -0
- package/esm/browser/components/composer-emoji.js +50 -0
- package/esm/browser/components/discover-view.d.ts +4 -3
- package/esm/browser/components/discover-view.js +5 -4
- package/esm/browser/components/emoji-panel.d.ts +22 -0
- package/esm/browser/components/emoji-panel.js +54 -0
- package/esm/browser/components/host-view.d.ts +1 -1
- package/esm/browser/components/markdown.d.ts +6 -1
- package/esm/browser/components/markdown.js +6 -2
- package/esm/browser/components/me-rows.d.ts +24 -0
- package/esm/browser/components/me-rows.js +19 -0
- package/esm/browser/components/me-view.d.ts +2 -1
- package/esm/browser/components/me-view.js +3 -2
- package/esm/browser/components/message-list.js +47 -7
- package/esm/browser/components/message-steps.js +13 -0
- package/esm/browser/components/nav-places.js +1 -1
- package/esm/browser/components/settings-choices.js +3 -0
- package/esm/browser/components/settings-controls.d.ts +13 -0
- package/esm/browser/components/settings-controls.js +19 -0
- package/esm/browser/components/settings-more.d.ts +1 -1
- package/esm/browser/components/settings-more.js +28 -39
- package/esm/browser/components/settings-parts.d.ts +4 -2
- package/esm/browser/components/settings-parts.js +14 -9
- package/esm/browser/components/settings-view.js +2 -6
- package/esm/browser/components/web-composer.d.ts +1 -1
- package/esm/browser/components/web-composer.js +2 -2
- package/esm/browser/device/file-save.d.ts +31 -0
- package/esm/browser/device/file-save.js +80 -0
- package/esm/browser/extension/extension-view.d.ts +2 -0
- package/esm/browser/extension/extension-view.js +2 -0
- package/esm/browser/extension/web-api-call.d.ts +45 -0
- package/esm/browser/extension/web-api-components.d.ts +4 -0
- package/esm/browser/extension/web-api-contributions.d.ts +13 -14
- package/esm/browser/extension/web-api-desktop.d.ts +16 -1
- package/esm/browser/extension/web-api-desktop.js +1 -0
- package/esm/browser/extension/web-extension-api.d.ts +7 -9
- package/esm/browser/extension/web-extension-code.d.ts +15 -8
- package/esm/browser/extension/web-extension-code.js +25 -27
- package/esm/browser/extension/web-extension-context.js +3 -0
- package/esm/browser/extension/web-extension-protocol.d.ts +8 -1
- package/esm/browser/extension/web-extension-protocol.js +1 -0
- package/esm/browser/extension/web-extension-run.d.ts +3 -2
- package/esm/browser/extension/web-extension-run.js +8 -4
- package/esm/browser/extension/web-extensions-running.js +7 -6
- package/esm/browser/extension/web-pages.d.ts +2 -0
- package/esm/browser/extension/web-pages.js +2 -0
- package/esm/browser/i18n/en/account.d.ts +202 -0
- package/esm/browser/i18n/en/account.js +205 -0
- package/esm/browser/i18n/en/assistant.d.ts +129 -0
- package/esm/browser/i18n/en/assistant.js +130 -0
- package/esm/browser/i18n/en/call.d.ts +86 -0
- package/esm/browser/i18n/en/call.js +87 -0
- package/esm/browser/i18n/en/chat.d.ts +213 -0
- package/esm/browser/i18n/en/chat.js +214 -0
- package/esm/browser/i18n/en/common.d.ts +99 -0
- package/esm/browser/i18n/en/common.js +101 -0
- package/esm/browser/i18n/en/console.d.ts +230 -0
- package/esm/browser/i18n/en/console.js +232 -0
- package/esm/browser/i18n/en/discover.d.ts +117 -0
- package/esm/browser/i18n/en/discover.js +119 -0
- package/esm/browser/i18n/en/service.d.ts +242 -0
- package/esm/browser/i18n/en/service.js +245 -0
- package/esm/browser/i18n/en/settings.d.ts +213 -0
- package/esm/browser/i18n/en/settings.js +214 -0
- package/esm/browser/i18n/en/tools.d.ts +85 -0
- package/esm/browser/i18n/en/tools.js +87 -0
- package/esm/browser/i18n/ja/account.d.ts +2 -0
- package/esm/browser/i18n/ja/account.js +202 -0
- package/esm/browser/i18n/ja/assistant.d.ts +2 -0
- package/esm/browser/i18n/ja/assistant.js +129 -0
- package/esm/browser/i18n/ja/call.d.ts +2 -0
- package/esm/browser/i18n/ja/call.js +86 -0
- package/esm/browser/i18n/ja/chat.d.ts +2 -0
- package/esm/browser/i18n/ja/chat.js +213 -0
- package/esm/browser/i18n/ja/common.d.ts +2 -0
- package/esm/browser/i18n/ja/common.js +99 -0
- package/esm/browser/i18n/ja/console.d.ts +2 -0
- package/esm/browser/i18n/ja/console.js +230 -0
- package/esm/browser/i18n/ja/discover.d.ts +2 -0
- package/esm/browser/i18n/ja/discover.js +117 -0
- package/esm/browser/i18n/ja/service.d.ts +2 -0
- package/esm/browser/i18n/ja/service.js +242 -0
- package/esm/browser/i18n/ja/settings.d.ts +2 -0
- package/esm/browser/i18n/ja/settings.js +213 -0
- package/esm/browser/i18n/ja/tools.d.ts +2 -0
- package/esm/browser/i18n/ja/tools.js +85 -0
- package/esm/browser/i18n/locales.d.ts +1136 -1136
- package/esm/browser/i18n/messages-ja.js +20 -1586
- package/esm/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/esm/browser/i18n/messages-zh-tw.js +20 -1587
- package/esm/browser/i18n/messages.d.ts +1139 -1136
- package/esm/browser/i18n/messages.js +44 -3183
- package/esm/browser/i18n/zh/account.d.ts +2 -0
- package/esm/browser/i18n/zh/account.js +203 -0
- package/esm/browser/i18n/zh/assistant.d.ts +2 -0
- package/esm/browser/i18n/zh/assistant.js +129 -0
- package/esm/browser/i18n/zh/call.d.ts +2 -0
- package/esm/browser/i18n/zh/call.js +86 -0
- package/esm/browser/i18n/zh/chat.d.ts +2 -0
- package/esm/browser/i18n/zh/chat.js +213 -0
- package/esm/browser/i18n/zh/common.d.ts +2 -0
- package/esm/browser/i18n/zh/common.js +99 -0
- package/esm/browser/i18n/zh/console.d.ts +2 -0
- package/esm/browser/i18n/zh/console.js +230 -0
- package/esm/browser/i18n/zh/discover.d.ts +2 -0
- package/esm/browser/i18n/zh/discover.js +117 -0
- package/esm/browser/i18n/zh/service.d.ts +2 -0
- package/esm/browser/i18n/zh/service.js +242 -0
- package/esm/browser/i18n/zh/settings.d.ts +2 -0
- package/esm/browser/i18n/zh/settings.js +213 -0
- package/esm/browser/i18n/zh/tools.d.ts +2 -0
- package/esm/browser/i18n/zh/tools.js +86 -0
- package/esm/browser/i18n/zh-tw/account.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/account.js +202 -0
- package/esm/browser/i18n/zh-tw/assistant.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/assistant.js +129 -0
- package/esm/browser/i18n/zh-tw/call.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/call.js +86 -0
- package/esm/browser/i18n/zh-tw/chat.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/chat.js +213 -0
- package/esm/browser/i18n/zh-tw/common.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/common.js +99 -0
- package/esm/browser/i18n/zh-tw/console.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/console.js +230 -0
- package/esm/browser/i18n/zh-tw/discover.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +117 -0
- package/esm/browser/i18n/zh-tw/service.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/service.js +242 -0
- package/esm/browser/i18n/zh-tw/settings.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/settings.js +213 -0
- package/esm/browser/i18n/zh-tw/tools.d.ts +2 -0
- package/esm/browser/i18n/zh-tw/tools.js +85 -0
- package/esm/browser/offline/device-values.d.ts +4 -0
- package/esm/browser/offline/device-values.js +10 -0
- package/esm/browser/pwa/page-build.d.ts +15 -0
- package/esm/browser/pwa/page-build.js +45 -0
- package/esm/browser/settings/settings-protocol.d.ts +2 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/base.d.ts +1 -1
- package/esm/browser/style/base.js +3 -0
- package/esm/browser/style/conversation-column.d.ts +1 -1
- package/esm/browser/style/conversation-column.js +17 -0
- package/esm/browser/style/conversation.d.ts +1 -1
- package/esm/browser/style/conversation.js +5 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +0 -7
- package/esm/browser/style/video-call.d.ts +1 -1
- package/esm/browser/style/video-call.js +15 -4
- package/esm/browser/util/call-transcript.d.ts +16 -0
- package/esm/browser/util/call-transcript.js +110 -0
- package/esm/browser/util/process.d.ts +6 -0
- package/esm/browser/util/process.js +18 -5
- package/esm/browser/video-call/call-people.d.ts +21 -0
- package/esm/browser/video-call/call-people.js +29 -0
- package/esm/browser/video-call/clip-plan.d.ts +11 -2
- package/esm/browser/video-call/clip-plan.js +19 -3
- package/esm/browser/video-call/face-camera.d.ts +93 -0
- package/esm/browser/video-call/face-camera.js +192 -0
- package/esm/browser/video-call/face-files.d.ts +43 -5
- package/esm/browser/video-call/face-files.js +73 -18
- package/esm/browser/video-call/face-moves.d.ts +68 -0
- package/esm/browser/video-call/face-moves.js +180 -0
- package/esm/browser/video-call/face-stage.d.ts +139 -0
- package/esm/browser/video-call/face-stage.js +219 -0
- package/esm/browser/video-call/mouth-layer.d.ts +81 -0
- package/esm/browser/video-call/mouth-layer.js +241 -0
- package/esm/browser/video-call/video-call-view.js +44 -4
- package/esm/browser/video-call/video-face.d.ts +11 -5
- package/esm/browser/video-call/video-face.js +302 -328
- package/esm/browser/workbench.d.ts +8 -0
- package/esm/browser/workbench.js +37 -1
- package/lib/browser/assistant/assistant-thread.js +15 -2
- package/lib/browser/assistant/call-scenes.d.ts +5 -4
- package/lib/browser/assistant/call-scenes.js +10 -7
- package/lib/browser/chat/chat-protocol.d.ts +2 -0
- package/lib/browser/chat/chat-shown.d.ts +3 -1
- package/lib/browser/chat/chat-shown.js +25 -3
- package/lib/browser/chat/chat.d.ts +5 -1
- package/lib/browser/chat/chat.js +32 -16
- package/lib/browser/components/account-menu.d.ts +6 -16
- package/lib/browser/components/account-menu.js +45 -99
- package/lib/browser/components/app-contexts.js +2 -1
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/composer-box-protocol.d.ts +2 -0
- package/lib/browser/components/composer-box.js +20 -1
- package/lib/browser/components/composer-emoji.d.ts +23 -0
- package/lib/browser/components/composer-emoji.js +87 -0
- package/lib/browser/components/discover-view.d.ts +4 -3
- package/lib/browser/components/discover-view.js +5 -4
- package/lib/browser/components/emoji-panel.d.ts +23 -0
- package/lib/browser/components/emoji-panel.js +90 -0
- package/lib/browser/components/host-view.d.ts +1 -1
- package/lib/browser/components/markdown.d.ts +6 -1
- package/lib/browser/components/markdown.js +6 -2
- package/lib/browser/components/me-rows.d.ts +25 -0
- package/lib/browser/components/me-rows.js +22 -0
- package/lib/browser/components/me-view.d.ts +2 -1
- package/lib/browser/components/me-view.js +3 -2
- package/lib/browser/components/message-list.js +46 -6
- package/lib/browser/components/message-steps.js +13 -0
- package/lib/browser/components/nav-places.js +1 -1
- package/lib/browser/components/settings-choices.js +3 -0
- package/lib/browser/components/settings-controls.d.ts +13 -0
- package/lib/browser/components/settings-controls.js +19 -0
- package/lib/browser/components/settings-more.d.ts +1 -1
- package/lib/browser/components/settings-more.js +27 -38
- package/lib/browser/components/settings-parts.d.ts +4 -2
- package/lib/browser/components/settings-parts.js +13 -8
- package/lib/browser/components/settings-view.js +2 -6
- package/lib/browser/components/web-composer.d.ts +1 -1
- package/lib/browser/components/web-composer.js +2 -2
- package/lib/browser/device/file-save.d.ts +32 -0
- package/lib/browser/device/file-save.js +83 -0
- package/lib/browser/extension/extension-view.d.ts +2 -0
- package/lib/browser/extension/extension-view.js +3 -1
- package/lib/browser/extension/web-api-call.d.ts +45 -0
- package/lib/browser/extension/web-api-components.d.ts +4 -0
- package/lib/browser/extension/web-api-contributions.d.ts +13 -14
- package/lib/browser/extension/web-api-desktop.d.ts +16 -1
- package/lib/browser/extension/web-api-desktop.js +1 -0
- package/lib/browser/extension/web-extension-api.d.ts +7 -9
- package/lib/browser/extension/web-extension-code.d.ts +15 -8
- package/lib/browser/extension/web-extension-code.js +25 -27
- package/lib/browser/extension/web-extension-context.js +3 -0
- package/lib/browser/extension/web-extension-protocol.d.ts +8 -1
- package/lib/browser/extension/web-extension-protocol.js +1 -0
- package/lib/browser/extension/web-extension-run.d.ts +3 -2
- package/lib/browser/extension/web-extension-run.js +8 -4
- package/lib/browser/extension/web-extensions-running.js +7 -6
- package/lib/browser/extension/web-pages.d.ts +2 -0
- package/lib/browser/extension/web-pages.js +2 -0
- package/lib/browser/i18n/en/account.d.ts +203 -0
- package/lib/browser/i18n/en/account.js +208 -0
- package/lib/browser/i18n/en/assistant.d.ts +130 -0
- package/lib/browser/i18n/en/assistant.js +133 -0
- package/lib/browser/i18n/en/call.d.ts +87 -0
- package/lib/browser/i18n/en/call.js +90 -0
- package/lib/browser/i18n/en/chat.d.ts +214 -0
- package/lib/browser/i18n/en/chat.js +217 -0
- package/lib/browser/i18n/en/common.d.ts +100 -0
- package/lib/browser/i18n/en/common.js +104 -0
- package/lib/browser/i18n/en/console.d.ts +231 -0
- package/lib/browser/i18n/en/console.js +235 -0
- package/lib/browser/i18n/en/discover.d.ts +118 -0
- package/lib/browser/i18n/en/discover.js +122 -0
- package/lib/browser/i18n/en/service.d.ts +243 -0
- package/lib/browser/i18n/en/service.js +248 -0
- package/lib/browser/i18n/en/settings.d.ts +214 -0
- package/lib/browser/i18n/en/settings.js +217 -0
- package/lib/browser/i18n/en/tools.d.ts +86 -0
- package/lib/browser/i18n/en/tools.js +90 -0
- package/lib/browser/i18n/ja/account.d.ts +3 -0
- package/lib/browser/i18n/ja/account.js +205 -0
- package/lib/browser/i18n/ja/assistant.d.ts +3 -0
- package/lib/browser/i18n/ja/assistant.js +132 -0
- package/lib/browser/i18n/ja/call.d.ts +3 -0
- package/lib/browser/i18n/ja/call.js +89 -0
- package/lib/browser/i18n/ja/chat.d.ts +3 -0
- package/lib/browser/i18n/ja/chat.js +216 -0
- package/lib/browser/i18n/ja/common.d.ts +3 -0
- package/lib/browser/i18n/ja/common.js +102 -0
- package/lib/browser/i18n/ja/console.d.ts +3 -0
- package/lib/browser/i18n/ja/console.js +233 -0
- package/lib/browser/i18n/ja/discover.d.ts +3 -0
- package/lib/browser/i18n/ja/discover.js +120 -0
- package/lib/browser/i18n/ja/service.d.ts +3 -0
- package/lib/browser/i18n/ja/service.js +245 -0
- package/lib/browser/i18n/ja/settings.d.ts +3 -0
- package/lib/browser/i18n/ja/settings.js +216 -0
- package/lib/browser/i18n/ja/tools.d.ts +3 -0
- package/lib/browser/i18n/ja/tools.js +88 -0
- package/lib/browser/i18n/locales.d.ts +1136 -1136
- package/lib/browser/i18n/messages-ja.js +20 -1586
- package/lib/browser/i18n/messages-zh-tw.d.ts +0 -1
- package/lib/browser/i18n/messages-zh-tw.js +20 -1587
- package/lib/browser/i18n/messages.d.ts +1139 -1136
- package/lib/browser/i18n/messages.js +44 -3183
- package/lib/browser/i18n/zh/account.d.ts +3 -0
- package/lib/browser/i18n/zh/account.js +206 -0
- package/lib/browser/i18n/zh/assistant.d.ts +3 -0
- package/lib/browser/i18n/zh/assistant.js +132 -0
- package/lib/browser/i18n/zh/call.d.ts +3 -0
- package/lib/browser/i18n/zh/call.js +89 -0
- package/lib/browser/i18n/zh/chat.d.ts +3 -0
- package/lib/browser/i18n/zh/chat.js +216 -0
- package/lib/browser/i18n/zh/common.d.ts +3 -0
- package/lib/browser/i18n/zh/common.js +102 -0
- package/lib/browser/i18n/zh/console.d.ts +3 -0
- package/lib/browser/i18n/zh/console.js +233 -0
- package/lib/browser/i18n/zh/discover.d.ts +3 -0
- package/lib/browser/i18n/zh/discover.js +120 -0
- package/lib/browser/i18n/zh/service.d.ts +3 -0
- package/lib/browser/i18n/zh/service.js +245 -0
- package/lib/browser/i18n/zh/settings.d.ts +3 -0
- package/lib/browser/i18n/zh/settings.js +216 -0
- package/lib/browser/i18n/zh/tools.d.ts +3 -0
- package/lib/browser/i18n/zh/tools.js +89 -0
- package/lib/browser/i18n/zh-tw/account.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/account.js +205 -0
- package/lib/browser/i18n/zh-tw/assistant.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/assistant.js +132 -0
- package/lib/browser/i18n/zh-tw/call.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/call.js +89 -0
- package/lib/browser/i18n/zh-tw/chat.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/chat.js +216 -0
- package/lib/browser/i18n/zh-tw/common.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/common.js +102 -0
- package/lib/browser/i18n/zh-tw/console.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/console.js +233 -0
- package/lib/browser/i18n/zh-tw/discover.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/discover.js +120 -0
- package/lib/browser/i18n/zh-tw/service.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/service.js +245 -0
- package/lib/browser/i18n/zh-tw/settings.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/settings.js +216 -0
- package/lib/browser/i18n/zh-tw/tools.d.ts +3 -0
- package/lib/browser/i18n/zh-tw/tools.js +88 -0
- package/lib/browser/offline/device-values.d.ts +4 -0
- package/lib/browser/offline/device-values.js +10 -0
- package/lib/browser/pwa/page-build.d.ts +16 -0
- package/lib/browser/pwa/page-build.js +48 -0
- package/lib/browser/settings/settings-protocol.d.ts +2 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/base.d.ts +1 -1
- package/lib/browser/style/base.js +3 -0
- package/lib/browser/style/conversation-column.d.ts +1 -1
- package/lib/browser/style/conversation-column.js +17 -0
- package/lib/browser/style/conversation.d.ts +1 -1
- package/lib/browser/style/conversation.js +5 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +0 -7
- package/lib/browser/style/video-call.d.ts +1 -1
- package/lib/browser/style/video-call.js +15 -4
- package/lib/browser/util/call-transcript.d.ts +17 -0
- package/lib/browser/util/call-transcript.js +113 -0
- package/lib/browser/util/process.d.ts +6 -0
- package/lib/browser/util/process.js +17 -4
- package/lib/browser/video-call/call-people.d.ts +22 -0
- package/lib/browser/video-call/call-people.js +32 -0
- package/lib/browser/video-call/clip-plan.d.ts +11 -2
- package/lib/browser/video-call/clip-plan.js +19 -3
- package/lib/browser/video-call/face-camera.d.ts +94 -0
- package/lib/browser/video-call/face-camera.js +197 -0
- package/lib/browser/video-call/face-files.d.ts +43 -5
- package/lib/browser/video-call/face-files.js +73 -18
- package/lib/browser/video-call/face-moves.d.ts +69 -0
- package/lib/browser/video-call/face-moves.js +184 -0
- package/lib/browser/video-call/face-stage.d.ts +140 -0
- package/lib/browser/video-call/face-stage.js +223 -0
- package/lib/browser/video-call/mouth-layer.d.ts +82 -0
- package/lib/browser/video-call/mouth-layer.js +245 -0
- package/lib/browser/video-call/video-call-view.js +44 -4
- package/lib/browser/video-call/video-face.d.ts +11 -5
- package/lib/browser/video-call/video-face.js +302 -328
- package/lib/browser/workbench.d.ts +8 -0
- package/lib/browser/workbench.js +36 -0
- package/package.json +7 -7
- package/public/faces/README.md +17 -4
- package/public/faces/blonde/clap.mp4 +0 -0
- package/public/faces/blonde/dance.mp4 +0 -0
- package/public/faces/blonde/face.jpg +0 -0
- package/public/faces/blonde/happy.mp4 +0 -0
- package/public/faces/blonde/heart.mp4 +0 -0
- package/public/faces/blonde/idle-1.mp4 +0 -0
- package/public/faces/blonde/idle-2.mp4 +0 -0
- package/public/faces/blonde/idle-3.mp4 +0 -0
- package/public/faces/blonde/laugh.mp4 +0 -0
- package/public/faces/blonde/listening.mp4 +0 -0
- package/public/faces/blonde/poster.jpg +0 -0
- package/public/faces/blonde/shy.mp4 +0 -0
- package/public/faces/blonde/sorry.mp4 +0 -0
- package/public/faces/blonde/stretch.mp4 +0 -0
- package/public/faces/blonde/surprised.mp4 +0 -0
- package/public/faces/blonde/talk-1.mp4 +0 -0
- package/public/faces/blonde/talk-2.mp4 +0 -0
- package/public/faces/blonde/think-2.mp4 +0 -0
- package/public/faces/blonde/thinking.mp4 +0 -0
- package/public/faces/blonde/wave.mp4 +0 -0
- package/public/faces/dance.mp4 +0 -0
- package/public/faces/face.jpg +0 -0
- package/public/faces/framing.json +1 -0
- package/public/faces/lips.json +1 -1
- package/public/faces/stretch.mp4 +0 -0
- package/esm/browser/video-call/face-clips.d.ts +0 -33
- package/esm/browser/video-call/face-clips.js +0 -93
- package/lib/browser/video-call/face-clips.d.ts +0 -34
- package/lib/browser/video-call/face-clips.js +0 -96
|
@@ -1,36 +1,45 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { CallScenes } from '../assistant/call-scenes.js';
|
|
2
3
|
import { useWebExtensions } from '../hooks.js';
|
|
4
|
+
import { TurnEnd } from '../util/turn-end.js';
|
|
5
|
+
import { CallPeople } from './call-people.js';
|
|
3
6
|
import { CLIP_FPS, ClipPlan, ClipSync } from './clip-plan.js';
|
|
4
|
-
import {
|
|
7
|
+
import { FaceCameras } from './face-camera.js';
|
|
5
8
|
import { FaceFiles } from './face-files.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
import { FaceMoves } from './face-moves.js';
|
|
10
|
+
import { FaceBlend, FaceStage, SEAM_MS } from './face-stage.js';
|
|
11
|
+
import { MouthLayer } from './mouth-layer.js';
|
|
12
|
+
/** How long a move she said she would make (a dance) may wait for her to listen, in ms: then it is let go. */
|
|
13
|
+
const COMING_MS = 20000;
|
|
14
|
+
/** How fast she goes back to rest from a move (a heart, a dance), as the call goes on: faster than this looked hurried. */
|
|
15
|
+
const HURRY_RATE = 1.5;
|
|
12
16
|
/** How long the sound may not go on before the clip holds still too, in ms (the clock of sound moves in steps). */
|
|
13
17
|
const STILL_MS = 120;
|
|
14
18
|
/** The frames of a clip when faces/lips.json does not say (5 s and a sixth at 24 fps). */
|
|
15
19
|
const FRAMES = 124;
|
|
16
|
-
/** How
|
|
17
|
-
const
|
|
20
|
+
/** How long before a clip ends the next is chosen and loaded behind it, in seconds. */
|
|
21
|
+
const AHEAD_S = 1;
|
|
18
22
|
/**
|
|
19
|
-
* The person of a video call: two layers of video
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* state of the call
|
|
23
|
+
* The person of a video call (docs/design/ta-call.md 12, 15, 16): two layers of video (FaceStage), the next clip decoded
|
|
24
|
+
* behind and fading in over the one shown once its first frame is on the screen. What plays is decided in one place,
|
|
25
|
+
* each frame: as Ta reads with a voice service, the clip its ClipPlan has for that moment of the sound, the mouth an
|
|
26
|
+
* extension draws for it laid over it (MouthLayer); otherwise the clips of the state of the call, and the moves of
|
|
27
|
+
* what she says (FaceMoves, the user's own first). Each layer shows the part of its clip its camera aims at
|
|
28
|
+
* (FaceCameras): her face close as she sits, all of her as she stands up and moves.
|
|
23
29
|
*/
|
|
24
|
-
export function VideoFace({ call, onReady, onFailed }) {
|
|
30
|
+
export function VideoFace({ call, person = '', clear = 0, onReady, onFailed, }) {
|
|
25
31
|
var _a;
|
|
26
32
|
var _b;
|
|
27
33
|
const layers = [React.useRef(null), React.useRef(null)];
|
|
28
34
|
const box = React.useRef(null);
|
|
29
35
|
const canvas = React.useRef(null);
|
|
30
|
-
const [
|
|
31
|
-
const [{ callMouth }] = useWebExtensions();
|
|
36
|
+
const [{ callMouth, callMoves }] = useWebExtensions();
|
|
32
37
|
const mouth = React.useRef(callMouth);
|
|
33
38
|
mouth.current = callMouth;
|
|
39
|
+
const sources = React.useRef(callMoves);
|
|
40
|
+
sources.current = callMoves;
|
|
41
|
+
const clearing = React.useRef(clear);
|
|
42
|
+
clearing.current = clear;
|
|
34
43
|
// biome-ignore lint/correctness/useExhaustiveDependencies: the layers are refs, set up once a call
|
|
35
44
|
React.useEffect(() => {
|
|
36
45
|
var _a;
|
|
@@ -42,89 +51,165 @@ export function VideoFace({ call, onReady, onFailed }) {
|
|
|
42
51
|
return;
|
|
43
52
|
}
|
|
44
53
|
let gone = false;
|
|
45
|
-
let shown = 0;
|
|
46
|
-
let kind;
|
|
47
54
|
let ready = false;
|
|
48
|
-
|
|
55
|
+
let started = false;
|
|
56
|
+
const faces = FaceFiles.of(doc, CallPeople.dir(person));
|
|
57
|
+
const book = new FaceMoves();
|
|
58
|
+
const stage = new FaceStage(videos, clip => faces.clip(clip), () => view.performance.now(), {
|
|
59
|
+
shown: () => {
|
|
60
|
+
if (!ready) {
|
|
61
|
+
ready = true;
|
|
62
|
+
onReady();
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
failed: (clip, error) => { var _a; return fail(clip, String((_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error)); },
|
|
66
|
+
});
|
|
67
|
+
const playing = () => {
|
|
68
|
+
const { video, clip } = stage.playing();
|
|
69
|
+
return { video: video, clip };
|
|
70
|
+
};
|
|
71
|
+
const cameras = new FaceCameras(faces, videos, box.current, () => clearing.current);
|
|
49
72
|
const frames = (clip) => { var _a; return (_a = faces.frames(clip)) !== null && _a !== void 0 ? _a : FRAMES; };
|
|
50
|
-
// The
|
|
51
|
-
|
|
52
|
-
let
|
|
73
|
+
// The state whose clips play, or the move that plays, and the clip asked for last.
|
|
74
|
+
let loop;
|
|
75
|
+
let move;
|
|
53
76
|
let last;
|
|
54
|
-
//
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
//
|
|
77
|
+
// Whether the clip of the move is over.
|
|
78
|
+
let moveDone = false;
|
|
79
|
+
// The sentences of this answer whose move played, by the plan of a reading or by what she says: each plays once,
|
|
80
|
+
// though the sentence is still the one heard as the reading ends. Forgotten as Ta thinks of the next answer.
|
|
81
|
+
const moved = new Set();
|
|
82
|
+
// What she said she would do (FaceMoves.after), and the sentence that said it: it plays once she listens.
|
|
58
83
|
let coming;
|
|
59
84
|
let comingFor;
|
|
85
|
+
let comingAt = 0;
|
|
86
|
+
// The reading whose plan shows the move playing, and whether she listened since it began (wentOn).
|
|
87
|
+
let plannedSay;
|
|
88
|
+
let settled = false;
|
|
89
|
+
/** A move plays, not over yet: it plays to its end, unless the call goes on (hurrying). */
|
|
90
|
+
const moving = () => !!move && !moveDone;
|
|
91
|
+
/**
|
|
92
|
+
* The user says something: words, not a sound alone ("嗯") nor a word of the echo of her voice, which the
|
|
93
|
+
* service hears now and then and never makes a turn of.
|
|
94
|
+
*/
|
|
95
|
+
const userSpoke = () => {
|
|
96
|
+
const heard = call.state.heard;
|
|
97
|
+
return TurnEnd.words(heard) >= 2 && !TurnEnd.sounds(heard);
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* The call went on since the move began: the user speaks, or Ta speaks again after she listened. Not Ta thinking
|
|
101
|
+
* of news of the work, which it often answers with nothing.
|
|
102
|
+
*/
|
|
103
|
+
const wentOn = () => {
|
|
104
|
+
if (userSpoke()) {
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
if (call.state.phase === 'speaking') {
|
|
108
|
+
return settled;
|
|
109
|
+
}
|
|
110
|
+
settled = true;
|
|
111
|
+
return false;
|
|
112
|
+
};
|
|
113
|
+
// The next clip of a state, chosen as the clip shown nears its end and loaded behind it.
|
|
114
|
+
let upcoming;
|
|
60
115
|
const words = () => {
|
|
61
116
|
const reading = call.state.reading;
|
|
62
117
|
return reading === null || reading === void 0 ? void 0 : reading.pieces[reading.at];
|
|
63
118
|
};
|
|
119
|
+
/** A reading of a voice service waits to begin (its hold): what plays goes on until its sound does. */
|
|
120
|
+
const holding = () => {
|
|
121
|
+
const reading = call.sounds.nowReading();
|
|
122
|
+
return !!reading && !call.state.paused && call.state.phase === 'speaking' && reading.now() < 0;
|
|
123
|
+
};
|
|
124
|
+
/** What should play now; undefined to go on with what plays. */
|
|
64
125
|
const wanted = () => {
|
|
65
|
-
const
|
|
66
|
-
const plain = FaceClips.kind(phase, !!paused);
|
|
126
|
+
const plain = FaceMoves.kind(call.state.phase, !!call.state.paused);
|
|
67
127
|
if (plain === 'listening') {
|
|
68
128
|
// What she said she would do, once she said it; then it plays to its end, unless Ta thinks or speaks.
|
|
69
129
|
if (coming) {
|
|
70
130
|
return coming;
|
|
71
131
|
}
|
|
72
|
-
return
|
|
132
|
+
return moving() ? move : plain;
|
|
73
133
|
}
|
|
74
134
|
if (plain !== 'speaking') {
|
|
75
135
|
return plain;
|
|
76
136
|
}
|
|
137
|
+
if (holding()) {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
if (moving() && (move === null || move === void 0 ? void 0 : move.when) === 'say') {
|
|
141
|
+
return move;
|
|
142
|
+
}
|
|
143
|
+
// The move a sentence asks for, else its look, as she says it (FaceMoves.said).
|
|
77
144
|
const said = words();
|
|
78
|
-
const
|
|
79
|
-
return
|
|
145
|
+
const look = book.said(said);
|
|
146
|
+
return look && said !== undefined && !moved.has(said) ? look : 'speaking';
|
|
147
|
+
};
|
|
148
|
+
/** How long `clip` from `at` fades in over what shows: short at a seam, longer the farther her pose. */
|
|
149
|
+
const blend = (clip, at) => {
|
|
150
|
+
var _a, _b;
|
|
151
|
+
const { video, clip: from } = playing();
|
|
152
|
+
if (!from || !ready) {
|
|
153
|
+
return SEAM_MS;
|
|
154
|
+
}
|
|
155
|
+
const frame = Math.round(video.currentTime * CLIP_FPS);
|
|
156
|
+
const to = Math.round(at * CLIP_FPS);
|
|
157
|
+
const seam = FaceBlend.seated(frame, frames(from)) && FaceBlend.seated(to, frames(clip));
|
|
158
|
+
return FaceBlend.ms((_a = faces.boxes(from)) === null || _a === void 0 ? void 0 : _a[Math.min(frame, frames(from) - 1)], (_b = faces.boxes(clip)) === null || _b === void 0 ? void 0 : _b[to], seam);
|
|
80
159
|
};
|
|
81
|
-
/** Plays `clip` in the layer behind from `at` seconds, which comes in front once it plays. */
|
|
82
160
|
const show = (clip, at = 0) => {
|
|
83
|
-
const back = 1 - shown;
|
|
84
|
-
const video = videos[back];
|
|
85
161
|
last = clip;
|
|
86
|
-
|
|
87
|
-
loading = clip;
|
|
88
|
-
video.dataset.clip = clip;
|
|
89
|
-
const src = faces.clip(clip);
|
|
90
|
-
if (video.src !== src) {
|
|
91
|
-
video.src = src;
|
|
92
|
-
}
|
|
93
|
-
video.currentTime = at;
|
|
94
|
-
video.playbackRate = 1;
|
|
95
|
-
void video.play().then(() => {
|
|
96
|
-
if (names[back] !== clip || gone) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
loading = undefined;
|
|
100
|
-
shown = back;
|
|
101
|
-
setFront(back);
|
|
102
|
-
videos[1 - back].pause();
|
|
103
|
-
if (!ready) {
|
|
104
|
-
ready = true;
|
|
105
|
-
onReady();
|
|
106
|
-
}
|
|
107
|
-
}, () => {
|
|
108
|
-
// Another clip took the layer meanwhile (its load stopped this one): not a failure.
|
|
109
|
-
if (names[back] !== clip || gone) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
loading = undefined;
|
|
113
|
-
if (!ready) {
|
|
114
|
-
onFailed();
|
|
115
|
-
}
|
|
116
|
-
});
|
|
162
|
+
stage.show(clip, at, blend(clip, at));
|
|
117
163
|
};
|
|
118
164
|
const play = (next) => {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
165
|
+
var _a;
|
|
166
|
+
if (typeof next === 'string') {
|
|
167
|
+
plannedSay = undefined;
|
|
168
|
+
move = undefined;
|
|
169
|
+
loop = next;
|
|
170
|
+
// Never the clip asked for last: asked again, the stage keeps it as it is, and one that ended stays still.
|
|
171
|
+
const clip = (upcoming === null || upcoming === void 0 ? void 0 : upcoming.loop) === next && upcoming.clip !== stage.wanted ? upcoming.clip : book.loop(next, (_a = stage.wanted) !== null && _a !== void 0 ? _a : last);
|
|
172
|
+
upcoming = undefined;
|
|
173
|
+
show(clip);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (next !== move) {
|
|
177
|
+
const said = words();
|
|
178
|
+
if (said !== undefined) {
|
|
179
|
+
moved.add(said);
|
|
180
|
+
}
|
|
181
|
+
moveDone = false;
|
|
182
|
+
settled = false;
|
|
122
183
|
}
|
|
184
|
+
plannedSay = undefined;
|
|
123
185
|
if (next === coming) {
|
|
124
186
|
coming = undefined;
|
|
125
187
|
}
|
|
126
|
-
|
|
127
|
-
|
|
188
|
+
move = next;
|
|
189
|
+
loop = undefined;
|
|
190
|
+
upcoming = undefined;
|
|
191
|
+
show(next.clip);
|
|
192
|
+
};
|
|
193
|
+
/** A clip could not play: one of the user's gives way to Ta's own, and the extension that gave it is told why. */
|
|
194
|
+
const fail = (clip, reason) => {
|
|
195
|
+
var _a;
|
|
196
|
+
var _b;
|
|
197
|
+
if (!book.fail(clip, reason)) {
|
|
198
|
+
if (!ready) {
|
|
199
|
+
onFailed();
|
|
200
|
+
}
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
const name = clip.slice(clip.indexOf(':') + 1);
|
|
204
|
+
for (const source of sources.current) {
|
|
205
|
+
(_a = source.failed) === null || _a === void 0 ? void 0 : _a.call(source, name, reason);
|
|
206
|
+
}
|
|
207
|
+
CallScenes.show(call, { moves: book.told() });
|
|
208
|
+
move = undefined;
|
|
209
|
+
loop = undefined;
|
|
210
|
+
upcoming = undefined;
|
|
211
|
+
play((_b = wanted()) !== null && _b !== void 0 ? _b : FaceMoves.kind(call.state.phase, !!call.state.paused));
|
|
212
|
+
return true;
|
|
128
213
|
};
|
|
129
214
|
// The plans of the readings, by their say: which clip shows at each moment of their sound.
|
|
130
215
|
const plans = new Map();
|
|
@@ -132,10 +217,11 @@ export function VideoFace({ call, onReady, onFailed }) {
|
|
|
132
217
|
let plan = plans.get(say);
|
|
133
218
|
if (!plan) {
|
|
134
219
|
const used = new Set();
|
|
135
|
-
|
|
220
|
+
const of = () => {
|
|
136
221
|
const reading = call.sounds.nowReading();
|
|
137
|
-
return
|
|
138
|
-
}
|
|
222
|
+
return (reading === null || reading === void 0 ? void 0 : reading.say) === say ? reading : undefined;
|
|
223
|
+
};
|
|
224
|
+
plan = new ClipPlan(frames, (seconds, before) => book.at(of(), seconds, before !== null && before !== void 0 ? before : last, used), seconds => book.cue(of(), seconds, used), clip => !!book.of(clip));
|
|
139
225
|
plans.set(say, plan);
|
|
140
226
|
for (const old of plans.keys()) {
|
|
141
227
|
if (old < say - 1) {
|
|
@@ -151,76 +237,154 @@ export function VideoFace({ call, onReady, onFailed }) {
|
|
|
151
237
|
return reading && !call.state.paused && call.state.phase === 'speaking' && reading.now() >= 0 ? reading : undefined;
|
|
152
238
|
};
|
|
153
239
|
const ended = (event) => {
|
|
154
|
-
|
|
240
|
+
var _a, _b;
|
|
241
|
+
if (event.target !== playing().video) {
|
|
155
242
|
return;
|
|
156
243
|
}
|
|
157
|
-
if (
|
|
158
|
-
|
|
244
|
+
if (move) {
|
|
245
|
+
moveDone = true;
|
|
159
246
|
}
|
|
160
247
|
if (!driving()) {
|
|
161
|
-
play(wanted());
|
|
248
|
+
play((_b = (_a = wanted()) !== null && _a !== void 0 ? _a : loop) !== null && _b !== void 0 ? _b : 'listening');
|
|
162
249
|
}
|
|
163
250
|
};
|
|
164
251
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
252
|
+
* A move plays on its own, past the sentence that named it (a heart takes its time, a dance is 10 s), true while
|
|
253
|
+
* it does: to its end, which is her at rest again. When the call goes on (the user speaks, Ta speaks again) she
|
|
254
|
+
* hurries there rather than the clip cutting away: from a dance or a stretch she first goes to where she sits
|
|
255
|
+
* down again (ClipFraming.back, faded into as any change of clip), then fast. While the plan of the reading that
|
|
256
|
+
* named it shows it, the plan keeps it on the clock of the sound instead.
|
|
167
257
|
*/
|
|
168
258
|
const hurrying = () => {
|
|
169
|
-
|
|
170
|
-
|
|
259
|
+
var _a, _b;
|
|
260
|
+
const { video, clip } = playing();
|
|
261
|
+
if (!moving() || !move || clip !== move.clip || video.ended) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
if (plannedSay !== undefined && ((_a = driving()) === null || _a === void 0 ? void 0 : _a.say) === plannedSay) {
|
|
171
265
|
return false;
|
|
172
266
|
}
|
|
173
|
-
if (call.state.
|
|
174
|
-
video.
|
|
267
|
+
if (call.state.paused !== video.paused) {
|
|
268
|
+
void (call.state.paused ? video.pause() : video.play().catch(() => undefined));
|
|
175
269
|
}
|
|
270
|
+
if (!wentOn()) {
|
|
271
|
+
video.playbackRate = 1;
|
|
272
|
+
return true;
|
|
273
|
+
}
|
|
274
|
+
const back = move.when === 'after' ? (_b = faces.framing(move.clip)) === null || _b === void 0 ? void 0 : _b.back : undefined;
|
|
275
|
+
if (back !== undefined && video.currentTime < back) {
|
|
276
|
+
if (stage.wanted === move.clip && !stage.jumping(back)) {
|
|
277
|
+
stage.show(move.clip, back, blend(move.clip, back), true);
|
|
278
|
+
}
|
|
279
|
+
return true;
|
|
280
|
+
}
|
|
281
|
+
video.playbackRate = HURRY_RATE;
|
|
176
282
|
return true;
|
|
177
283
|
};
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
void faces.ready.then(() => !gone && play(wanted()));
|
|
185
|
-
const timer = setInterval(() => {
|
|
284
|
+
/** What plays, by the state of the call and what she says: asked each frame, so that one place decides. */
|
|
285
|
+
const decide = () => {
|
|
286
|
+
var _a, _b;
|
|
287
|
+
if (call.state.phase === 'thinking') {
|
|
288
|
+
moved.clear();
|
|
289
|
+
}
|
|
186
290
|
const said = call.state.phase === 'speaking' ? words() : undefined;
|
|
187
|
-
const then =
|
|
291
|
+
const then = book.after(said);
|
|
188
292
|
if (then && said !== comingFor) {
|
|
189
293
|
comingFor = said;
|
|
190
294
|
coming = then;
|
|
295
|
+
comingAt = Date.now();
|
|
296
|
+
}
|
|
297
|
+
// The user spoke before she stood up, or it waited too long: what she said she would do is let go.
|
|
298
|
+
if (coming && (userSpoke() || Date.now() - comingAt > COMING_MS)) {
|
|
299
|
+
coming = undefined;
|
|
191
300
|
}
|
|
192
|
-
if (!
|
|
301
|
+
if (!started || hurrying() || driving()) {
|
|
193
302
|
return;
|
|
194
303
|
}
|
|
195
304
|
const next = wanted();
|
|
196
|
-
if (next !==
|
|
305
|
+
if (next !== undefined && next !== (move !== null && move !== void 0 ? move : loop)) {
|
|
197
306
|
play(next);
|
|
198
307
|
}
|
|
308
|
+
const { video, clip } = playing();
|
|
309
|
+
// What plays ended and nothing comes after it (an end missed): the next clip, rather than a picture held still.
|
|
310
|
+
if (clip && video.ended && stage.wanted === clip && !stage.busy()) {
|
|
311
|
+
if (move) {
|
|
312
|
+
moveDone = true;
|
|
313
|
+
}
|
|
314
|
+
play((_b = (_a = wanted()) !== null && _a !== void 0 ? _a : loop) !== null && _b !== void 0 ? _b : 'listening');
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
// The clip after this one, chosen and decoded behind it as it nears its end: it comes in at once. Only once
|
|
318
|
+
// the clip asked for is the one that plays: chosen while it loads, it would be of the clip before.
|
|
319
|
+
if (clip && clip === stage.wanted && !upcoming && video.duration - video.currentTime < AHEAD_S) {
|
|
320
|
+
const after = FaceMoves.kind(call.state.phase, !!call.state.paused);
|
|
321
|
+
upcoming = { loop: after, clip: book.loop(after, clip) };
|
|
322
|
+
stage.prime(upcoming.clip);
|
|
323
|
+
}
|
|
199
324
|
// Paused (the page hidden), it holds still; it moves again as the call does.
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
325
|
+
if (call.state.paused && !video.paused) {
|
|
326
|
+
video.pause();
|
|
327
|
+
}
|
|
328
|
+
else if (!call.state.paused && video.paused && ready && clip && !video.ended) {
|
|
329
|
+
void video.play().catch(() => undefined);
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
const failed = (event) => {
|
|
333
|
+
const clip = event.target.dataset.clip;
|
|
334
|
+
if (!clip || !fail(clip, 'decode')) {
|
|
335
|
+
if (!ready) {
|
|
336
|
+
onFailed();
|
|
337
|
+
}
|
|
203
338
|
}
|
|
204
|
-
|
|
205
|
-
|
|
339
|
+
};
|
|
340
|
+
for (const video of videos) {
|
|
341
|
+
video.addEventListener('ended', ended);
|
|
342
|
+
video.addEventListener('error', failed);
|
|
343
|
+
}
|
|
344
|
+
// The clips as they are now (faces/README.md) and the user's own; then the face moves, and Ta knows its moves.
|
|
345
|
+
void (async () => {
|
|
346
|
+
var _a;
|
|
347
|
+
await faces.ready;
|
|
348
|
+
// The user's moves are made from the first person's picture (@celljs/ta-moves): hers alone.
|
|
349
|
+
const lists = faces.person ? [] : await Promise.all(sources.current.map(source => source.moves().catch(() => [])));
|
|
350
|
+
const own = lists.flat();
|
|
351
|
+
for (const given of own) {
|
|
352
|
+
faces.add(FaceMoves.ownClip(given.name), given);
|
|
353
|
+
}
|
|
354
|
+
book.use(own);
|
|
355
|
+
if (gone) {
|
|
356
|
+
return;
|
|
206
357
|
}
|
|
207
|
-
|
|
208
|
-
|
|
358
|
+
started = true;
|
|
359
|
+
CallScenes.show(call, { moves: book.told() });
|
|
360
|
+
play((_a = wanted()) !== null && _a !== void 0 ? _a : 'listening');
|
|
361
|
+
})();
|
|
362
|
+
const layer = new MouthLayer(call, planOf, canvas.current, view, faces, (video, width) => cameras.place(video, width), () => {
|
|
209
363
|
const reading = driving();
|
|
210
|
-
const clip =
|
|
211
|
-
|
|
364
|
+
const { video, clip } = playing();
|
|
365
|
+
const under = stage.under();
|
|
366
|
+
return reading && clip ? { reading, video, clip, under: under && { video: under.video, alpha: under.alpha } } : undefined;
|
|
212
367
|
});
|
|
213
368
|
void layer.open(mouth.current);
|
|
214
369
|
layer.watch(videos);
|
|
215
|
-
// Each frame: the
|
|
370
|
+
// Each frame: the fade goes on, the cameras aim, what plays is decided; as Ta reads, the clip of the moment of
|
|
371
|
+
// the sound, kept on its clock, and the mouth drawn for it.
|
|
216
372
|
let held;
|
|
217
373
|
let heldAt = 0;
|
|
218
|
-
let frame = view.requestAnimationFrame(function tick() {
|
|
374
|
+
let frame = view.requestAnimationFrame(function tick(time) {
|
|
219
375
|
if (gone) {
|
|
220
376
|
return;
|
|
221
377
|
}
|
|
222
378
|
frame = view.requestAnimationFrame(tick);
|
|
379
|
+
stage.frame();
|
|
380
|
+
cameras.frame(time, stage.names);
|
|
381
|
+
decide();
|
|
223
382
|
const reading = driving();
|
|
383
|
+
// The reading that drives the clip now, for checks of the call (and anyone curious).
|
|
384
|
+
const drives = reading ? String(reading.say) : '';
|
|
385
|
+
if (box.current && box.current.dataset.reading !== drives) {
|
|
386
|
+
box.current.dataset.reading = drives;
|
|
387
|
+
}
|
|
224
388
|
if (!reading) {
|
|
225
389
|
layer.clear();
|
|
226
390
|
held = undefined;
|
|
@@ -231,7 +395,7 @@ export function VideoFace({ call, onReady, onFailed }) {
|
|
|
231
395
|
}
|
|
232
396
|
return;
|
|
233
397
|
}
|
|
234
|
-
if (!
|
|
398
|
+
if (!started) {
|
|
235
399
|
return;
|
|
236
400
|
}
|
|
237
401
|
const seconds = reading.now();
|
|
@@ -239,15 +403,26 @@ export function VideoFace({ call, onReady, onFailed }) {
|
|
|
239
403
|
layer.follow(reading, seconds);
|
|
240
404
|
return;
|
|
241
405
|
}
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
406
|
+
const plan = planOf(reading.say);
|
|
407
|
+
const at = plan.at(seconds);
|
|
408
|
+
const { video, clip } = playing();
|
|
409
|
+
if (stage.wanted !== at.clip) {
|
|
410
|
+
// A move of the plan (FaceMoves.at): it plays whole, past the end of the reading.
|
|
411
|
+
const next = book.of(at.clip);
|
|
412
|
+
if (next && next !== move) {
|
|
413
|
+
// The sentences heard up to now: the move is of one of them (FaceMoves.at looks back), none plays again.
|
|
414
|
+
for (let k = reading.pieceAt(seconds); k >= 0; k--) {
|
|
415
|
+
moved.add(reading.pieces[k]);
|
|
416
|
+
}
|
|
417
|
+
moveDone = false;
|
|
418
|
+
settled = false;
|
|
248
419
|
}
|
|
420
|
+
move = next;
|
|
421
|
+
loop = next ? undefined : 'speaking';
|
|
422
|
+
plannedSay = reading.say;
|
|
423
|
+
show(at.clip, at.frame / CLIP_FPS);
|
|
249
424
|
}
|
|
250
|
-
else {
|
|
425
|
+
else if (clip === at.clip) {
|
|
251
426
|
// The sound stopped short (what comes next is late): she holds still until it goes on.
|
|
252
427
|
const time = view.performance.now();
|
|
253
428
|
if (seconds !== held) {
|
|
@@ -259,18 +434,25 @@ export function VideoFace({ call, onReady, onFailed }) {
|
|
|
259
434
|
void (still ? video.pause() : video.play().catch(() => undefined));
|
|
260
435
|
}
|
|
261
436
|
const sync = ClipSync.step(at.frame / CLIP_FPS, video.currentTime);
|
|
262
|
-
|
|
437
|
+
// Never a seek while the clip fades in (it would show a frame of before as it decodes): it catches up.
|
|
438
|
+
if (sync.seek !== undefined && !stage.under()) {
|
|
263
439
|
video.currentTime = sync.seek;
|
|
264
440
|
}
|
|
265
|
-
video.playbackRate = sync.rate;
|
|
441
|
+
video.playbackRate = sync.seek !== undefined && stage.under() ? 1.25 : sync.rate;
|
|
442
|
+
}
|
|
443
|
+
// The clip that comes next in the plan, decoded behind ahead of its moment.
|
|
444
|
+
const ahead = plan.at(seconds + AHEAD_S);
|
|
445
|
+
if (ahead.clip !== at.clip) {
|
|
446
|
+
stage.prime(ahead.clip);
|
|
266
447
|
}
|
|
267
448
|
layer.follow(reading, seconds);
|
|
268
449
|
});
|
|
269
450
|
return () => {
|
|
270
451
|
gone = true;
|
|
452
|
+
stage.close();
|
|
271
453
|
view.cancelAnimationFrame(frame);
|
|
454
|
+
cameras.close();
|
|
272
455
|
layer.close();
|
|
273
|
-
clearInterval(timer);
|
|
274
456
|
for (const video of videos) {
|
|
275
457
|
video.removeEventListener('ended', ended);
|
|
276
458
|
video.removeEventListener('error', failed);
|
|
@@ -279,219 +461,11 @@ export function VideoFace({ call, onReady, onFailed }) {
|
|
|
279
461
|
video.load();
|
|
280
462
|
}
|
|
281
463
|
};
|
|
282
|
-
}, [call]);
|
|
283
|
-
const poster = FaceFiles.poster((_b = (_a = box.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) !== null && _b !== void 0 ? _b : document);
|
|
464
|
+
}, [call, person]);
|
|
465
|
+
const poster = FaceFiles.poster((_b = (_a = box.current) === null || _a === void 0 ? void 0 : _a.ownerDocument) !== null && _b !== void 0 ? _b : document, CallPeople.dir(person));
|
|
284
466
|
return (React.createElement("div", { ref: box, className: "ta-video-clips" },
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
key: index, ref: layer, className: `ta-video-clip${front === index ? ' ta-front' : ''}`, poster: poster, muted: true, playsInline: true, preload: "auto", disablePictureInPicture: true }))),
|
|
467
|
+
React.createElement("img", { className: "ta-video-backdrop", src: poster, alt: "", "aria-hidden": true, draggable: false }),
|
|
468
|
+
layers.map((layer, index) => (React.createElement("video", { key: index, ref: layer, className: "ta-video-clip", poster: poster, muted: true, playsInline: true, preload: "auto", disablePictureInPicture: true }))),
|
|
288
469
|
React.createElement("canvas", { ref: canvas, className: "ta-video-mouth" })));
|
|
289
470
|
}
|
|
290
|
-
/**
|
|
291
|
-
* The mouth an extension draws for what Ta reads (WebCallMouth), laid over the clip: told the sound of each reading as
|
|
292
|
-
* it comes with the frame of the clip at each moment of it (ClipPlan), it gives that frame's lower face drawn again
|
|
293
|
-
* for that sound. As each frame of the clip is shown (requestVideoFrameCallback), that frame and the mouth of that
|
|
294
|
-
* moment of the sound are drawn together, the mouth moved with her face when it was drawn for a frame near it: the
|
|
295
|
-
* clip and the sound keep their own clocks a little apart. The reading waits for it as long as it asks (holdMs).
|
|
296
|
-
*/
|
|
297
|
-
class MouthLayer {
|
|
298
|
-
constructor(call, planOf, canvas, view, faces, showing) {
|
|
299
|
-
this.call = call;
|
|
300
|
-
this.planOf = planOf;
|
|
301
|
-
this.canvas = canvas;
|
|
302
|
-
this.view = view;
|
|
303
|
-
this.faces = faces;
|
|
304
|
-
this.showing = showing;
|
|
305
|
-
this.closed = false;
|
|
306
|
-
/** Of each reading: the seconds of its sound that came, and the slots told. */
|
|
307
|
-
this.sounds = new Map();
|
|
308
|
-
this.atSlot = -1;
|
|
309
|
-
/** The canvas shows the frames of the clip now, not the layers of video under it. */
|
|
310
|
-
this.drawing = false;
|
|
311
|
-
}
|
|
312
|
-
async open(mouth) {
|
|
313
|
-
var _a;
|
|
314
|
-
const session = await (mouth === null || mouth === void 0 ? void 0 : mouth.open().catch(() => undefined));
|
|
315
|
-
if (!session) {
|
|
316
|
-
return;
|
|
317
|
-
}
|
|
318
|
-
if (this.closed) {
|
|
319
|
-
session.close();
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
this.session = session;
|
|
323
|
-
this.missed = (_a = this.call.sounds.nowReading()) === null || _a === void 0 ? void 0 : _a.say;
|
|
324
|
-
this.call.sounds.hold(session.holdMs);
|
|
325
|
-
this.offSound = this.call.sounds.on((say, pcm, rate) => this.sound(say, pcm, rate));
|
|
326
|
-
}
|
|
327
|
-
sound(say, pcm, rate) {
|
|
328
|
-
var _a;
|
|
329
|
-
var _b, _c;
|
|
330
|
-
const session = this.session;
|
|
331
|
-
if (!session || say === this.missed) {
|
|
332
|
-
return;
|
|
333
|
-
}
|
|
334
|
-
if (!this.sounds.has(say)) {
|
|
335
|
-
// A reading begins: it waits as long as the mouth asks, more while the mouth starts.
|
|
336
|
-
this.call.sounds.hold(session.holdMs + Math.min(STARTING_MS, (_b = (_a = session.readyIn) === null || _a === void 0 ? void 0 : _a.call(session)) !== null && _b !== void 0 ? _b : 0));
|
|
337
|
-
}
|
|
338
|
-
const heard = (_c = this.sounds.get(say)) !== null && _c !== void 0 ? _c : { seconds: 0, told: 0 };
|
|
339
|
-
this.sounds.set(say, heard);
|
|
340
|
-
for (const old of this.sounds.keys()) {
|
|
341
|
-
if (old < say - 1) {
|
|
342
|
-
this.sounds.delete(old);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
if (pcm) {
|
|
346
|
-
heard.seconds += pcm.byteLength / 2 / rate;
|
|
347
|
-
}
|
|
348
|
-
const upto = pcm ? Math.floor(heard.seconds * session.fps) : Math.ceil(heard.seconds * session.fps);
|
|
349
|
-
const plan = this.planOf(say);
|
|
350
|
-
const slots = [];
|
|
351
|
-
for (let slot = heard.told; slot < upto; slot++) {
|
|
352
|
-
const { clip, frame } = plan.at(slot / session.fps);
|
|
353
|
-
slots.push([clip, frame]);
|
|
354
|
-
}
|
|
355
|
-
const first = heard.told;
|
|
356
|
-
heard.told = Math.max(heard.told, upto);
|
|
357
|
-
session.sound(say, pcm, rate, slots, first);
|
|
358
|
-
}
|
|
359
|
-
/** The reading plays at `seconds` of its sound: the extension knows what it need not draw any more. */
|
|
360
|
-
follow(reading, seconds) {
|
|
361
|
-
const session = this.session;
|
|
362
|
-
if (!session) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
if (this.say !== undefined && this.say !== reading.say) {
|
|
366
|
-
session.cut(this.say);
|
|
367
|
-
}
|
|
368
|
-
this.say = reading.say;
|
|
369
|
-
const slot = Math.floor(seconds * session.fps);
|
|
370
|
-
if (slot !== this.atSlot) {
|
|
371
|
-
this.atSlot = slot;
|
|
372
|
-
session.at(reading.say, slot);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
/** Draws as each frame of the layers of video is shown, the one in front. */
|
|
376
|
-
watch(videos) {
|
|
377
|
-
const offs = videos.map(video => {
|
|
378
|
-
if (typeof video.requestVideoFrameCallback !== 'function') {
|
|
379
|
-
return () => undefined;
|
|
380
|
-
}
|
|
381
|
-
const shown = (_now, frame) => {
|
|
382
|
-
handle = video.requestVideoFrameCallback(shown);
|
|
383
|
-
this.shown(video, frame.mediaTime);
|
|
384
|
-
};
|
|
385
|
-
let handle = video.requestVideoFrameCallback(shown);
|
|
386
|
-
return () => video.cancelVideoFrameCallback(handle);
|
|
387
|
-
});
|
|
388
|
-
this.offFrames = () => {
|
|
389
|
-
for (const off of offs) {
|
|
390
|
-
off();
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
/** A frame of `video` is shown, `mediaTime` into its clip: it is drawn, with the mouth of the moment over it. */
|
|
395
|
-
shown(video, mediaTime) {
|
|
396
|
-
var _a, _b, _c;
|
|
397
|
-
const session = this.session;
|
|
398
|
-
const canvas = this.canvas;
|
|
399
|
-
const now = this.showing();
|
|
400
|
-
if (!session || !canvas || !now || now.video !== video || !video.videoWidth) {
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
const context = this.fit(canvas);
|
|
404
|
-
if (!context) {
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
|
-
const width = canvas.width;
|
|
408
|
-
const height = canvas.height;
|
|
409
|
-
const scale = Math.max(width / video.videoWidth, height / video.videoHeight);
|
|
410
|
-
const left = (width - video.videoWidth * scale) * 0.5;
|
|
411
|
-
const top = (height - video.videoHeight * scale) * 0.3;
|
|
412
|
-
context.drawImage(video, left, top, video.videoWidth * scale, video.videoHeight * scale);
|
|
413
|
-
this.drawing = true;
|
|
414
|
-
const shownFrame = Math.round(mediaTime * CLIP_FPS);
|
|
415
|
-
const drawn = this.nearest(session, now.reading.say, Math.floor(now.reading.now() * session.fps), now.clip, shownFrame);
|
|
416
|
-
const at = this.place(drawn, now.clip, shownFrame);
|
|
417
|
-
if (drawn && at) {
|
|
418
|
-
context.drawImage(drawn.image, left + at[0] * scale, top + at[1] * scale, at[2] * scale, at[3] * scale);
|
|
419
|
-
}
|
|
420
|
-
// How many frames showed while Ta read, and how many with her mouth: read by checks of the call (and by anyone curious).
|
|
421
|
-
canvas.dataset.frames = String(Number((_a = canvas.dataset.frames) !== null && _a !== void 0 ? _a : 0) + 1);
|
|
422
|
-
canvas.dataset.mouths = String(Number((_b = canvas.dataset.mouths) !== null && _b !== void 0 ? _b : 0) + (drawn && at ? 1 : 0));
|
|
423
|
-
if (drawn && at) {
|
|
424
|
-
canvas.dataset.apart = String(Number((_c = canvas.dataset.apart) !== null && _c !== void 0 ? _c : 0) + Math.abs(drawn.frame - shownFrame));
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* The mouth of the moment of the sound, or of the slot just before or after it if that one was drawn for a frame
|
|
429
|
-
* nearer the one shown (the frame comes to the screen a little after its moment): a mouth a slot early or late is
|
|
430
|
-
* not seen, one laid over a frame it was not drawn for is.
|
|
431
|
-
*/
|
|
432
|
-
nearest(session, say, slot, clip, frame) {
|
|
433
|
-
let best;
|
|
434
|
-
for (const near of [slot, slot - 1, slot + 1]) {
|
|
435
|
-
const drawn = session.frame(say, near);
|
|
436
|
-
if ((drawn === null || drawn === void 0 ? void 0 : drawn.clip) === clip && (!best || Math.abs(drawn.frame - frame) < Math.abs(best.frame - frame))) {
|
|
437
|
-
best = drawn;
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
return best !== null && best !== void 0 ? best : session.frame(say, slot);
|
|
441
|
-
}
|
|
442
|
-
/**
|
|
443
|
-
* Where the mouth drawn goes over `frame` of `clip`: its place in the frame it was drawn for, moved and scaled as her
|
|
444
|
-
* face is from that frame to this one; undefined when it is of another clip, or of a frame too far.
|
|
445
|
-
*/
|
|
446
|
-
place(drawn, clip, frame) {
|
|
447
|
-
if (!drawn || drawn.clip !== clip || Math.abs(drawn.frame - frame) > NEAR_FRAMES) {
|
|
448
|
-
return undefined;
|
|
449
|
-
}
|
|
450
|
-
const boxes = this.faces.boxes(clip);
|
|
451
|
-
const from = boxes === null || boxes === void 0 ? void 0 : boxes[drawn.frame];
|
|
452
|
-
const to = boxes === null || boxes === void 0 ? void 0 : boxes[Math.min(frame, boxes.length - 1)];
|
|
453
|
-
const [x, y, w, h] = drawn.box;
|
|
454
|
-
if (!from || !to || drawn.frame === frame) {
|
|
455
|
-
return [x, y, w, h];
|
|
456
|
-
}
|
|
457
|
-
const sx = (to[2] - to[0]) / Math.max(1, from[2] - from[0]);
|
|
458
|
-
const sy = (to[3] - to[1]) / Math.max(1, from[3] - from[1]);
|
|
459
|
-
return [to[0] + (x - from[0]) * sx, to[1] + (y - from[1]) * sy, w * sx, h * sy];
|
|
460
|
-
}
|
|
461
|
-
/** Nothing over the clip: Ta is not reading with its voice service now. */
|
|
462
|
-
clear() {
|
|
463
|
-
var _a;
|
|
464
|
-
if (this.say !== undefined) {
|
|
465
|
-
(_a = this.session) === null || _a === void 0 ? void 0 : _a.cut(this.say);
|
|
466
|
-
this.say = undefined;
|
|
467
|
-
this.atSlot = -1;
|
|
468
|
-
}
|
|
469
|
-
if (this.drawing && this.canvas) {
|
|
470
|
-
this.drawing = false;
|
|
471
|
-
this.fit(this.canvas);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
/** The canvas the size it shows at, cleared. */
|
|
475
|
-
fit(canvas) {
|
|
476
|
-
const ratio = Math.min(2, this.view.devicePixelRatio || 1);
|
|
477
|
-
const width = Math.round(canvas.clientWidth * ratio);
|
|
478
|
-
const height = Math.round(canvas.clientHeight * ratio);
|
|
479
|
-
if (canvas.width !== width || canvas.height !== height) {
|
|
480
|
-
canvas.width = width;
|
|
481
|
-
canvas.height = height;
|
|
482
|
-
}
|
|
483
|
-
const context = canvas.getContext('2d');
|
|
484
|
-
context === null || context === void 0 ? void 0 : context.clearRect(0, 0, width, height);
|
|
485
|
-
return context;
|
|
486
|
-
}
|
|
487
|
-
close() {
|
|
488
|
-
var _a, _b, _c;
|
|
489
|
-
this.closed = true;
|
|
490
|
-
(_a = this.offSound) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
491
|
-
(_b = this.offFrames) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
492
|
-
(_c = this.session) === null || _c === void 0 ? void 0 : _c.close();
|
|
493
|
-
this.session = undefined;
|
|
494
|
-
this.call.sounds.hold(0);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
471
|
//# sourceMappingURL=video-face.js.map
|