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