Closed Bug 1334564 Opened 3 years ago Closed 3 years ago

Deprecate URL.createObjectURL(mediastream)

Categories

(Core :: DOM: Core & HTML, defect)

45 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla54
Tracking Status
firefox54 --- fixed

People

(Reporter: jesup, Assigned: baku)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete, site-compat, Whiteboard: [spec])

Attachments

(1 file, 2 obsolete files)

Per https://github.com/w3c/mediacapture-main/issues/404 we've agreed in the MediaCapture WG to not bring back createObjectURL(stream) - it's been removed from the spec since 2013.  We, Chrome and Microsoft Edge are all in agreement to deprecate and remove the implementations.

We should start with warnings in discuss-webrtc and elsewhere, deprecation warnings, then removal (though we could have it hold in Aurora or Beta for a release or two).
Duplicate of this bug: 1336016
Attached patch media_deprecate.patch (obsolete) — Splinter Review
I cannot just use [Deprecated=..] in webidl because this method has many overloads (Blob/MediaStream/MediaSource) and, having only 1 of them deprecated is not supported by our codegen.
Assignee: nobody → amarchesini
Attachment #8832851 - Flags: review?(bugs)
Attached patch media_deprecate.patch (obsolete) — Splinter Review
Attachment #8832851 - Attachment is obsolete: true
Attachment #8832851 - Flags: review?(bugs)
Attachment #8832852 - Flags: review?(bugs)
Attachment #8832852 - Flags: review?(bugs) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/95fe30082f2c
Deprecate URL.createObjectURL(mediastream), r=smaug
Backed out for mochitest failure:

https://hg.mozilla.org/integration/mozilla-inbound/rev/cc3e830547b342287f1f56b79c215b0a0125a7e9

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=bfaa720977d27855278f1c1985636ea9f76d3cb4
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=73920864&repo=mozilla-inbound

[task 2017-02-02T15:36:19.165181Z] 15:36:19     INFO - TEST-UNEXPECTED-FAIL | dom/bindings/test/test_exception_messages.html | Correct exception should be thrown for overload resolution failure - got "Argument 1 is not valid for any of the 1-argument overloads of URL.createObjectURL.", expected "Argument 1 is not valid for any of the 2-argument overloads of URL.createObjectURL."
[task 2017-02-02T15:36:19.166963Z] 15:36:19     INFO -     SimpleTest.is@SimpleTest/SimpleTest.js:271:5
[task 2017-02-02T15:36:19.168665Z] 15:36:19     INFO -     @dom/bindings/test/test_exception_messages.html:67:11
Flags: needinfo?(amarchesini)
Comment on attachment 8832852 [details] [diff] [review]
media_deprecate.patch

Review of attachment 8832852 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/locales/en-US/chrome/dom/dom.properties
@@ +321,5 @@
>  GeolocationInsecureRequestIsForbidden=A Geolocation request can only be fulfilled in a secure context.
>  # LOCALIZATION NOTE: Do not translate "Large-Allocation", as it is a literal header name.
>  LargeAllocationNonWin32=This page would be loaded in a new process due to a Large-Allocation header, however Large-Allocation process creation is disabled on non-Win32 platforms.
> +# LOCALIZATION NOTE: Do not translate URL.createObjectURL(MediaSource).
> +URLCreateObjectURL_MediaSource=URL.createObjectURL(MediaSource) is deprecated and will be removed soon.

s/MediaSource/MediaStream/

It is URL.createObjectURL(MediaStream) that is being deprecated, not URL.createObjectURL(MediaSource).

Deprecating URL.createObjectURL(MediaSource) is blocked on bug 886194.
Attachment #8832852 - Flags: review+ → review-
I'm about to write the site compatibility doc but apparently my own app [1] is also affected. Is there any workaround for this?

[1] https://github.com/bzdeck/bzdeck/blob/master/webroot/static/scripts/views/login-form.js#L145
Keywords: site-compat
Ah okay,

> $video.src = URL.createObjectURL(stream);

can be simply replaced with

> $video.srcObject = stream;

as https://w3c.github.io/mediacapture-main/#examples shows.
Attachment #8832852 - Attachment is obsolete: true
Flags: needinfo?(amarchesini)
Attachment #8833214 - Flags: review?(jib)
(In reply to Kohei Yoshino [:kohei] from comment #12)
> Posted the site compatibility doc:
> https://www.fxsitecompat.com/en-CA/docs/2017/url-createobjecturl-stream-has-
> been-deprecated/

> HTMLMediaElement.prototype.srcObject property can still be used

I'd say "should be used"
Flags: needinfo?(kohei.yoshino)
Thanks :jesup, modified the doc accordingly.
Flags: needinfo?(kohei.yoshino)
Attachment #8833214 - Flags: review?(jib) → review?(rjesup)
Comment on attachment 8833214 [details] [diff] [review]
media_deprecate.patch

Review of attachment 8833214 [details] [diff] [review]:
-----------------------------------------------------------------

r+, though I'm not a DOM reviewer/peer
Attachment #8833214 - Flags: review?(rjesup) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d7fce1fab83
Deprecate URL.createObjectURL(mediastream), r=smaug, r=rjesup
https://hg.mozilla.org/mozilla-central/rev/3d7fce1fab83
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
I have documented this change on MDN, by first of all making sure it is adequately covered on the createObjectURL() page:

https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL

And second by making sure a note has been added to the Fx54 release notes:

https://developer.mozilla.org/en-US/Firefox/Releases/54#Media

Let me know if this looks OK. Thanks!
Depends on: 1369698
Fixing the misleading summary. As far as I read, it's just deprecated in Firefox 54 so the MDN docs aren't correct.
Flags: needinfo?(cmills)
Summary: Deprecate and remove URL.createObjectURL(mediastream) → Deprecate URL.createObjectURL(mediastream)
(In reply to Kohei Yoshino [:kohei] from comment #20)
> Fixing the misleading summary. As far as I read, it's just deprecated in
> Firefox 54 so the MDN docs aren't correct.

Damn, I misunderstood that one ;-)

I've fixed the docs accordingly:

https://developer.mozilla.org/en-US/Firefox/Releases/54#Media_Capture_and_Streams_API
https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
Flags: needinfo?(cmills)
Hi,

Despite the deprecation, there is a bug and the console won't show a warning when using createObjectURL. :padenot submitted a patch but it has been marked as "won't fix" for FF54 https://bugzilla.mozilla.org/show_bug.cgi?id=1369698
 
I wonder whether we should reword the release notes.
Blocks: 1454889
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.