internal static CDOMediaPublishOptions toNative(MediaPublishOptions options) { CDOMediaPublishOptions result = new CDOMediaPublishOptions(); if (options != null) { result.windowId = StringHelper.toNative(options.windowId); result.nativeWidth = options.nativeWidth; } return result; }
public void testPublishScreen() { setupDevs(); string scopeId = "c_sharp_test_room"; ConnectionDescription connDescr = genDefConnDescr(scopeId); connDescr.autopublishAudio = false; connDescr.autopublishVideo = false; _service.connect(createVoidResponder(), connDescr); awaitVoidResult("connect", 10000); _service.getScreenCaptureSources(createScrSourcesResponder(), 160); List<ScreenCaptureSource> sources = awaitScrSourcesResult(); MediaPublishOptions options = new MediaPublishOptions(); options.windowId = sources[0].id; options.nativeWidth = 640; _service.publish(createVoidResponder(), scopeId, MediaType.SCREEN, options); awaitVoidResult("publish screen", 10000); Thread.Sleep(15000); _service.disconnect(createVoidResponder(), scopeId); awaitVoidResult("disconnect"); }