跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] webrtc 屏幕共享的诡异问题

发表于

第一次使用 webrtc ,实现了远程屏幕共享,消息发送,但是遇到了一个问题,先说说我的实现:

首先页面上只有一个 video 标签,AB 都是同一套项目代码。

AB 分别在不同的电脑上打开网页,A 分享屏幕给 B ,B 接受以后,现在 A 在自己浏览器 video 标签能看到自己的屏幕画面,B 在自己的浏览器 video 标签也能看到 A 的画面,这里分享一切都正常,发送消息也是正常的。

然后在不关闭现有画面分享的情况下,B 又把自己的画面(可以是屏幕,网页都行)分享给 A ,这里重新发起 offer-aswer 过程,A 接受以后,A 现在本地的 video 标签视频流就替换成 B 的分享画面(之前是 A 自己的本地画面),然后诡异的问题就出现了

A 使用 datachannel 发送消息给 B ,然后 AB 都收到了...,更诡异的是,A 关闭分享给 B 的画面,AB 同时都被关闭了, 按照我的预期,A 关闭画面也只是影响到 B 的画面没有数据了,为什么把两端的流都给关闭了呢,难道是我全程都是用的一个 video 标签的原因嘛

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.