|
| 1 | +# Storebaelt Phase 2A Live Playback Reconnaissance |
| 2 | + |
| 3 | +**Date:** 2026-06-03 |
| 4 | +**Scope:** Validate the cheapest live-video paths before building backend HLS lease/frame extraction services. |
| 5 | + |
| 6 | +## Summary |
| 7 | + |
| 8 | +The Storebaelt player and HLS source are usable enough that Explorer should try a direct live UX before any server-side frame extraction work. |
| 9 | + |
| 10 | +Recommended next implementation path: |
| 11 | + |
| 12 | +1. Add an Explorer `Open Live Video` modal/panel that embeds the Storebaelt player page in an iframe. |
| 13 | +2. Keep the current external `Open Live Video` link as fallback. |
| 14 | +3. Treat direct HLS playback with `hls.js` as the next option if we want a fully native in-card player. |
| 15 | +4. Defer backend HLS frame extraction until direct iframe/player and browser HLS options are proven insufficient. |
| 16 | + |
| 17 | +## Tested Source Surfaces |
| 18 | + |
| 19 | +| Camera | Player page | HLS playlist | Poster JPEG | |
| 20 | +| --- | --- | --- | --- | |
| 21 | +| Storebaelt Tower | `https://player.sob.m-dn.net/sb1-live.html` | `https://stream.sob.m-dn.net/live/sb1/index.m3u8` | `https://stream.sob.m-dn.net/res/sb1-live.jpg` | |
| 22 | +| Sprogo | `https://player.sob.m-dn.net/sb2-live.html` | `https://stream.sob.m-dn.net/live/sb2/index.m3u8` | `https://stream.sob.m-dn.net/res/sb2-live.jpg` | |
| 23 | + |
| 24 | +Player page source confirms that the poster image and live stream are separate resources: |
| 25 | + |
| 26 | +```html |
| 27 | +<video poster="//stream.sob.m-dn.net/res/sb1-live.jpg"> |
| 28 | + <source src="//stream.sob.m-dn.net/live/sb1/index.m3u8" type="application/vnd.apple.mpegurl"> |
| 29 | +</video> |
| 30 | +``` |
| 31 | + |
| 32 | +The same structure exists for `sb2`. |
| 33 | + |
| 34 | +## Header and Browser Findings |
| 35 | + |
| 36 | +### Player pages |
| 37 | + |
| 38 | +Observed headers for `sb1-live.html` and `sb2-live.html`: |
| 39 | + |
| 40 | +- `200 OK` |
| 41 | +- `Content-Type: text/html; charset=UTF-8` |
| 42 | +- `Server: Netlify` |
| 43 | +- No `X-Frame-Options` header observed. |
| 44 | +- No blocking `Content-Security-Policy` frame directive observed in the header probe. |
| 45 | +- JavaScript `fetch()` from `https://ogc-csapi-explorer.pages.dev` is blocked by CORS because the player page does not send `Access-Control-Allow-Origin`. |
| 46 | +- Embedding as an iframe from the Explorer origin loaded successfully in browser testing. |
| 47 | + |
| 48 | +Interpretation: Explorer should not fetch or parse the player page from browser code, but it can likely embed or open it as a live-video surface. |
| 49 | + |
| 50 | +### HLS playlists |
| 51 | + |
| 52 | +Observed headers for `index.m3u8`: |
| 53 | + |
| 54 | +- `200 OK` |
| 55 | +- `Content-Type: application/vnd.apple.mpegurl` |
| 56 | +- `Cache-Control: public, max-age=1` |
| 57 | +- `Server: MDN` |
| 58 | + |
| 59 | +Browser-origin `fetch()` from `https://ogc-csapi-explorer.pages.dev` succeeded for: |
| 60 | + |
| 61 | +- master playlist |
| 62 | +- variant playlist |
| 63 | +- `init.mp4` |
| 64 | +- `.m4s` media segments |
| 65 | + |
| 66 | +Browser fetch result type was `cors`, which means the stream resources are readable by browser-side HLS code. |
| 67 | + |
| 68 | +### Native browser playback |
| 69 | + |
| 70 | +Chromium reported no native support for `application/vnd.apple.mpegurl` / HLS through `video.canPlayType(...)`. |
| 71 | + |
| 72 | +Interpretation: a plain `<video src="...index.m3u8">` should not be relied on for desktop Chromium/Edge. Direct in-card HLS playback would require `hls.js` or equivalent Media Source Extensions support. |
| 73 | + |
| 74 | +## Playlist Shape |
| 75 | + |
| 76 | +The HLS master playlists advertise multiple variants, including: |
| 77 | + |
| 78 | +- 288x162 low-bandwidth variants |
| 79 | +- 416x234 |
| 80 | +- 640x360 |
| 81 | +- 1024x576 |
| 82 | +- 1280x720 |
| 83 | + |
| 84 | +The first variant playlist inspected contained: |
| 85 | + |
| 86 | +- `#EXT-X-TARGETDURATION:6` |
| 87 | +- `#EXT-X-PROGRAM-DATE-TIME`, for example `2026-06-03T22:07:40.239Z` |
| 88 | +- `#EXT-X-MAP:URI="init.mp4"` |
| 89 | +- 6-second `.m4s` segments such as `33097.m4s` |
| 90 | + |
| 91 | +Example segment headers: |
| 92 | + |
| 93 | +- `200 OK` |
| 94 | +- `Content-Type: video/iso.segment` |
| 95 | +- `Cache-Control: public, max-age=120` |
| 96 | + |
| 97 | +## Explorer Dependency Check |
| 98 | + |
| 99 | +`demo/package.json` does not currently include `hls.js` or another HLS playback library. |
| 100 | + |
| 101 | +That means: |
| 102 | + |
| 103 | +- iframe/player modal is the lowest-risk, zero-dependency live UX; |
| 104 | +- direct HLS in a native card player requires adding a new dependency and player lifecycle code; |
| 105 | +- server-side extraction is not justified as the immediate next step. |
| 106 | + |
| 107 | +## Recommended Implementation Decision |
| 108 | + |
| 109 | +### First implementation: iframe/player modal |
| 110 | + |
| 111 | +Add a webcam live-video modal in Explorer: |
| 112 | + |
| 113 | +- Triggered by the existing `Open Live Video` action. |
| 114 | +- Uses `cameraPlayerUrl` as the iframe source. |
| 115 | +- Keeps `target="_blank"` fallback behavior available. |
| 116 | +- Leaves poster freshness visible behind or below the live player. |
| 117 | +- Labels the iframe/live view as provider live video, separate from CSAPI poster status. |
| 118 | + |
| 119 | +Rationale: |
| 120 | + |
| 121 | +- Uses the provider's intended player. |
| 122 | +- Avoids adding `hls.js` immediately. |
| 123 | +- Avoids backend compute and bandwidth. |
| 124 | +- Directly answers the user confusion: the live video can be opened without implying the poster is live. |
| 125 | + |
| 126 | +### Second implementation option: direct HLS with `hls.js` |
| 127 | + |
| 128 | +If iframe UX is not acceptable, add `hls.js` and play `hlsPlaylistUrl` directly in the card or modal. |
| 129 | + |
| 130 | +This is technically plausible because playlists and segments are CORS-readable from Explorer's origin. It would require: |
| 131 | + |
| 132 | +- adding `hls.js` to `demo/package.json`; |
| 133 | +- player lifecycle handling in Vue; |
| 134 | +- choosing quality/ABR defaults; |
| 135 | +- error handling and fallback to player page; |
| 136 | +- possibly adding `hlsPlaylistUrl` to the Storebaelt poster observation payload or deriving it client-side from known camera IDs. |
| 137 | + |
| 138 | +### Defer: backend frame extraction |
| 139 | + |
| 140 | +Server-side HLS frame extraction should remain deferred unless: |
| 141 | + |
| 142 | +- iframe embedding fails operationally; |
| 143 | +- direct HLS playback with `hls.js` fails; |
| 144 | +- CSAPI-native live frame observations become an explicit requirement; |
| 145 | +- we need server-side snapshots for clients that cannot play video. |
| 146 | + |
| 147 | +## Recommended Plan Update |
| 148 | + |
| 149 | +Phase 2 should be split into: |
| 150 | + |
| 151 | +- **Phase 2A:** Browser/player reconnaissance and Explorer iframe live modal. |
| 152 | +- **Phase 2B:** Optional direct HLS prototype with `hls.js`. |
| 153 | +- **Phase 3:** Lease/live status service, without frame extraction by default. |
| 154 | +- **Phase 4:** Backend frame extraction only if the direct live paths are insufficient. |
| 155 | + |
| 156 | +This keeps the live path useful, understandable, and low-cost while preserving the lease architecture for later operational control. |
0 commit comments