Intent to Deprecate: MediaStream ended event and onended attribute

337 megtekintés
Ugrás az első olvasatlan üzenetre

Guido Urdaneta

olvasatlan,
2016. máj. 4. 9:19:272016. 05. 04.
– blink-dev

Primary eng (and PM) emails

Eng: gui...@chromium.org, h...@chromium.org,

PM: bl...@chromium.org


Summary

Deprecate MediaStream ended event


Motivation

The MediaStream ended event and attribute, and onended attribute are not part of the WebRTC spec since 2013. The ended attribute has been replaced with the active attribute and the ended event has been replaced with the active and inactive events. Blink no longer supports the ended attribute, but it still provides some support for the ended event and the corresponding onended attribute.


The support for the ended event in Blink is limited to firing the event the first time all the tracks associated with a MediaStream end. Note that this event does not actually mean that the MediaStream has “ended”, as this concept no longer exists. It is possible for a MediaStream whose tracks have ended (and has thus become inactive) to become active again if a new active MediaStreamTrack is added to the MediaStream. If the MediaStream becomes inactive again, no ended event is fired.


Our plan is to deprecate the ended event in M52 and remove it in M53.


Compatibility Risk

With regards to existing Web sites, the future removal of the MediaStream ended event and onended attribute represents a moderate compatibility risk, as the feature has been supported for several years.

However, the feature is not used much. The onended attribute is used by 0.0007% of pages in the stable channel (M50) according to our use counters. This does not include, however, uses of the ended event using the addEventListener method.


With regards to interoperability with other browser engines, this change will make Blink more compatible with Edge, WebKit and Firefox. Edge[1] and WebKit[2,3] do not support the ended event or attribute. Mozilla’s MDN documentation[4] lists the MediaStream ended attribute and event as deprecated features, and the WebIDL Firefox source code[5] suggests that the ended event or attribute are not supported.


[1] https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/apireference/interfaces/mediastream/

[2] https://trac.webkit.org/browser/trunk/Source/WebCore/Modules/mediastream/MediaStream.idl

[3] https://trac.webkit.org/browser/trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp

[4] https://developer.mozilla.org/en/docs/Web/API/MediaStream

[5] http://mxr.mozilla.org/mozilla-central/source/dom/webidl/MediaStream.webidl


Alternative implementation suggestion for web developers

The functionality previously provided by the ended event and onended attribute is now provided by the inactive event and the oninactive attribute, which are fully supported by Blink.


Usage information from UseCounter

https://www.chromestatus.com/metrics/feature/timeline/popularity/526


OWP launch tracking bug

https://crbug.com/608795


Entry on the feature dashboard

https://www.chromestatus.com/feature/5730404371791872


Requesting approval to remove too?

No


Chris Harrelson

olvasatlan,
2016. máj. 4. 14:48:462016. 05. 04.
– Guido Urdaneta, blink-dev
LGTM1 to deprecate in M52 and remove in M53 (even though you weren't requesting approval
to remove).

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Dimitri Glazkov

olvasatlan,
2016. máj. 4. 14:49:152016. 05. 04.
– Chris Harrelson, Guido Urdaneta, blink-dev
LGTM2

Rick Byers

olvasatlan,
2016. máj. 4. 15:22:582016. 05. 04.
– Dimitri Glazkov, Chris Harrelson, Guido Urdaneta, blink-dev
As part of deprecation, I assume we'll get UseCounter coverage for the addEventListener case, right?

LGTM3 to remove in M53, assuming there are no big surprises from the above UseCounter.  The fact that none of the other engines have this indicates the risk should be very low.

Guido Urdaneta

olvasatlan,
2016. máj. 30. 9:47:392016. 05. 30.
– blink-dev, dgla...@chromium.org, chri...@chromium.org, gui...@chromium.org
Since we started to count usage with addEventListener, the UseCounter jumped to 0.0022% (0.0027% on Windows). 
Is this low enough for removing, or should we extend the deprecation period?

Rick Byers

olvasatlan,
2016. máj. 30. 14:33:572016. 05. 30.
– Guido Urdaneta, blink-dev, Dimitri Glazkov, Chris Harrelson
Ugh, that's tougher to evaluate.  It probably depends how we expect those sites to break in practice.  If ~0.002% of page views were to start failing pretty catastrophically that would be terrible (even extending the deprecation period might not be enough, we might have to add the old API back to the spec indicating that the web really requires it).   But perhaps the breakage is actually much more subtle, or limited to one or two popular libraries/sites which can be updated?

Are you aware of any sites/apps using this?  Can you check a couple popular WebRTC apps/libraries to see if you can find examples?  Eg. if Google Hangouts is using it, then maybe getting that fixed would drop the count dramatically?  If after a little manual searching you don't find any popular sites that hit your use counter, I could try doing a run on the telemetry cluster to search the top 10k sites (though not sure how likely it is people are adding such a listener on page load of their main page).

Rick

Guido Urdaneta

olvasatlan,
2016. jún. 8. 7:49:142016. 06. 08.
– blink-dev, gui...@chromium.org, dgla...@chromium.org, chri...@chromium.org
Hangouts is using this event. 
An internal bug has been filed to migrate to the inactive event.

Rick Byers

olvasatlan,
2016. jún. 9. 11:43:182016. 06. 09.
– Guido Urdaneta, blink-dev, Dimitri Glazkov, Chris Harrelson
Thanks!  Hopefully they will remove usage soon.  If not, we can discuss options.  In other cases we've said we won't let a single property (especially a Google property) hold us back from standards conformance (the real problem with web compat is the long tail, but that's harder to measure when there's one popular site using the API).

Rick

Joe Medley

olvasatlan,
2016. jún. 9. 18:12:512016. 06. 09.
– blink-dev
The active/inactive events were removed form the spec in December. See the Change Log under 'Changes since December 8, 2015'.) They don't seem to have been replaced with anything, at least as far as this spec is concerned. 

Does anyone know if some other spec addresses this?

Rick Byers

olvasatlan,
2016. jún. 10. 12:10:152016. 06. 10.
– Joe Medley, Guido Urdaneta, blink-dev, adam.be...@ericsson.com
Great catch Joe, thanks!  Here's the discussion/commit, +adam-be who drove that.

The advice is that script doesn't need these events because it's script that changes the state of the stream itself. Guido, do you feel that's practical advice based on typical usage?  Eg. I could imagine composition scenarios (one library controlling playback, another responding to it somehow) where this would be awkward.  Should we add a UseCounter to measure usage of them?

For now I think our guidance should encourage developers to not rely on events as the WG agreed, but point out that if necessary there are active/inactive events still supported by some browsers (which?).  If developers are already depending on them, or if there are legitimate scenarios that can't be solved without them, then I assume the WG will just want to add them back to the spec and work through the details of how to define them precisely.

Rick

Guido Urdaneta

olvasatlan,
2016. jún. 11. 3:31:382016. 06. 11.
– Rick Byers, Joe Medley, blink-dev, adam.be...@ericsson.com, Harald Alvestrand
+hta@

I think we should proceed with our plan to remove the ended event, and start tracking usage of the active/inactive events.
I agree with the idea of encouraging users not to rely on these events. WebKit[1] and Edge[2] support the active/inactive events and Firefox[3] was planning to add support, but I guess they are canceling that plan.


Harald Alvestrand

olvasatlan,
2016. jún. 12. 4:27:292016. 06. 12.
– Guido Urdaneta, Harald Alvestrand, Joe Medley, Rick Byers, blink-dev, adam.be...@ericsson.com

Discussion was that applications serious about watching for events would watch the tracks not the stream, and people who really want it can easily synthesize them from track events.

Philip Jägenstedt

olvasatlan,
2016. jún. 13. 9:04:292016. 06. 13.
– Harald Alvestrand, Guido Urdaneta, Harald Alvestrand, Joe Medley, Rick Byers, blink-dev, adam.be...@ericsson.com
Given that 3/4 browser engines supports the active/inactive events, would the WG consider putting them back in the spec? The complexity of supporting it doesn't seem very high, and there's already an active member on MediaStream, changes to which the events would track.

Guido tells me the fix Hangouts was to use the inactive event, so we can be sure without adding use counters that we'll see usage high enough to warrant caution, but without another change to Hangouts we couldn't tell how much usage is coming from elsewhere.

How fast can the WG revisit this? It would be rather bad if we remove the ended event with the existing deprecation message and then decide to remove the active/inactive events as well.

Guido Urdaneta

olvasatlan,
2016. jún. 21. 9:07:542016. 06. 21.
– blink-dev, h...@chromium.org, jme...@google.com, rby...@chromium.org, adam.be...@ericsson.com
What do you think about removing the recommendation to migrate to the inactive event from the deprecation message and deferring the removal to M54?

Harald Alvestrand

olvasatlan,
2016. jún. 21. 9:17:002016. 06. 21.
– Guido Urdaneta, blink-dev, Harald Alvestrand, Joe Medley, Rick Byers, Adam Bergkvist
Deferring the removal and changing the deprecation message seems good.

Philip Jägenstedt

olvasatlan,
2016. jún. 22. 9:31:052016. 06. 22.
– Harald Alvestrand, Guido Urdaneta, blink-dev, Harald Alvestrand, Joe Medley, Rick Byers, Adam Bergkvist
Did anyone (Harald?) raise this issue with the WG? Removing the active/inactive events seems not so great.

Still, I don't think those issues need to be coupled, changing the deprecation message and delaying the removal SGTM.

Philip Jägenstedt

olvasatlan,
2016. jún. 22. 10:19:552016. 06. 22.
– Harald Alvestrand, Guido Urdaneta, blink-dev, Harald Alvestrand, Joe Medley, Rick Byers, Adam Bergkvist

Philip Jägenstedt

olvasatlan,
2016. júl. 7. 5:23:572016. 07. 07.
– Harald Alvestrand, Guido Urdaneta, blink-dev, Harald Alvestrand, Joe Medley, Rick Byers, Adam Bergkvist
https://github.com/w3c/mediacapture-main/issues/370 was closed but it's not at all clear to me how this situation will be resolved. Harald, do you know the relevant people working on Edge, and can you inquire about their plans for the events? For now, I've added a use counter for the active attribute, since removing just the events seems a bit silly.

Harald Alvestrand

olvasatlan,
2016. aug. 2. 3:02:252016. 08. 02.
– Philip Jägenstedt, Guido Urdaneta, blink-dev, Harald Alvestrand, Joe Medley, Rick Byers, Adam Bergkvist
Erik closed as "no consensus to change further" (that is, no consensus to remove the active attribute). The active attribute is clearly defined in terms of the track states, and is rreadonly, so it's not a huge implementation burden.

You see Shijun's comments on the bug - he's the lead on the Edge implementation, so what he says is, by definition, the plan.


Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet