/** * detach stream from video window * @param mediaType: stream mediaType- local, remote, PIP and content * @return true: successfully detached; false: fail to detach * */ public static bool DetachStreamFromWindow(MediaTypeEnum mediaType, int streamId, int callHandle) { log.Debug("[detachStreamFromWindow] mediatype " + mediaType.ToString() + " from video window."); if (mediaType != MediaTypeEnum.PLCM_MF_STREAM_LOCAL) { if (invalidCallHandle != callHandle) { var errNo = WrapperProxy.DetachStreamWnd(mediaType, streamId, callHandle); if (ErrorNumberEnum.PLCM_SAMPLE_OK != errNo) { log.Error("detach stream from window failed. Error number = " + errNo.ToString()); return(false); } } else { log.Error("no such call to detach stream window"); return(false); } } else {//for local preview //when the media type is local, set the call handle to -1 (invalid call handle) var errNo = WrapperProxy.DetachStreamWnd(mediaType, streamId, invalidCallHandle); if (ErrorNumberEnum.PLCM_SAMPLE_OK != errNo) { log.Error("detach stream from window failed. Error number = " + errNo.ToString()); return(false); } } return(true); }