Update public review service and catalog
Browse files
web-review/service/static/data/worldmodelbench-catalog.js
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
web-review/service/static/review.html
CHANGED
|
@@ -248,7 +248,19 @@
|
|
| 248 |
function safeId(value) { let hash = 0; for (let i = 0; i < value.length; i++) hash = ((hash << 5) - hash) + value.charCodeAt(i) | 0; return Math.abs(hash); }
|
| 249 |
function cardFor(item) {
|
| 250 |
const card = el("article", { className: "review-card" });
|
| 251 |
-
const video = el("video", { controls: "", preload: "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
const body = el("div", { className: "card-body" });
|
| 253 |
const heading = el("div", { className: "sample-heading" }, [el("h3", { text: item.id }), el("span", { className: "draft-state", text: state.drafts[item.videoPath] ? "已保存" : "未标注" })]);
|
| 254 |
body.append(heading, decisionControl(item, card));
|
|
|
|
| 248 |
function safeId(value) { let hash = 0; for (let i = 0; i < value.length; i++) hash = ((hash << 5) - hash) + value.charCodeAt(i) | 0; return Math.abs(hash); }
|
| 249 |
function cardFor(item) {
|
| 250 |
const card = el("article", { className: "review-card" });
|
| 251 |
+
const video = el("video", { controls: "", preload: "metadata", playsinline: "", poster: item.initialFrameUrl || null, src: item.videoUrl });
|
| 252 |
+
// HF's resolve endpoint redirects to a range-capable CDN. Start with
|
| 253 |
+
// metadata so the first frame is available before the user presses
|
| 254 |
+
// play, then promote to auto buffering on explicit interaction.
|
| 255 |
+
video.addEventListener("click", () => {
|
| 256 |
+
if (video.readyState === 0) {
|
| 257 |
+
video.preload = "auto";
|
| 258 |
+
video.load();
|
| 259 |
+
}
|
| 260 |
+
});
|
| 261 |
+
video.addEventListener("error", () => {
|
| 262 |
+
video.title = "视频加载失败;可复制下方路径在 Hugging Face 中打开原视频";
|
| 263 |
+
});
|
| 264 |
const body = el("div", { className: "card-body" });
|
| 265 |
const heading = el("div", { className: "sample-heading" }, [el("h3", { text: item.id }), el("span", { className: "draft-state", text: state.drafts[item.videoPath] ? "已保存" : "未标注" })]);
|
| 266 |
body.append(heading, decisionControl(item, card));
|