Spoof network status for media element
Categories
(Core :: Privacy: Anti-Tracking, enhancement)
Tracking
()
People
(Reporter: fkilic, Assigned: fkilic)
References
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr140+
|
Details | Review |
Creating a new bug to move conversation about RFP from bug 1969210 and attach a patch.
Assignee | ||
Comment 1•2 months ago
•
|
||
but how do we measure the loading behavior? We/TZP still needs to check all methods of obtaining a value. thx
I think this is hard to achieve on client side and without consuming bandwidth. AFAICT, if you use auto instead of metadata, we load "more" video (around 2mb if the video is not playing, but it could be dependent on video's size/length ratio, I don't know).
I tried
<html>
<body>
<video width="320" height="240" id="my_video" controls preload="metadata">
<source src="big_buck_bunny_360p_30mb.mp4" type="video/mp4">
</video>
<script>
const videoElement = document.getElementById("my_video");
videoElement.addEventListener('loadeddata', (e) => {
console.log(videoElement.readyState);
});
</script>
</body>
</html>
and I still got HTMLMediaElement.HAVE_ENOUGH_DATA (4)
, so I'm not sure if it is possible to only get HTMLMediaElement.HAVE_METADATA (1)
.
(there's also loadedmetadata event but this is just to show I was never able to ONLY load the metadata, firefox always loaded some data)
Assignee | ||
Comment 2•2 months ago
|
||
Comment 3•2 months ago
|
||
preload="none" will behave differently.
The behavior with "metadata" depends on network speed and response size.
This can be controlled client side with a ServiceWorker.
readyState
could currently be HAVE_CURRENT_DATA, HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA in the situation of comment 1.
If bug 1969224 were fixed, HAVE_FUTURE_DATA would not happen.
There are other reasons to skip HAVE_CURRENT_DATA too.
Comment 5•2 months ago
|
||
bugherder |
Assignee | ||
Comment 6•2 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D254027
Updated•2 months ago
|
Comment 7•2 months ago
|
||
firefox-esr140 Uplift Approval Request
- User impact if declined: Only affects "Resist Fingerprinting" users' UX. Firefox doesn't support this configuration. We are requesting the uplift for Tor Browser.
- Code covered by automated testing: yes
- Fix verified in Nightly: yes
- Needs manual QE test: no
- Steps to reproduce for manual QE testing: Set
media.preload.default.cellular
,media.preload.default
,media.preload.auto.cellular
,media.preload.auto
to1
. Load any media element withpreload="auto"
and make sureloadeddata
event is fired. Do the same for nopreload
attribute. - Risk associated with taking this patch: None
- Explanation of risk level: N/A
- String changes made/needed: No
- Is Android affected?: yes
Updated•1 month ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Updated•27 days ago
|
Description
•