-
Notifications
You must be signed in to change notification settings - Fork 27.4k
angular.copy does not support MediaStream object #16055
Comments
use MediaStream clone method to clone mediastream object Closes angular#16055
Based on we can implement a behavior like function copyType(source) {
switch (toString.call(source)) {
// code for other cases
case '[object MediaStream]':
return source;
} Or solving the problem by using That means that the copied I think this the correct behavior is using `MediaStream.clone' function copyType(source) {
switch (toString.call(source)) {
// code for other cases
case '[object MediaStream]':
return source.clone();
} I think using the |
use MediaStream clone method to clone mediastream object Closes angular#16055
use MediaStream clone method to clone mediastream object Closes angular#16055
use MediaStream clone method to clone mediastream object Closes angular#16055
The problem with copying special objects, such as
(1) is more likely to be used by developers in secases where Unfortunately, for (2) using Therefore, I believe it would be better to accept and document that certain objects will not work correctly with |
So you suggest to return a reference of we can implement a behavior like Lodash and Underscore by just return a reference in copyType method function copyType(source) {
switch (toString.call(source)) {
// code for other cases
case '[object MediaStream]':
return source;
} Or you mean leave the old behavior and mention in the documentation that copying |
I am fine with both of these options. Let's see what @Narretz thinks. |
I don't think we return references / do shallow copying for any other type in copy, right? So I'd rather we document that copying MediaStream elements is not supported |
Closes angular#5085 Closes angular#13193 Closes angular#14352 Closes angular#15904 Closes angular#16055 Closes angular#16061 Closes angular#16067
Closes angular#5085 Closes angular#13193 Closes angular#14352 Closes angular#15904 Closes angular#16055 Closes angular#16061 Closes angular#16067
Closes angular#5085 Closes angular#13193 Closes angular#14352 Closes angular#15904 Closes angular#16055 Closes angular#16061 Closes angular#16067
Closes angular#5085 Closes angular#13193 Closes angular#14352 Closes angular#15904 Closes angular#16055 Closes angular#16061 Closes angular#16067
I'm submitting a ...
Current behavior:
angular.copy does not work with (Local)MediaStream objects. This affects the watchability of objects that contain such an object.
Expected / new behavior:
Minimal reproduction of the problem with instructions:
https://plnkr.co/edit/B3LebuAQPoj6kRgS2eCG?p=preview
Angular version: 1.x.y
Browser: [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Anything else:
As always with these things, it's debatable if this needs to be fixed (this is probably not the last built.-in that can't be copied). Lodash's clone implementation works, but is also pretty extensive. Maybe we could take a hint from there.
The text was updated successfully, but these errors were encountered: