-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
32 lines (32 loc) · 1.63 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!doctype html>
<html>
<head>
<title>Service worker and ranged responses</title>
<script>
navigator.serviceWorker.register('sw.js')
</script>
</head>
<body>
<h1>Service worker and ranged responses</h1>
<p><strong>The problem:</strong> Service worker spec does not currently include any way to handle partial content requests ('range' header). When the browser requests a ranged response, Chrome 52 stops playing e.g. audio or video, and may throw errors too.
<p><strong>Work-around:</strong> Manually implement a ranged response during fetch event (based on <a href='https://samdutton.github.io/samples/service-worker/prefetch-video/'>this sample page</a>).
<h2>Test audio</h2>
<p>After the SW has installed and is controlling the page, try randomly moving the play location (while playing the audio), which should trigger a range request in Chrome.
<p>
Served by SW without any range support.
<br>
<audio controls src='audio.mp3'></audio>
</p>
<p>
Served by SW with (limited) range support.
<br>
<audio controls src='audio.mp3?ranged'></audio>
</p>
<h2>Also see</h2>
<ul>
<li><a href='http://stackoverflow.com/questions/37612177/cannot-play-cached-audio-from-service-worker'>http://stackoverflow.com/questions/37612177/cannot-play-cached-audio-from-service-worker</a>
<li><a href='https://github.com/whatwg/fetch/issues/144'>https://github.com/whatwg/fetch/issues/144</a>
<li><a href='https://github.com/slightlyoff/ServiceWorker/issues/703'>https://github.com/slightlyoff/ServiceWorker/issues/703</a>
</ul>
</body>
</html>