Service worker doesn't support seeking in videos
- Linguagem predominante
- TypeScript
- Estrelas
- 101k
- Forks
- 27.5k
- Merge médio
- 1d 19h
- PRs com merge (30d)
- 288
Descrição
## 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 `` 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 : https://github.com/angular/angular/issues/21191
##
_**EDIT(gkalpak):** Issue summary in https://github.com/angular/angular/issues/25865#issuecomment-634048868._
Guia de contribuição
Direção de pesquisa
Reproduza o problema com o elemento mostrado e `ng run app:build:production`, comparando o comportamento em desenvolvimento com os vídeos buscados pelo service worker. Comece rastreando como o service worker de produção lida com vídeos e solicitações Range; o trabalho estará concluído quando a busca pelo `currentTime` solicitado funcionar de forma consistente sem interromper a entrega normal de vídeos.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- angular, typescript
- Domínio
- frontend, web-dev
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100