Description
I'm submitting a...
[x] Bug report
[x] Feature request (not sure, maybe this is more a feature request?)
Current behavior
If you ng run app:build:production
and your pwa comes with a <video>
element where you also utilize seeking (setting currentTime
depending on your app logic and/or user input) it will not work or only very inconsistently. Most videos will simply run from start and not at the setted currentTime
position. This is only the case when videos are delivered/fetched by the service worker. So it works in development mode.
Expected behavior
Videos should start at the setted currentTime
.
Minimal reproduction of the problem with instructions
// on template <video id="myVideo"><source id="myVideoSrc" src="video.mp4" type="video/mp4"></video> // in page.ts let videoObject = document.getElementById("myVideo"); videoObject.currentTime = 100; videoObject.play(); // now build for production // @angular/pwa has to be installed > ng run app:build:production
Environment
Angular version: 6.1.2
Browser:
Chrome (desktop) version 69
Others:
This seems to be a known problem since service workers don't know Range requests. However it also looks like very easily fixable if I understand this thread comment correctly: https://bugs.chromium.org/p/chromium/issues/detail?id=575357#c10
A workaround would be a convenient way to completely exclude requests from service worker (not just set strategies for them). But obviously it would be better if we also could cache some videos. For exclusion also this issue may be relevant : #21191
EDIT(gkalpak): Issue summary in #25865 (comment).