Second active video stream not showing on refresh.

42 views
Skip to first unread message

Michael Kork

unread,
Jun 12, 2015, 10:18:51 AM6/12/15
to eas...@googlegroups.com
The problem is this: 

During a normal flow, I receive the new video streams and I am able to show 3 or 4 video streams concurrent and close them with no problem at all. 
When one client refreshes the browser, the occupant listener is called and the active video streams are returned (I keep them in the apiField). 
After I iterate the occupants and retrieve the easyrtcid-s, I start calling them recursively as it is shown in your example. The problem is that, although I get the 'callAccepted' event and I am able to show the stream of the first in the list, when I show the second stream, I get nothing. The stream Url is generated correctly by URL.createObjectURL, it is inserted as 'src' attribute in the video element but nothing is shown. This happens for the others in the list as well (except from the 1st guy on the list where I receive his stream correctly) .

I am using the easyRTC library inside an AngularJS project, so I cannot (and don't want to) use the 'easyapp' and I don't want to use the auto-bind method (setVideoObjectSrc) you have for the videoIDs and stream elements. I call 'URL.createObjectURL', get back the URI, use angular's '$sce.trustAsResource' method, add it to a List and that list is binded to a 'ng-repeat' video element in the UI where the source is added as 'ng-src="obj.streamURL" 

Any ideas why I cannot see the second video stream?

Eric Davies

unread,
Jun 12, 2015, 10:42:12 AM6/12/15
to eas...@googlegroups.com
It's not clear what you are doing. I'd suggest describing your code as a sequence of primitive easyrtc calls free of angular.

Michael Kork

unread,
Jun 12, 2015, 10:46:33 AM6/12/15
to eas...@googlegroups.com
-easyrtc.setRoomOccupantListener
- easyrtc.connect 
- OccupantListener fired
- retrieve occupants that have ongoing live streams 
- call them, recursively 
- get 'setStreamAcceptor' callback on everyone of them 
- get stream URL by calling URL.createObjectURL(stream)
- set that stream to <video src="<streamURL>">

BUG 

the second video stream is not shown.

Michael Kork

unread,
Jun 15, 2015, 4:00:26 AM6/15/15
to eas...@googlegroups.com
Eric, I transferred the code to an angular-free page and it worked. It must be something with angular not syncing correctly.. Thanks for the response though 

Michael Kork

unread,
Jun 16, 2015, 5:41:19 AM6/16/15
to eas...@googlegroups.com
I'm sorry to bring this error back but it seems that angular is not to blame. The second stream is broken. I wrote the same Question to StackOverflow, with a bit of code. Please check it there 

Eric Davies

unread,
Jun 16, 2015, 11:11:37 AM6/16/15
to eas...@googlegroups.com
Well, now I understand what you are trying to do. Multiple callers, one stream each way per caller.
Functionally equivalent to the multiparty demo we provide, but with angular thrown in to make your life complicated.

Your Stackoverflow posting indicates that you have a angular free version that works, and an angular one that doesn't. You'll probably get more useful answers on stackoverflow if you post the angular version that doesn't work in addition to the angular free one that did work. However, I would suggest stripping it down to the bare minimum to demonstrate the problem; get rid of the junk about room names, user ids, api fields, etc. That should be common sense, after all, ask yourself "who would you be more likely to help: the guy who posted a short simple piece of code, or the guy who posted the long complicated piece of code full of irrelevant stuff". Good luck.






Reply all
Reply to author
Forward
0 new messages