Closed johache closed 8 years ago
muted
and autoplay
does not get reflected in the new element.
The following fixes the issue on Safari, but breaks IE. I think think this is needed for this release, I suggest we get back to it later
AdapterJS.forwardAttributesAndEvents = function (destElem, srcElem, prototype) {
for (var property in srcElem) {
if (srcElem.hasOwnProperty(property)) {
destElem[property] = srcElem[property];
}
}
properties = Object.getOwnPropertyNames( prototype );
for(var prop in properties) {
if (prop) {
propName = properties[prop];
if (typeof(propName.slice) === 'function') {
if (propName.slice(0,2) === 'on' && srcElem[propName] !== null) {
AdapterJS.addEvent(destElem, propName.slice(2), srcElem[propName]);
} else {
try {
destElem[propName] = srcElem[propName];
} catch(e) {
// Some properties are readonly and will throw errors when set
continue;
}
}
}
}
}
var subPrototype = Object.getPrototypeOf(prototype);
if(!!subPrototype) {
AdapterJS.forwardAttributesAndEvents(destElem, srcElem, subPrototype);
}
};
Rebased and corrected Seb's branch
How to test:
video = attachMediaStream(video, stream)