openvibers/openvibe.mediahub Commits

Video: Ask your agent on clip pages too (#322)

OP OpenVibers committed 6 days ago · 4f3738e86a · 2 files, +5 −1

Changes

ddiff --git a/server/video/pages.js b/server/video/pages.js
iindex 21343ca..bd31668 100644
---- a/server/video/pages.js
++++ b/server/video/pages.js
@@@ -1513,7 +1513,7 @@ ${clipCredit}
<div class="ovv-head-row">
<div class="ovv-byline"><div class="ovv-byline-text"><span class="ovv-channel-name">${clip.auto_generated ? html`<span class="ovv-tag ovv-tag--inline">AI clip</span> ` : ''}${attribution}</span>
${clip.created_at ? html`<span class="ovv-meta"><time datetime="${clip.created_at}">${dateLabel(clip.created_at)}</time>${manageable ? html` · ${visibilityBadge(clip.visibility)}` : ''}</span>` : ''}</div></div>
--<div class="ovv-actions">${manageable ? editButton('clip') : ''}${fullRecording ? html`<a class="ovv-btn ovv-btn--primary" href="${fullRecording}" title="Watch the recording it was cut from, from this moment"><i class="fa-solid fa-film" aria-hidden="true"></i> Full recording</a>` : ''}${saveForm}${cutting ? '' : downloadMenu({ kind: 'clip', id, item: clip, has: { transcript: segs.length } })}${raw(shareButton({ cls: 'ovv-btn', url: `${base}${watchPath}`, title: clip.title || 'Clip', text: clip.ai_overview || attribution, image: httpsUrl(clip.thumbnail_url) || '', timeFrom: '.ovv-player' }))}${moreItems.length ? actionMenu({ icon: 'fa-solid fa-ellipsis', label: 'More', iconOnly: true, cls: 'ovv-more-menu', body: menuLinks(moreItems) }) : ''}</div>
++<div class="ovv-actions">${manageable ? editButton('clip') : ''}${fullRecording ? html`<a class="ovv-btn ovv-btn--primary" href="${fullRecording}" title="Watch the recording it was cut from, from this moment"><i class="fa-solid fa-film" aria-hidden="true"></i> Full recording</a>` : ''}${saveForm}${cutting ? '' : downloadMenu({ kind: 'clip', id, item: clip, has: { transcript: segs.length } })}${raw(shareButton({ cls: 'ovv-btn', url: `${base}${watchPath}`, title: clip.title || 'Clip', text: clip.ai_overview || attribution, image: httpsUrl(clip.thumbnail_url) || '', timeFrom: '.ovv-player' }))}${raw(askAgent({ text: `About the clip “${clip.title || 'Clip'}” on OpenVibe.Video (${base}${watchPath}): ` }))}${moreItems.length ? actionMenu({ icon: 'fa-solid fa-ellipsis', label: 'More', iconOnly: true, cls: 'ovv-more-menu', body: menuLinks(moreItems) }) : ''}</div>
</div>
</div>
</div>
ddiff --git a/test/video-pages.test.js b/test/video-pages.test.js
iindex 738eaa9..13a4469 100644
---- a/test/video-pages.test.js
++++ b/test/video-pages.test.js
@@@ -392,6 +392,10 @@ function countOccurrences(haystack, needle) {
assert.ok(r.text.includes('data-ovv-view="https://openvibe.live/api/views/clip/201"'), 'playback counts a clip view on Live');
const cld = graphOf(r.text).find((x) => x['@type'] === 'VideoObject');
assert.ok(cld && cld.url === 'https://openvibe.video/c/201', 'a clip VideoObject');
++ // Ask your agent on a clip too (11-07: recordings and uploads had the chip, clips did not).
++ const asks = r.text.match(/<button[^>]*data-ov-ask[^>]*>/g) || [];
++ assert.strictEqual(asks.length, 1, 'one Ask your agent chip on a clip');
++ assert.match(asks[0], /data-ov-ask="About the clip “[^"]+” on OpenVibe\.Video \(https:\/\/openvibe\.video\/[^)]+\): "/);
assert.deepStrictEqual(cld.creator, cld.author);
assert.strictEqual(cld.creator.url, 'https://openvibe.video/@clipper');
assert.strictEqual(cld.isLiveBroadcast, undefined);