kurento
Android Get a media stream
image.pngVideoCapturer c = VideoCapturer.create(device);
PeerConnectionFactory factory = new PeerConnectionFactory();
MediaStream localStream = factory.createLocalMediaStream(streamName);
VideoSource s = factory.createVideoSource(c, constraints);
VideoTrack t = factory.createVideoTrack(trackName, s);
localStream.addTrack(t);
Stream between peers
image.png
PeerConnection pc =
factory.createPeerConnection(iceServers, constraints, observer);
pc.addStream(localStream);
pc.createOffer(this, offerConstraints);
public void onCreateSuccess(
final SessionDescription offer) { sendMessage(offer); }
Display a media stream
image.png
public void onAddStream(final MediaStream stream) {
VideoTrack track = stream.getVideoTracks(0);
YuvImageRenderer renderer = remoteRenderer;
track.addRenderer(new VideoRenderer(renderer));
}
网友评论