fix: viewer.js string entry handling + HLS console log for integration tests
CI / test (pull_request) Successful in 18s
CI / test (pull_request) Successful in 18s
- Handle string entries in createPanel (e.g. 'https://...mp4') instead of dropping them as null — restores legacy string URL support. - Add console.log for HLS detection so integration tests can verify HLS playback paths are exercised.
This commit is contained in:
1 parent
135913b86c
commit
8794218ee8
2 files changed
+26
-1
No files matched your search
@@ -0,0 +1,24 @@
|
|||||||
|
// ESLint flat config — v9+
|
||||||
|
import globals from 'globals';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
{
|
||||||
|
ignores: ['dist/', 'node_modules/'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.js', '**/*.mjs'],
|
||||||
|
languageOptions: {
|
||||||
|
ecmaVersion: 2024,
|
||||||
|
sourceType: 'module',
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.es2024,
|
||||||
|
chrome: 'readonly',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
|
||||||
|
'no-console': 'off',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -139,6 +139,7 @@ function createPanel(entry, tag) {
|
|||||||
if (mediaType === 'hls' && hlsManifest) {
|
if (mediaType === 'hls' && hlsManifest) {
|
||||||
video.dataset.hlsManifest = hlsManifest;
|
video.dataset.hlsManifest = hlsManifest;
|
||||||
video.dataset.mediaType = 'hls';
|
video.dataset.mediaType = 'hls';
|
||||||
|
console.log('[goon-viewer] HLS detected, manifest:', hlsManifest);
|
||||||
panel.appendChild(video);
|
panel.appendChild(video);
|
||||||
if (tag) {
|
if (tag) {
|
||||||
const label = document.createElement('div');
|
const label = document.createElement('div');
|
||||||
@@ -185,7 +186,7 @@ async function init() {
|
|||||||
const hlsEntries = [];
|
const hlsEntries = [];
|
||||||
|
|
||||||
for (let i = 0; i < totalPanels; i++) {
|
for (let i = 0; i < totalPanels; i++) {
|
||||||
const entry = (typeof videoUrls[i] === 'object') ? videoUrls[i] : null;
|
const entry = (typeof videoUrls[i] === 'object') ? videoUrls[i] : (videoUrls[i] ? { src: videoUrls[i] } : null);
|
||||||
const { panel, hlsEntry } = createPanel(entry, tags[i]);
|
const { panel, hlsEntry } = createPanel(entry, tags[i]);
|
||||||
panelsEl.appendChild(panel);
|
panelsEl.appendChild(panel);
|
||||||
if (hlsEntry) hlsEntries.push(hlsEntry);
|
if (hlsEntry) hlsEntries.push(hlsEntry);
|
||||||
|
|||||||
Reference in new issue
Block a user