Service worker doesn't support seeking in videos
- 主要言語
- TypeScript
- スター
- 101k
- フォーク
- 27.5k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 288
説明
## 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._
コントリビューションガイド
調査の方向性
表示されている 要素と `ng run app:build:production` で問題を再現し、開発時の挙動と service worker によって取得された動画を比較します。まず、本番用 service worker が動画と Range リクエストをどのように処理するかを追跡します。通常の動画配信を壊すことなく、要求された `currentTime` へのシークが一貫して機能すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend, web-dev
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100