otalk / iOS-demo

MIT License
46 stars 26 forks source link

unaible to see videos on devices #13

Closed mohamedguembri closed 9 years ago

mohamedguembri commented 9 years ago

Hi I can't see any videos on the device (local and remote). I tested this project with an iPhone5 and an iPad, it looks working perfectly, i can see the stream of my camera on the web, but I can't see it on the device.

jfs77 commented 9 years ago

it' the same for me... with an iphone 5S ans Ipad 2.

mohamedguembri commented 9 years ago

try to separate the local view from the remote view on the storyboard, then you have to make some changes on the viewcontroller.m:

1)add those lines on the viewdidload where you have NSLog(@"connect success"); :

//////////////////////////////////////////////////////////////////////// RTCVideoTrack * localVideoTrack1 = self.signaling.localMediaStream.videoTracks[0];
self.localVideoTrack = localVideoTrack1; [self.localVideoTrack addRenderer:self.localView]; ////////////////////////////////////////////////////////////////////////

2)replace the addedStream void with this: ////////////////////////////////////////////////////////////////////////

pragma mark - TLKSocketIOSignalingDelegate

-(void)socketIOSignaling:(TLKSocketIOSignaling )socketIOSignaling addedStream:(TLKMediaStream )stream { NSLog(@"addedStream"); RTCVideoTrack * remoteVideoTrack = stream.stream.videoTracks[0]; self.remoteVideoTrack = remoteVideoTrack; [self.remoteVideoTrack addRenderer:self.remoteView]; } ////////////////////////////////////////////////////////////////////////