Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(editor): 0-byte recordings, and a scrub thumb stuck at 0% on an empty timeline

Etienne Lescotdc2013c2b184
diff --git a/package-lock.json b/package-lock.json
index 3876357a8..7460297ad 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "openscreen",
- "version": "1.6.0",
+ "version": "1.6.0-rc.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openscreen",
- "version": "1.6.0",
+ "version": "1.6.0-rc.1",
"dependencies": {
"@fix-webm-duration/fix": "^1.0.1",
"@pixi/filter-drop-shadow": "^5.2.0",
@@ -22,9 +22,6 @@
"@radix-ui/react-toggle": "^1.1.10",
"@radix-ui/react-toggle-group": "^1.1.11",
"@radix-ui/react-tooltip": "^1.2.8",
- "@tiptap/extension-text-style": "^3.27.1",
- "@tiptap/react": "^3.27.1",
- "@tiptap/starter-kit": "^3.27.1",
"@types/gif.js": "^0.2.5",
"@uiw/color-convert": "^2.10.1",
"@uiw/react-color-block": "^2.10.1",
@@ -3883,448 +3880,6 @@
"@testing-library/dom": ">=7.21.4"
}
},
- "node_modules/@tiptap/core": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.27.1.tgz",
- "integrity": "sha512-rV6Qn4wmC6BxfF+4mu6bqGWj9vA4oXXhsrpXaJL2uhjxeHAGofjwcHof2X84VYzeyXgdlsGmqKie4TAppVXZUQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-blockquote": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-3.27.1.tgz",
- "integrity": "sha512-VMF7xJx6qEGiX6DTKNiL31NLqypOcd/4sNjFSe8rb41PwejBJh/nOqVIbBvWkiT6NMGFLxMhj7zJ8/zPo1hXeg==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-bold": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-3.27.1.tgz",
- "integrity": "sha512-TlC5bsS+pqETTrlz4CZz9RO/cKBYtELGIxwtKeivUn3eNfnOxQbbu4WDsiwIfzRFyd0OMnKl6BPM2KnYEehoEQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-bubble-menu": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.27.1.tgz",
- "integrity": "sha512-j/j8Qp9Z5nViade2m7zjrO/CYH/Ca80Qj7aqo0eUaei6FZQ5izlF9o4XQU5EFMAutV6mwynsPUp8FVo5sCuYfw==",
- "license": "MIT",
- "optional": true,
- "dependencies": {
- "@floating-ui/dom": "^1.0.0"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-bullet-list": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-3.27.1.tgz",
- "integrity": "sha512-faCUHnRP47o9Zh9VZZX6EX/569udw9Vopm2PgEKPWuKLE2qaS5WBuUVU0iItdJmKUqaWiOZkpoW4jvnDmj0dfg==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/extension-list": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-code": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-3.27.1.tgz",
- "integrity": "sha512-epOUpFfEmBzjvnqvjv2qHX7NAuLo5dlOGV690lWu+sAYMjibuJBeVvAiKPyFCfRCCTUxdbDB3jbaOA1yEcEJ7w==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-code-block": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-3.27.1.tgz",
- "integrity": "sha512-pHlzmZx2OlHfyQ0yRlT5UL4mGokz947DthZuYefN1OleVqOkHpWBG+2JQwqoNq6bmzMne92zbH32rhcJUEYSjA==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-document": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-3.27.1.tgz",
- "integrity": "sha512-8FbBTkfnRP4iVaoj+2h3iWa+H0eGDD3yTyVCwrmue/sQTkqUNUoSuAZa3GDG4Sd41xdPwTJxl9nUWGgM1qDCnw==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-dropcursor": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-3.27.1.tgz",
- "integrity": "sha512-blFf9x9RG0Qr7P3FoAH/033ffa+mMLZn34trVs8Vi0Ppk6FmJAg5HpYFOtmYoeREdNDJ5rHJKV7SoACbOHgskQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/extensions": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-floating-menu": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-3.27.1.tgz",
- "integrity": "sha512-BmJF1VqB7dSJkgAalrpVFj88WLhxKjcWPuWHOqf2ITrUU2832BhKLXKmxjWUy1gqV8PfNNVWtGfIERy7I0y0+Q==",
- "license": "MIT",
- "optional": true,
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@floating-ui/dom": "^1.0.0",
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-gapcursor": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-3.27.1.tgz",
- "integrity": "sha512-QoezN0wdvXIwLQ4ee2ccWDaX3RG0lzgQpIMpMz55oPDhpUVax1+19ApsS53LkcktpS4EbnPL4xO4DaJk0Vp7PQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/extensions": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-hard-break": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-3.27.1.tgz",
- "integrity": "sha512-iv/m9hzl6jfSj9Q8UEjAxONvCoUDaP7M9SRCPx3PaLNxA230TTD6RE0Ye4zFJ8ze7ZVoJJMAqg9Qpq1iYg2JOQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-heading": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-3.27.1.tgz",
- "integrity": "sha512-SrC4l1kEIyv9ZXFaI/8LQqU2MyMmjczw7XXsWUQOTN4YXv0JyVgMNR3cI/wz0d2xsTfBdZ1N85Tdng+Ga1t0Sg==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-horizontal-rule": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.27.1.tgz",
- "integrity": "sha512-QlKE7qn5qMnIGVGhXQlvYedvLtNJ9z0dmit5w8vPb8tKzW4Spk6M7N2kruprrDA8GBwHfeR5wmF+njfUm34qxg==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-italic": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-3.27.1.tgz",
- "integrity": "sha512-jGGeyn9uRUnNjSTHpbqhiGsp6KaYTSbV09jDXPJI9cDwfV9hpugLvpaCZd0BMBbhU1B1W6kOfX0BE15qX/HQfA==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-link": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-3.27.1.tgz",
- "integrity": "sha512-/2jBfsxBZUDGJmpZifqRQPz7f1E5qpS1BckTZ39TADzUJX+feKy7RJ3DtQ02+8y6SSMzvP9loGVjrk6zEMTk4g==",
- "license": "MIT",
- "dependencies": {
- "linkifyjs": "^4.3.3"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-list": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-list/-/extension-list-3.27.1.tgz",
- "integrity": "sha512-c2Upru7lj0/ZV/Ibww6cNz6sUS8m6Dp/9uygFhYcZOd3X8M0xBIEk42c6m6SQehkPziVA8QOgNJz7sMqsbz1OQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-list-item": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-3.27.1.tgz",
- "integrity": "sha512-zwRl01ETfCkWUvtvK5fw9bXtAajMPkvlkE3Cq6JvH3LF7XXJwDtNj5Tj7exacMpCaSZmlNc43vFb2rAYnrnwMA==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/extension-list": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-list-keymap": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-list-keymap/-/extension-list-keymap-3.27.1.tgz",
- "integrity": "sha512-OIMZNlzPSO8WRd4ic73Fxckzl4N1tesjjLL2XApaNA/uMpO0LoF6WSRPAWv+Z24Wp92ARRJAnRP7iZoI5+Jxig==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/extension-list": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-ordered-list": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-3.27.1.tgz",
- "integrity": "sha512-GYrKqD//9nHJ2r80uXqbDMzRnFpGzbaEQRTSGaO/SH7DvXWFMow8evkOdjQ7PCQO07jNjJo75+A85Jwu3Ov3AA==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/extension-list": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-paragraph": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-3.27.1.tgz",
- "integrity": "sha512-7K7eo1gruOgAsnbK+GCV23AUVUI0cL1bTig8HaPneoFMVbig7vddk8jNLKBWO8TXVbG7TuHdnDN4F98vdtwh5Q==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-strike": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-3.27.1.tgz",
- "integrity": "sha512-Y3DW1jlSlCNCyMGHP3+3qBNNPS83wuFz4RTYGjZtvRRTCRh7apZme9XRWMq1rN5mJ2Cr7fKocA2/5Bs13KgN6Q==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-text": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-3.27.1.tgz",
- "integrity": "sha512-6ZwaZwSrDh+KFFv6V1J79oO37yPs7y1bFxvk1/9Ih2rn3Xr5AWz+eMS+n8RpH3djBVVAQpdIAeYQgcn+VCSsTg==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-text-style": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-3.27.1.tgz",
- "integrity": "sha512-J48WIl+6YDYTFPhWXUBQk+u7+AKVUqTdvrZOQyPYCGuQMgHrYzgWrI5+HeEifUgXJ5rMIWWP3qytp7KhVVqpDQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extension-underline": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-3.27.1.tgz",
- "integrity": "sha512-N889J4nXN/TPfVt8uF9N1A0SY82E90zwc1y26lqOcw6KWNLmQrlhMh/9OD4ikLDbekmFpOBq/UicpHf/6S8hbQ==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1"
- }
- },
- "node_modules/@tiptap/extensions": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/extensions/-/extensions-3.27.1.tgz",
- "integrity": "sha512-1Tdx9faw8k0/83V6X+xCDVhV8yElGt95JxeW3YMkKQJI56QdlPz0xOdJPlMiSGJKinPyVier+x9LJD/YZUZIaw==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1"
- }
- },
- "node_modules/@tiptap/pm": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.27.1.tgz",
- "integrity": "sha512-Ffjx+vimmBU7zH/KrpXzJid3+pziCe/VL2aexSTP63cyQwKQ65LkFkCKaIsSpFdQQuakVZBGWjCA5RoBV852pw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-changeset": "^2.3.0",
- "prosemirror-commands": "^1.6.2",
- "prosemirror-dropcursor": "^1.8.1",
- "prosemirror-gapcursor": "^1.3.2",
- "prosemirror-history": "^1.4.1",
- "prosemirror-inputrules": "^1.4.0",
- "prosemirror-keymap": "^1.2.3",
- "prosemirror-model": "^1.25.7",
- "prosemirror-schema-list": "^1.5.0",
- "prosemirror-state": "^1.4.4",
- "prosemirror-tables": "^1.8.0",
- "prosemirror-transform": "^1.12.0",
- "prosemirror-view": "^1.41.8"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- }
- },
- "node_modules/@tiptap/react": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/react/-/react-3.27.1.tgz",
- "integrity": "sha512-/Wn2fc9zMtX08MXYScDFsm4wJ8lzfhfPEdbtls7WCDlbtrop48PWlkHDBBJrywARfAQTB2mFs9KiFy9yrQm5Lg==",
- "license": "MIT",
- "dependencies": {
- "@types/use-sync-external-store": "^0.0.6",
- "fast-equals": "^5.3.3",
- "use-sync-external-store": "^1.4.0"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- },
- "optionalDependencies": {
- "@tiptap/extension-bubble-menu": "^3.27.1",
- "@tiptap/extension-floating-menu": "^3.27.1"
- },
- "peerDependencies": {
- "@tiptap/core": "3.27.1",
- "@tiptap/pm": "3.27.1",
- "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0",
- "@types/react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0",
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
- }
- },
- "node_modules/@tiptap/starter-kit": {
- "version": "3.27.1",
- "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-3.27.1.tgz",
- "integrity": "sha512-vfxRsqW8rCc0k4pzo0ilU3wobVi2wqVj88VZI2SlgZlNnUAkrDGDIAph7CTa9k9fshV+O1ivpEgPC5yC046jow==",
- "license": "MIT",
- "dependencies": {
- "@tiptap/core": "^3.27.1",
- "@tiptap/extension-blockquote": "^3.27.1",
- "@tiptap/extension-bold": "^3.27.1",
- "@tiptap/extension-bullet-list": "^3.27.1",
- "@tiptap/extension-code": "^3.27.1",
- "@tiptap/extension-code-block": "^3.27.1",
- "@tiptap/extension-document": "^3.27.1",
- "@tiptap/extension-dropcursor": "^3.27.1",
- "@tiptap/extension-gapcursor": "^3.27.1",
- "@tiptap/extension-hard-break": "^3.27.1",
- "@tiptap/extension-heading": "^3.27.1",
- "@tiptap/extension-horizontal-rule": "^3.27.1",
- "@tiptap/extension-italic": "^3.27.1",
- "@tiptap/extension-link": "^3.27.1",
- "@tiptap/extension-list": "^3.27.1",
- "@tiptap/extension-list-item": "^3.27.1",
- "@tiptap/extension-list-keymap": "^3.27.1",
- "@tiptap/extension-ordered-list": "^3.27.1",
- "@tiptap/extension-paragraph": "^3.27.1",
- "@tiptap/extension-strike": "^3.27.1",
- "@tiptap/extension-text": "^3.27.1",
- "@tiptap/extension-underline": "^3.27.1",
- "@tiptap/extensions": "^3.27.1",
- "@tiptap/pm": "^3.27.1"
- },
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/ueberdosis"
- }
- },
"node_modules/@types/aria-query": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
@@ -4541,12 +4096,14 @@
"version": "15.7.15",
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz",
"integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==",
+ "devOptional": true,
"license": "MIT"
},
"node_modules/@types/react": {
"version": "18.3.28",
"resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.28.tgz",
"integrity": "sha512-z9VXpC7MWrhfWipitjNdgCauoMLRdIILQsAEV+ZesIzBq/oUlxk0m3ApZuMFCXdnS4U7KrI+l3WRUEGQ8K1QKw==",
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@types/prop-types": "*",
@@ -4557,6 +4114,7 @@
"version": "18.3.7",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz",
"integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==",
+ "devOptional": true,
"license": "MIT",
"peerDependencies": {
"@types/react": "^18.0.0"
@@ -4572,12 +4130,6 @@
"@types/node": "*"
}
},
- "node_modules/@types/use-sync-external-store": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz",
- "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==",
- "license": "MIT"
- },
"node_modules/@types/verror": {
"version": "1.10.11",
"resolved": "https://registry.npmjs.org/@types/verror/-/verror-1.10.11.tgz",
@@ -6318,6 +5870,7 @@
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
+ "devOptional": true,
"license": "MIT"
},
"node_modules/data-urls": {
@@ -7235,15 +6788,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/fast-equals": {
- "version": "5.4.0",
- "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.4.0.tgz",
- "integrity": "sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw==",
- "license": "MIT",
- "engines": {
- "node": ">=6.0.0"
- }
- },
"node_modules/fast-fifo": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
@@ -8362,12 +7906,6 @@
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"license": "MIT"
},
- "node_modules/linkifyjs": {
- "version": "4.3.3",
- "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.3.tgz",
- "integrity": "sha512-P8aEP5U/D1/IlTY2OeYsErdwh9bGuLE30NcXtKEjgdHcahveQoQwM2yZNsioQHsWFz0P7KKudisbrzCgR0sDHg==",
- "license": "MIT"
- },
"node_modules/lint-staged": {
"version": "16.4.0",
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.4.0.tgz",
@@ -9266,12 +8804,6 @@
"platform": "^1.3.6"
}
},
- "node_modules/orderedmap": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.1.1.tgz",
- "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==",
- "license": "MIT"
- },
"node_modules/p-cancelable": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz",
@@ -9861,145 +9393,6 @@
"signal-exit": "^3.0.2"
}
},
- "node_modules/prosemirror-changeset": {
- "version": "2.4.1",
- "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.4.1.tgz",
- "integrity": "sha512-96WBLhOaYhJ+kPhLg3uW359Tz6I/MfcrQfL4EGv4SrcqKEMC1gmoGrXHecPE8eOwTVCJ4IwgfzM8fFad25wNfw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-transform": "^1.0.0"
- }
- },
- "node_modules/prosemirror-commands": {
- "version": "1.7.1",
- "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz",
- "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-model": "^1.0.0",
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.10.2"
- }
- },
- "node_modules/prosemirror-dropcursor": {
- "version": "1.8.2",
- "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.2.tgz",
- "integrity": "sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.1.0",
- "prosemirror-view": "^1.1.0"
- }
- },
- "node_modules/prosemirror-gapcursor": {
- "version": "1.4.1",
- "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.1.tgz",
- "integrity": "sha512-pMdYaEnjNMSwl11yjEGtgTmLkR08m/Vl+Jj443167p9eB3HVQKhYCc4gmHVDsLPODfZfjr/MmirsdyZziXbQKw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-keymap": "^1.0.0",
- "prosemirror-model": "^1.0.0",
- "prosemirror-state": "^1.0.0",
- "prosemirror-view": "^1.0.0"
- }
- },
- "node_modules/prosemirror-history": {
- "version": "1.5.0",
- "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.5.0.tgz",
- "integrity": "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-state": "^1.2.2",
- "prosemirror-transform": "^1.0.0",
- "prosemirror-view": "^1.31.0",
- "rope-sequence": "^1.3.0"
- }
- },
- "node_modules/prosemirror-inputrules": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz",
- "integrity": "sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.0.0"
- }
- },
- "node_modules/prosemirror-keymap": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz",
- "integrity": "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-state": "^1.0.0",
- "w3c-keyname": "^2.2.0"
- }
- },
- "node_modules/prosemirror-model": {
- "version": "1.25.9",
- "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.9.tgz",
- "integrity": "sha512-pRTklkDDMMRopyoAcrr9wV/8g/RYgrLHBuJAb5hlEuYZRdm5yqmPjWId83fpBwPpSFqEdja0H7Dfd7z1X/npcA==",
- "license": "MIT",
- "dependencies": {
- "orderedmap": "^2.0.0"
- }
- },
- "node_modules/prosemirror-schema-list": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz",
- "integrity": "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-model": "^1.0.0",
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.7.3"
- }
- },
- "node_modules/prosemirror-state": {
- "version": "1.4.4",
- "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.4.tgz",
- "integrity": "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-model": "^1.0.0",
- "prosemirror-transform": "^1.0.0",
- "prosemirror-view": "^1.27.0"
- }
- },
- "node_modules/prosemirror-tables": {
- "version": "1.8.5",
- "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.8.5.tgz",
- "integrity": "sha512-V/0cDCsHKHe/tfWkeCmthNUcEp1IVO3p6vwN8XtwE9PZQLAZJigbw3QoraAdfJPir4NKJtNvOB8oYGKRl+t0Dw==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-keymap": "^1.2.3",
- "prosemirror-model": "^1.25.4",
- "prosemirror-state": "^1.4.4",
- "prosemirror-transform": "^1.10.5",
- "prosemirror-view": "^1.41.4"
- }
- },
- "node_modules/prosemirror-transform": {
- "version": "1.12.0",
- "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.12.0.tgz",
- "integrity": "sha512-GxboyN4AMIsoHNtz5uf2r2Ru551i5hWeCMD6E2Ib4Eogqoub0NflniaBPVQ4MrGE5yZ8JV9tUHg9qcZTTrcN4w==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-model": "^1.21.0"
- }
- },
- "node_modules/prosemirror-view": {
- "version": "1.42.0",
- "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.42.0.tgz",
- "integrity": "sha512-N54DF3OXNWDuP81G1kbfCys8ZzIjuL1VnvJ2mk5STSu/fNxWIcX/EutQLA3s9KR/2wVhgDi4hzBB/1fINVxk0A==",
- "license": "MIT",
- "dependencies": {
- "prosemirror-model": "^1.25.8",
- "prosemirror-state": "^1.0.0",
- "prosemirror-transform": "^1.1.0"
- }
- },
"node_modules/protobufjs": {
"version": "6.11.6",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.6.tgz",
@@ -10598,12 +9991,6 @@
"fsevents": "~2.3.2"
}
},
- "node_modules/rope-sequence": {
- "version": "1.3.4",
- "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz",
- "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==",
- "license": "MIT"
- },
"node_modules/run-parallel": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
@@ -11910,15 +11297,6 @@
}
}
},
- "node_modules/use-sync-external-store": {
- "version": "1.6.0",
- "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.6.0.tgz",
- "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==",
- "license": "MIT",
- "peerDependencies": {
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
- }
- },
"node_modules/utf8-byte-length": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz",
@@ -12163,12 +11541,6 @@
}
}
},
- "node_modules/w3c-keyname": {
- "version": "2.2.8",
- "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
- "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
- "license": "MIT"
- },
"node_modules/w3c-xmlserializer": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz",
diff --git a/src/components/ai-edition/NewEditorShell.module.css b/src/components/ai-edition/NewEditorShell.module.css
index 6c53184ec..61618f4fa 100644
--- a/src/components/ai-edition/NewEditorShell.module.css
+++ b/src/components/ai-edition/NewEditorShell.module.css
@@ -1618,7 +1618,7 @@
/* Custom range slider / progress bar */
.scrubBar {
flex: 1;
- max-width: 400px;
+ min-width: 0;
position: relative;
height: 24px;
display: flex;
@@ -1659,10 +1659,9 @@
pointer-events: none;
transform: translate(-50%, -50%);
top: 50%;
- opacity: 0;
- transition: transform 100ms ease, opacity 100ms ease;
+ opacity: 1;
+ transition: transform 100ms ease;
}
.scrubBar:hover .scrubThumb {
- opacity: 1;
transform: translate(-50%, -50%) scale(1.2);
}
diff --git a/src/components/ai-edition/Preview.tsx b/src/components/ai-edition/Preview.tsx
index c79329ace..e8cfba1e1 100644
--- a/src/components/ai-edition/Preview.tsx
+++ b/src/components/ai-edition/Preview.tsx
@@ -220,7 +220,15 @@ export function Preview({
(acc, c) => acc + (c.timelineEndSec - c.timelineStartSec),
0,
);
- const progress = virtualDurationSec ? (currentTimeSec / virtualDurationSec) * 100 : 0;
+ // ponytail: the input clamps value to [0, virtualDurationSec || 1]
+ // so the drag range is meaningful when no clip exists. Use the
+ // same clamp for the visual thumb's `left` so the CSS thumb
+ // and the native range thumb stay in sync (otherwise the CSS
+ // thumb is stuck at 0% when virtualDurationSec is 0, while the
+ // native thumb follows the input).
+ const inputMax = virtualDurationSec || 1;
+ const inputValue = Math.min(Math.max(currentTimeSec, 0), inputMax);
+ const progress = (inputValue / inputMax) * 100;
return (
<>
<span className={styles.time}>
@@ -235,9 +243,9 @@ export function Preview({
<input
type="range"
min={0}
- max={virtualDurationSec || 1}
+ max={inputMax}
step={0.01}
- value={Math.min(currentTimeSec, virtualDurationSec || 1)}
+ value={inputValue}
onChange={(e) => {
onSeek(Number(e.target.value));
}}
diff --git a/src/components/ai-edition/VirtualPreview.tsx b/src/components/ai-edition/VirtualPreview.tsx
index 92f01147b..a7d4fb113 100644
--- a/src/components/ai-edition/VirtualPreview.tsx
+++ b/src/components/ai-edition/VirtualPreview.tsx
@@ -51,21 +51,102 @@ export function VirtualPreview({
// ponytail: the cursor overlay wants source-media time (the recorded
// cursor samples live on the original mp4 timeline, not the edited
- // virtual timeline). Read `video.currentTime` every animation frame so
- // the cursor follows the playhead even when the user scrubs.
+ // virtual timeline). `setSourceTimeSec` is called from the 60 Hz rAF
+ // below so the cursor follows the playhead even when the user scrubs.
const [sourceTimeSec, setSourceTimeSec] = useState(0);
- // biome-ignore lint/correctness/useExhaustiveDependencies: re-run when the active source swaps so the rAF reads from the new <video>.
+
+ // Drive the virtual-time preview clock at 60 Hz (the <video> timeupdate
+ // event only fires ~4×/s, which is too slow to keep the webcam <video>
+ // and any future audio element in sync — a 4 Hz sync lets the webcam
+ // drift up to ~250 ms between corrections and produces a visible
+ // audio/video desync). The virtual-time read here mirrors what
+ // handleTimeUpdate does on every timeupdate; running it 60×/s keeps
+ // the drift under a single frame (~16 ms). Inlined here so the rAF
+ // can also handle clip-end advancement and the !position fall-back
+ // without a separate <video onTimeUpdate> event firing at ~4 Hz.
+ const sourceTimeSecRef = useRef(0);
+ sourceTimeSecRef.current = sourceTimeSec;
+ // ponytail: the rAF closure captured the props at mount time. The
+ // auto-created clip arrives a tick after the source swaps, so reads
+ // from the closure would forever see `clips: []` and the rAF would
+ // bail at the `clips.length === 0` guard — leaving the scrub thumb
+ // stuck at 0% and the drag range at `max=1`. The refs let the rAF
+ // always see the latest values without re-creating on every clip
+ // mutation.
+ const clipsRef = useRef(clips);
+ clipsRef.current = clips;
+ const videoSourcesRef = useRef(videoSources);
+ videoSourcesRef.current = videoSources;
+ const sourceIndexRef = useRef(sourceIndex);
+ sourceIndexRef.current = sourceIndex;
+ const virtualTimeSecRef = useRef(virtualTimeSec);
+ virtualTimeSecRef.current = virtualTimeSec;
+ const virtualDurationSecRef = useRef(virtualDurationSec);
+ virtualDurationSecRef.current = virtualDurationSec;
+ // biome-ignore lint/correctness/useExhaustiveDependencies: re-create the rAF when the active source swaps.
useEffect(() => {
let raf = 0;
const tick = () => {
+ raf = window.requestAnimationFrame(tick);
const v = videoRef.current;
- if (v && Number.isFinite(v.currentTime)) {
+ if (!v || !Number.isFinite(v.currentTime)) {
+ return;
+ }
+ const activeSourceId = videoSourcesRef.current[sourceIndexRef.current]?.id;
+ // ponytail: also push setSourceTimeSec every frame (was previously
+ // in a separate rAF effect). Cheap; <video>.readyState >= 2 guards
+ // against drawing a black frame into the cursor overlay.
+ if (v.readyState >= 2) {
setSourceTimeSec(v.currentTime);
}
- raf = window.requestAnimationFrame(tick);
+ if (clipsRef.current.length === 0) {
+ // ponytail: no clip yet (auto-create runs from
+ // handleLoadedMetadata on the next tick). Push the raw
+ // source time as the virtual time so the scrub thumb
+ // advances and the timecode shows real progress during
+ // playback. The proper timeline-aware mapping kicks in
+ // when the auto-created clip arrives.
+ updateVirtualTime(v.currentTime);
+ return;
+ }
+ if (isProgrammaticSeekRef.current) {
+ isProgrammaticSeekRef.current = false;
+ const pos = locateSourcePosition(clipsRef.current, v.currentTime, activeSourceId);
+ if (pos) updateVirtualTime(clampVirtualTime(clipsRef.current, pos.virtualTimeSec));
+ return;
+ }
+ const position = locateSourcePosition(clipsRef.current, v.currentTime, activeSourceId);
+ if (!position) {
+ // ponytail: fall back to timeline order so cross-asset / reordered
+ // clips don't keep playing unmapped media.
+ const nextClip = clipsRef.current.find(
+ (clip) => clip.timelineStartSec > virtualTimeSecRef.current + 0.001,
+ );
+ if (nextClip) seekToVirtualTime(nextClip.timelineStartSec, true);
+ else {
+ v.pause();
+ updateVirtualTime(virtualDurationSecRef.current);
+ setIsPlaying(false);
+ }
+ return;
+ }
+ const reachedClipEnd = v.currentTime >= (position.clip.sourceEndSec ?? Infinity) - 0.04;
+ if (reachedClipEnd) {
+ const nextClip = clipsRef.current[position.clipIndex + 1];
+ if (!nextClip) {
+ v.pause();
+ updateVirtualTime(virtualDurationSecRef.current);
+ setIsPlaying(false);
+ return;
+ }
+ seekToVirtualTime(nextClip.timelineStartSec, true);
+ return;
+ }
+ updateVirtualTime(clampVirtualTime(clipsRef.current, position.virtualTimeSec));
};
raf = window.requestAnimationFrame(tick);
return () => window.cancelAnimationFrame(raf);
+ // re-create the rAF when the active source swaps
}, [activeSource?.src]);
// report the video element up; re-notify (and clear) whenever the active
@@ -134,70 +215,6 @@ export function VirtualPreview({
}
}, []);
- const handleTimeUpdate = useCallback(() => {
- const video = videoRef.current;
- if (!video || clips.length === 0) return;
- const activeSourceId = videoSources[sourceIndex]?.id;
- if (isProgrammaticSeekRef.current) {
- isProgrammaticSeekRef.current = false;
- const position = locateSourcePosition(clips, video.currentTime, activeSourceId);
- if (position) {
- updateVirtualTime(clampVirtualTime(clips, position.virtualTimeSec));
- }
- return;
- }
- const position = locateSourcePosition(clips, video.currentTime, activeSourceId);
- if (!position) {
- // ponytail: fall back to timeline order, not same-asset order, so
- // cross-asset / reordered clips don't keep playing unmapped media.
- const nextClip = clips.find((clip) => clip.timelineStartSec > virtualTimeSec + 0.001);
- if (nextClip) {
- seekToVirtualTime(nextClip.timelineStartSec, true);
- } else {
- video.pause();
- updateVirtualTime(virtualDurationSec);
- setIsPlaying(false);
- }
- return;
- }
- const currentClip = position.clip;
- const reachedClipEnd = video.currentTime >= (currentClip.sourceEndSec ?? Infinity) - 0.04;
- if (reachedClipEnd) {
- const nextClip = clips[position.clipIndex + 1];
- if (!nextClip) {
- video.pause();
- updateVirtualTime(virtualDurationSec);
- setIsPlaying(false);
- return;
- }
- seekToVirtualTime(nextClip.timelineStartSec, true);
- return;
- }
- updateVirtualTime(clampVirtualTime(clips, position.virtualTimeSec));
- }, [
- clips,
- seekToVirtualTime,
- updateVirtualTime,
- virtualDurationSec,
- videoSources,
- sourceIndex,
- virtualTimeSec,
- ]);
-
- useEffect(() => {
- const video = videoRef.current;
- setIsPlaying(false);
- updateVirtualTime(0);
- setSourceIndex(0);
- setLoadState(videoSources.length > 0 ? "loading" : "idle");
- if (!video) return;
- video.pause();
- if (clips.length > 0) {
- const start = locateVirtualPosition(clips, 0);
- if (start) video.currentTime = start.sourceTimeSec;
- }
- }, [updateVirtualTime, videoSources, clips.length, clips]);
-
useEffect(() => {
if (!seekTarget) return;
if (seekTarget.isSource) {
@@ -251,7 +268,12 @@ export function VirtualPreview({
onPause={() => setIsPlaying(false)}
onPlay={() => setIsPlaying(true)}
onEnded={() => setIsPlaying(false)}
- onTimeUpdate={handleTimeUpdate}
+ // ponytail: handleTimeUpdate is now driven by the rAF loop
+ // above (60 Hz) instead of the <video> onTimeUpdate event
+ // (~4 Hz) — the 4 Hz sync was too slow to keep the webcam
+ // <video> and any audio in sync. The rAF tick also
+ // handles clip-end advancement, so dropping the event
+ // handler here is safe.
/>
{loadState !== "ready" && (
<div className={styles.overlay}>
diff --git a/src/hooks/recorderHandle.ts b/src/hooks/recorderHandle.ts
index e4c60bfdb..6264b9be5 100644
--- a/src/hooks/recorderHandle.ts
+++ b/src/hooks/recorderHandle.ts
@@ -96,16 +96,10 @@ export function createRecorderHandle(
);
const recordedBlobPromise = new Promise<Blob>((resolve, reject) => {
- let _chunkCount = 0;
- let _totalBytes = 0;
- let firstChunkArrived = false;
recorder.ondataavailable = (event: BlobEvent) => {
if (!event.data || event.data.size === 0) {
return;
}
- _chunkCount += 1;
- _totalBytes += event.data.size;
- firstChunkArrived = true;
if (mode === "streaming") {
enqueueWrite(event.data);
} else {
@@ -121,49 +115,6 @@ export function createRecorderHandle(
recorder.onstop = () => {
resolve(finalizeBlob());
};
-
- // ponytail: watchdog for the encoder-stall failure. Chromium's
- // WebM/H.264 software encoder can silently stop producing output if
- // over-driven (e.g. 4K@60fps with too-high videoBitsPerSecond). The
- // symptom is `ondataavailable` never firing while state stays
- // "recording" and the stream is live. The bitrate cap in
- // useScreenRecorder prevents this in normal use, but the watchdog
- // catches any future regression (different codec, different
- // encoder, etc.). The first chunk clears the timer; stop() also
- // clears it via the recorder.onstop path.
- const watchdogMs = 3000;
- const watchdog = setTimeout(() => {
- if (firstChunkArrived) return;
- if (recorder.state === "inactive") return;
- const err = new Error(
- `Recorder produced no data within ${watchdogMs}ms of start(). ` +
- `State=${recorder.state} mode=${mode} ` +
- `streamActive=${stream.active} ` +
- `videoReadyStates=${stream
- .getVideoTracks()
- .map((t) => t.readyState)
- .join(",")}. ` +
- `This usually means the encoder stalled (over-driven bitrate) or the source stream has no frames.`,
- );
- try {
- if (recorder.state === "recording" || recorder.state === "paused") {
- recorder.stop();
- }
- } catch {
- // already stopped
- }
- reject(err);
- }, watchdogMs);
- const origOnStop = recorder.onstop;
- recorder.onstop = (event: Event) => {
- clearTimeout(watchdog);
- if (origOnStop) (origOnStop as (e: Event) => void)(event);
- };
- const origOnError = recorder.onerror;
- recorder.onerror = (event: Event) => {
- clearTimeout(watchdog);
- if (origOnError) (origOnError as (e: Event) => void)(event);
- };
});
async function finalizeBlob(): Promise<Blob> {
diff --git a/src/hooks/useScreenRecorder.ts b/src/hooks/useScreenRecorder.ts
index c682005cb..72ddc529b 100644
--- a/src/hooks/useScreenRecorder.ts
+++ b/src/hooks/useScreenRecorder.ts
@@ -29,12 +29,6 @@ const BITRATE_QHD = 28_000_000;
const BITRATE_BASE = 18_000_000;
const HIGH_FRAME_RATE_THRESHOLD = 60;
const HIGH_FRAME_RATE_BOOST = 1.7;
-// ponytail: Chromium's WebM/H.264 software encoder silently stalls (no
-// ondataavailable) when the requested videoBitsPerSecond exceeds what it can
-// produce in real time — see recorderHandle.ts watchdog for the symptoms.
-// Cap at 30 Mbps (Netflix 4K HDR is ~25 Mbps) so the encoder is never
-// over-driven, regardless of resolution or frame rate.
-const MAX_BITRATE = 30_000_000;
const DEFAULT_WIDTH = 1920;
const DEFAULT_HEIGHT = 1080;
@@ -162,17 +156,15 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
const highFrameRateBoost =
TARGET_FRAME_RATE >= HIGH_FRAME_RATE_THRESHOLD ? HIGH_FRAME_RATE_BOOST : 1;
- let bitrate: number;
if (pixels >= FOUR_K_PIXELS) {
- bitrate = BITRATE_4K * highFrameRateBoost;
- } else if (pixels >= QHD_PIXELS) {
- bitrate = BITRATE_QHD * highFrameRateBoost;
- } else {
- bitrate = BITRATE_BASE * highFrameRateBoost;
+ return Math.round(BITRATE_4K * highFrameRateBoost);
}
- // ponytail: cap so Chromium's H.264 software encoder doesn't stall on
- // 4K@60fps. See recorderHandle.ts for the failure mode.
- return Math.round(Math.min(bitrate, MAX_BITRATE));
+
+ if (pixels >= QHD_PIXELS) {
+ return Math.round(BITRATE_QHD * highFrameRateBoost);
+ }
+
+ return Math.round(BITRATE_BASE * highFrameRateBoost);
};
const teardownMedia = useCallback(() => {
@@ -398,9 +390,6 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
if (!result.success) {
console.error("Failed to store recording session:", result.message);
- toast.error(result.message ?? "Recording failed to save", {
- description: "Try recording again. If the problem persists, restart the app.",
- });
return;
}
// store-recorded-session has flushed and closed the saved streams.
@@ -1186,18 +1175,12 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
// getDisplayMedia + setDisplayMediaRequestHandler (main.ts) supplies the
// pre-selected source. Editable cursor mode excludes the system cursor so
// the editor can render a replacement; system mode bakes it into the video.
- // ponytail: use `ideal: 1920×1080` so the capture matches the display's
- // physical content (avoiding 4K upscaling on a 1080p display with
- // 200% DPI scaling, which is what was over-driving the H.264 encoder
- // and producing 0-byte files). Cap the max at 1920×1080 so a 4K
- // display also captures at 1080p — keeps bitrate low and the
- // encoder real-time. A higher-res path can be opt-in later.
screenMediaStream = await navigator.mediaDevices.getDisplayMedia({
video: {
cursor: cursorCaptureMode === "editable-overlay" ? "never" : "always",
- width: { ideal: 1920, max: 1920 },
- height: { ideal: 1080, max: 1080 },
- frameRate: { ideal: TARGET_FRAME_RATE, max: TARGET_FRAME_RATE },
+ width: { max: TARGET_WIDTH },
+ height: { max: TARGET_HEIGHT },
+ frameRate: { ideal: TARGET_FRAME_RATE },
} as MediaTrackConstraints,
audio: systemAudioEnabled,
} as DisplayMediaStreamOptions);
@@ -1206,10 +1189,8 @@ export function useScreenRecorder(): UseScreenRecorderReturn {
mandatory: {
chromeMediaSource: CHROME_MEDIA_SOURCE,
chromeMediaSourceId: selectedSource.id,
- // ponytail: see the Windows path — keep the capture at
- // 1080p so the H.264 encoder can keep up in real time.
- maxWidth: 1920,
- maxHeight: 1080,
+ maxWidth: TARGET_WIDTH,
+ maxHeight: TARGET_HEIGHT,
maxFrameRate: TARGET_FRAME_RATE,
minFrameRate: MIN_FRAME_RATE,
},