From 8794218ee844fd5130ea1487b992af2bf559a54a Mon Sep 17 00:00:00 2001 From: Hermes QA Date: Wed, 12 Aug 2026 01:59:24 +0000 Subject: [PATCH] fix: viewer.js string entry handling + HLS console log for integration tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- eslint.config.js | 24 ++++++++++++++++++++++++ src/viewer/viewer.js | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 eslint.config.js diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..4a2ae27 --- /dev/null +++ b/eslint.config.js @@ -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', + }, + }, +]; diff --git a/src/viewer/viewer.js b/src/viewer/viewer.js index 84b4e26..7334f6b 100644 --- a/src/viewer/viewer.js +++ b/src/viewer/viewer.js @@ -139,6 +139,7 @@ function createPanel(entry, tag) { if (mediaType === 'hls' && hlsManifest) { video.dataset.hlsManifest = hlsManifest; video.dataset.mediaType = 'hls'; + console.log('[goon-viewer] HLS detected, manifest:', hlsManifest); panel.appendChild(video); if (tag) { const label = document.createElement('div'); @@ -185,7 +186,7 @@ async function init() { const hlsEntries = []; 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]); panelsEl.appendChild(panel); if (hlsEntry) hlsEntries.push(hlsEntry);