Media elements video and audio no longer transferred via service worker
Categories
(Core :: DOM: Service Workers, defect)
Tracking
()
People
(Reporter: gertjanal, Unassigned)
Details
Attachments
(1 file)
38.37 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0
Steps to reproduce:
My server is hosting a video file at endpoint /datastream
<video src="https://server.com/datastream"></video>
A serviceworker is registered;
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register(`./service-worker.js`, {
scope: './'
});
}
The service worker intercepts all fetch requests and logs to console for debug
self.addEventListener('install', (event) => {
event.waitUntil(self.skipWaiting());
});
self.addEventListener('activate', (event) => {
event.waitUntil(self.clients.claim());
});
self.addEventListener('fetch', function(event) {
console.log(`${event.request.destination}: ${event.request.url}`);
event.respondWith(fetch(event.request));
});
Actual results:
Until recently, the video and audio elements were passed through this service worker. (In my case, adding additional request headers for security).
Now being in version 110, customers complained that the video element was no longer working. It seems that the request is no longer passed through the service worker. In Google Chrome, this behavior is still as expected.
Note: in the same webpage, I added a piece of js to fetch the same data url. That js request was intercepted by the service worker, so it doesn't seem to be a problem with the server.
Expected results:
I expect all document calls to pass through the service worker, as it used to do before.
Updated•2 years ago
|
Probably a duplicate of bug 1803205.
Reporter | ||
Comment 3•2 years ago
|
||
(In reply to Tom S [:evilpie] from comment #1)
Probably a duplicate of bug 1803205.
Yes, it looks like it is the same issue
Reporter | ||
Comment 4•2 years ago
|
||
Adding crossorigin="use-credentials"
to the <video>
element fixed the problem
Reporter | ||
Updated•2 years ago
|
Updated•2 years ago
|
Description
•