AdapterJS icon indicating copy to clipboard operation
AdapterJS copied to clipboard

attachMedia blows up if video tag doesnt have a parent

Open yocontra opened this issue 8 years ago • 1 comments

var vid = document.createElement('video');
adapterjs.attachMediaStream(vid, stream);

Trying to not show the stream until the video is playing, so I render a dummy video tag in-memory and wait until it is flowing before rendering a real one on the page. This isn't possible with any streams using AdapterJS since it makes a ton of assumptions that the video element is in the DOM and checks for the parent (not sure why this is necessary)

yocontra avatar Aug 14 '15 04:08 yocontra

Hi, Our doc informs you that the element needs to be in the DOM before you call attachMediaStream: https://temasys.atlassian.net/wiki/display/TWPP/How+to+integrate+the+Temasys+WebRTC+Plugin+into+your+website

However I think you make a faire point. We could return the element anyhow, and inject it only if the video element has a parentNode. It's Friday evening here, but we will give it a shot next week.

Thanks for the feedback, I'll keep you posted ;)

johache avatar Aug 14 '15 08:08 johache