跳转到主要内容

在JupyterLab和RetroLab内部与同侪进行视频聊天

项目描述

jupyter-videochat

使用Jitsi(https://jitsi.org)驱动的JupyterHub同侪在JupyterLab和RetroLab内部进行视频聊天。

documentation on readthedocs Extension status install from pypi install from conda-forge reuse from npm continuous integration interactive demo changelog contributing

jupyter-videochat screenshot

需求

  • python >=3.7
  • jupyterlab ==3.*

安装

使用pip安装服务器扩展和JupyterLab扩展

pip install -U jupyter-videochat

...或 conda/mamba

conda install -c conda-forge jupyter-videochat

用法

有关启动后使用实际聊天室的更多信息,请参阅[Jitsi手册]。

查看房间列表

JupyterLab

  • 主菜单...
    • 点击文件 ▶ 新建 ▶ 视频聊天
  • 启动器...
    • 打开一个新的JupyterLab启动器
    • 向下滚动到其他
    • 点击视频聊天启动卡片

RetroLab

  • 主菜单...
    • 点击文件 ▶ 新建 ▶ 视频聊天
  • 从RetroLab文件树...
    • 点击新建视频聊天按钮

开始聊天

  • 提供您的姓名和电子邮件(可选)
    • 这些信息将被保存在JupyterLab用户设置中,以供将来使用
    • 您的电子邮件将用于提供Gravatar图标
  • 从以下房间提供商中选择一个房间。
    • 您可能需要提供房间名称

停止聊天

  • 从Jitsi IFrame
    • 点击红色的“挂断”按钮,或
  • 视频聊天工具栏
    • 点击断开视频聊天按钮

故障排除

如果Jitsi框架确实加载了,[Jitsi手册]是获取更多帮助的最佳来源。

我看到实验室UI,但视频聊天Iframe没有加载

有时Jitsi IFrame会遇到问题,只显示一个白色框架。

尝试重新加载浏览器。

我看到UI,但缺少房间

如果您看到前端扩展但无法使用,请检查服务器扩展是否启用

jupyter server extension list
jupyter server extension enable --sys-prefix --py jupyter_videochat

...然后重新启动服务器。

如果您使用jupyter notebook启动Jupyter服务器,如Binder所做的那样,等效的命令是

jupyter serverextension list
jupyter serverextension enable --sys-prefix --py jupyter_videochat

如果服务器扩展已安装并启用,但您看不到前端,请检查前端是否已安装

jupyter labextension list

如果您看不到jupyterlab-videochat,最佳做法是卸载重新安装,并仔细查看日志输出。

架构

此扩展由以下部分组成

  • 一个名为jupyter_videochat的Python包,它提供
    • 一个jupyter_server扩展,它为JupyterHub上的房间提供方便的可配置默认值
    • 一个名为jupyter-videochat的JupyterLab 预构建联邦扩展
      • 也在npm上分发
        • 有关TypeScript/JS API的更多信息,请参阅CONTRIBUTING
      • 在JupyterLab运行时,一些可独立禁用的插件
        • jupyterlab-videochat:plugin,它是以下内容的依赖项
        • jupyterlab-videochat:rooms-server
        • jupyterlab-videochat:rooms-public
        • jupyterlab-videochat:toggle-area

配置

服务器配置

在您的jupyter_server_config.json(或等效的.pyconf.d/*.json)中,您可以配置VideoChat

  • room_prefix,用于您的组的前缀,默认为JupyterHub主机名的URL友好版本
    • 可以用JUPYTER_VIDEOCHAT_ROOM_PREFIX环境变量覆盖
  • jitsi_server,一个提供Jitsi web应用的HTTPS主机,默认为meet.jit.si
  • rooms,一个房间描述列表,您的Hub上的每个人都可以加入

示例

{
  "VideoChat": {
    "room_prefix": "our-spiffy-room-prefix",
    "rooms": [
      {
        "id": "stand-up",
        "displayName": "Stand-Up",
        "description": "Daily room for meeting with the team"
      },
      {
        "id": "all-hands",
        "displayName": "All-Hands",
        "description": "A weekly room for the whole team"
      }
    ],
    "jitsi_server": "jitsi.example.com"
  }
}

客户端配置

在JupyterLab的高级设置面板中,可以进一步配置视频聊天设置,还可以配置用户的默认displayNameemail。提供的默认值通常相当保守,并尽可能禁用第三方服务。

此外,可能可以启用对全局可访问公共房间的访问。

Binder客户端示例

例如,要启用所有第三方功能、公共房间,并默认在main区域打开

  • 创建一个overrides.json

    {
      "jupyter-videochat:plugin": {
        "interfaceConfigOverwrite": null,
        "configOverwrite": null,
        "disablePublicRooms": false,
        "area": "main"
      }
    }
    
  • 将其复制到JupyterLab设置目录

    # postBuild
    mkdir -p ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings
    cp overrides.json ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings
    

JupyterLite客户端示例

注意:JupyterLite 仍然是 alpha 软件版本,API 很可能发生变化。

jupyter lite 构建

jupyter_lite_config_.json

{
  "LabBuildConfig": {
    "federated_extensions": ["https://pypi.io/.../jupyterlab-videochat-0.6.0.whl"]
  }
}

添加一个运行时 jupyter-lite.json(或构建时 overrides.json)来禁用服务器室。

{
  "jupyter-lite-schema-version": 0,
  "jupyter-config-data": {
    "disabledExtensions": ["jupyterlab-videochat:rooms-server"],
    "settingsOverrides": {
      "jupyterlab-videochat:plugin": {
        "disablePublicRooms": false
      }
    }
  }
}

然后可以使用以下方法进行测试

jupyter lite serve

通过 URL 启动会议

?jvc=room-name 添加到 JupyterLab URL 将自动打开会议(但不会 完全 启动,因为浏览器需要用户手势来启动音频/视频)。

Binder URL 示例

Binder 上,使用 urlpath 添加参数,确保参数被正确 URL 编码。

https://mybinder.org/v2/gh/jupyterlab-contrib/jupyter-videochat/demo?urlpath=tree%3Fjvc%3DStand-Up
                                                         # URL-encoded  [? ] [=  ]
nbgitpuller

如果您有两个包含

  • 频繁更改的内容
  • 稳定环境的

...仓库(或分支),您可以使用 nbgitpuller 来拥有快速构建的(几乎)单点点击 URL,直接启动 JupyterLab 并显示会议和内容。例如,要使用...

  • 作为 master 的 [Python 数据科学手册]
  • 此项目的仓库,在 demo不建议,因为它非常 最少

...可以直接启动 JupyterLab 并显示

  • 《序言》笔记本
  • 《办公时间》室

...双转义 URL 可能如下所示

https://mybinder.org/v2/gh/jupyterlab-contrib/jupyter-videochat/demo?
urlpath=git-pull
  %3Frepo%3Dhttps%253A%252F%252Fgithub.com%252Fjakevdp%252FPythonDataScienceHandbook
  %26branch%3Dmaster
  %26urlpath%3Dlab%252Ftree%252FPythonDataScienceHandbook%252Fnotebooks%252F00.00-Preface.ipynb
  %253Fjvc%253DOffice%2BHours

JupyterLite 示例

此外,可以启用 ?JVC-PUBLIC=a-very-long-and-well-thought-key,提供类似体验,但用于未混淆的公开可见房间。请谨慎使用,作为主持人,请从 Jitsi 安全 UI 内部采取额外措施,包括

  • 休息室
  • 密码
  • 端到端加密

在正确配置后,JupyterLite 站点可以 git push 到 GitHub Pages,那里的 URL 远非如此混淆。

https://example.github.io/my-repo/lab?JVC-PUBLIC=a-very-long-and-well-thought-key
  • 可能 不要 点击少于大约十个字符的链接

卸载

pip uninstall jupyter-videochat

conda uninstall jupyter-videochat

项目详细信息


下载文件

下载您平台上的文件。如果您不确定要选择哪个,请了解有关 安装软件包 的更多信息。

源分布

jupyter-videochat-0.6.0.tar.gz (46.5 kB 查看散列

上传时间

构建分布

jupyter_videochat-0.6.0-py3-none-any.whl (52.1 kB 查看散列

上传时间 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面