/** stop all streams from being cast to the server */
  void doUnpublish() {
    for (String key : mLocalStream.keySet()) {
      final StreamDescription stream = mLocalStream.get(key);
      if (stream != null && stream.isLocal()) {
        stream.pc.removeStream(lMS);

        for (RoomObserver obs : mObservers) {
          obs.onStreamRemoved(stream);
        }

        if (mObservers.size() == 0) {
          destroy(stream);
        }
      }
    }
    mLocalStream.clear();

    if (lMS != null) {
      lMS.dispose();
    }
    if (mVideoCapturer != null) {
      mVideoCapturer.dispose();
    }

    lMS = null;
    mVideoCapturer = null;
    if (mVideoSource != null && !mVideoStopped) {
      mVideoSource.stop();
    }
    mVideoSource = null;
  }
예제 #2
0
 @Override
 public void onPause() {
   super.onPause();
   vsv.onPause();
   if (videoSource != null) {
     videoSource.stop();
     videoSourceStopped = true;
   }
 }