openvibers/openvibe.mediahub Commits
The small player is given the page's playlist (#377)
Changes
@@@ -186,7 +186,8 @@ function hlsAttrs(item) {const file = fileOf(item);const hls = item.is_recording ? dvrPlaylist(item, file) : httpsUrl(item.hls_url);if (!hls || !file || new URL(hls).origin !== new URL(file).origin) return '';-- return html` data-ovv-hls="${hls}" data-ovv-hls-lib="${asset('vendor/hls.light.min.js')}"`;++ // data-ov-mini-hls: the small player (openvibe-shared mini.js) plays what this page plays, with the file as its fallback.++ return html` data-ovv-hls="${hls}" data-ovv-hls-lib="${asset('vendor/hls.light.min.js')}" data-ov-mini-hls="${hls}"`;}/**@@@ -367,6 +367,7 @@ function countOccurrences(haystack, needle) {assert.ok(Array.isArray(ld.hasPart) && ld.hasPart.length >= 1 && ld.hasPart.every((c) => c['@type'] === 'Clip' && Number.isInteger(c.startOffset) && c.url.startsWith('https://openvibe.video/v/101?t=')), 'chapters as key moments');assert.match(r.text, /<meta property="og:image" content="https:\/\/openvibe\.media\/t\/101\.jpg"/, 'the thumbnail is the share image');assert.ok(r.text.includes('data-ovv-hls="https://openvibe.media/o/med_101/master.m3u8"'), 'the timeline playlist');++ assert.ok(r.text.includes('data-ov-mini-hls="https://openvibe.media/o/med_101/master.m3u8"'), 'and the small player is given the same playlist');assert.ok(/data-ovv-hls-lib="\/vendor\/hls\.light\.min\.js\?v=[0-9a-f]{10}"/.test(r.text), 'hls.js, self-hosted and content-hashed');assert.ok(/media-src[^;]*blob:/.test(String(r.headers['content-security-policy'])), 'MSE plays from blob:');assert.ok(/connect-src[^;]*https:\/\/openvibe\.live/.test(String(r.headers['content-security-policy'])), 'the beacon may reach Live');
@@ -186,7 +186,8 @@ function hlsAttrs(item) {
@@ -186,7 +186,8 @@ function hlsAttrs(item) {
const file = fileOf(item);
const file = fileOf(item);
const hls = item.is_recording ? dvrPlaylist(item, file) : httpsUrl(item.hls_url);
const hls = item.is_recording ? dvrPlaylist(item, file) : httpsUrl(item.hls_url);
if (!hls || !file || new URL(hls).origin !== new URL(file).origin) return '';
if (!hls || !file || new URL(hls).origin !== new URL(file).origin) return '';
- return html` data-ovv-hls="${hls}" data-ovv-hls-lib="${asset('vendor/hls.light.min.js')}"`;
+ // data-ov-mini-hls: the small player (openvibe-shared mini.js) plays what this page plays, with the file as its fallback.
+ return html` data-ovv-hls="${hls}" data-ovv-hls-lib="${asset('vendor/hls.light.min.js')}" data-ov-mini-hls="${hls}"`;
}
}
/**
/**
@@ -367,6 +367,7 @@ function countOccurrences(haystack, needle) {
@@ -367,6 +367,7 @@ function countOccurrences(haystack, needle) {
assert.ok(Array.isArray(ld.hasPart) && ld.hasPart.length >= 1 && ld.hasPart.every((c) => c['@type'] === 'Clip' && Number.isInteger(c.startOffset) && c.url.startsWith('https://openvibe.video/v/101?t=')), 'chapters as key moments');
assert.ok(Array.isArray(ld.hasPart) && ld.hasPart.length >= 1 && ld.hasPart.every((c) => c['@type'] === 'Clip' && Number.isInteger(c.startOffset) && c.url.startsWith('https://openvibe.video/v/101?t=')), 'chapters as key moments');
assert.match(r.text, /<meta property="og:image" content="https:\/\/openvibe\.media\/t\/101\.jpg"/, 'the thumbnail is the share image');
assert.match(r.text, /<meta property="og:image" content="https:\/\/openvibe\.media\/t\/101\.jpg"/, 'the thumbnail is the share image');
assert.ok(r.text.includes('data-ovv-hls="https://openvibe.media/o/med_101/master.m3u8"'), 'the timeline playlist');
assert.ok(r.text.includes('data-ovv-hls="https://openvibe.media/o/med_101/master.m3u8"'), 'the timeline playlist');
+ assert.ok(r.text.includes('data-ov-mini-hls="https://openvibe.media/o/med_101/master.m3u8"'), 'and the small player is given the same playlist');
assert.ok(/data-ovv-hls-lib="\/vendor\/hls\.light\.min\.js\?v=[0-9a-f]{10}"/.test(r.text), 'hls.js, self-hosted and content-hashed');
assert.ok(/data-ovv-hls-lib="\/vendor\/hls\.light\.min\.js\?v=[0-9a-f]{10}"/.test(r.text), 'hls.js, self-hosted and content-hashed');
assert.ok(/media-src[^;]*blob:/.test(String(r.headers['content-security-policy'])), 'MSE plays from blob:');
assert.ok(/media-src[^;]*blob:/.test(String(r.headers['content-security-policy'])), 'MSE plays from blob:');
assert.ok(/connect-src[^;]*https:\/\/openvibe\.live/.test(String(r.headers['content-security-policy'])), 'the beacon may reach Live');
assert.ok(/connect-src[^;]*https:\/\/openvibe\.live/.test(String(r.headers['content-security-policy'])), 'the beacon may reach Live');