Web Real-Time Communication (略称: WebRTC[2]) は、ウェブブラウザモバイルアプリケーションにシンプルなAPI経由でリアルタイム通信を提供する自由かつオープンソースのプロジェクトである。

WebRTC
作者 Justin Uberti
Peter Thatcher
初版 2011年 (13年前) (2011)
最新版
1.1 / 2017年5月4日 (6年前) (2017-05-04)
リポジトリ webrtc.googlesource.com
プログラミング
言語
C++[1]JavaScript
ライセンス BSDライセンス
公式サイト webrtc.org
テンプレートを表示

ウェブページ内で直接ピア・ツー・ピア通信を行うことによって、プラグインのインストールやネイティブアプリのダウンロードを行わなくても、ウェブブラウザ間のボイスチャットビデオチャットファイル共有などを実装できるようになる[3]。WebRTCは、AppleGoogleマイクロソフトMozillaOperaがサポートしている。

WebRTC は 1 つのプロトコル仕様(プロトコルスイート)と 1 つの JavaScript API 仕様からなる[4]。これら仕様は W3C および IETF の複数の規格書に跨って定義されている。

WebRTCの目的は、「ブラウザ、モバイルプラットフォーム、IoTデバイス向けのリッチで高品質なRTPアプリケーションを、開発できるようにし、共通のプロトコルセットで通信できるようにすること」である[5]リファレンス実装BSDライセンスフリーソフトウェアとして公開されている。また、マルチメディアフレームワークのGStreamerをベースに実装されたOpenWebRTCという別のフリー実装も存在する。JavaScriptを発明したブレンダン・アイクは、WebRTCのことを 「妨げなく開かれているウェブへの戦いにおける新たな戦線」であると評している[6]

歴史 編集

ブラウザでリアルタイムなコミュニケーションを可能にするWebRTCは、Googleによってオープンソース化されており[7]、IETFによる関連プロトコル[8]とW3Cによるブラウザ対応APIの標準化が進められてきた[9]

W3CによるWebRTCのドラフト[10]は、Google ChromeとMozilla Firefoxで特別に実験的に実装が行われる。APIはWHATWGに予備的に記述され[11]、ConnectionPeer APIと呼ばれており、Ericsson Labsが仮の標準概念実装として作成している[12]。ウェブリアルタイムコミュニケーションワーキンググループは、この仕様が以下の項目に基づいて進化することを期待している。

  • ウェブブラウザでのリアルタイムなコミュニケーションを可能にするこのドキュメントと一緒に一連のプロトコルを定義するためのIETFにおける仲間のRTCWEBグループ[13]での継続的交流の成果
  • ローカルキャパシティとローカルストリームを公開する時に発生するプライバシー問題
  • 特殊な環境でデータチャネルの実装に関するグループでの技術的ディスカッション[14]
  • 初期の実験を通して得られる経験
  • 他のグループや個人からのフィードバックの受け取り

概要 編集

設計 編集

WebRTCを構成する主要な API を次に挙げる。

  • getUserMedia カメラやマイクなどのメディア入力の利用をユーザーに許可させる[15]
  • RTCPeerConnection ピア同士で直接ビデオ・音声をやりとりするためのクラス。シグナリング、コーデックの処理、P2P通信、セキュリティおよび帯域管理を担う[16]
  • RTCDataChannel ピア間の双方向通信で任意のデータを扱うためのクラス。WebSocketsと同じAPIを利用しており、レイテンシーが非常に低い[17]

WebRTC には統計のためのAPIもある。

  • getStats はWebRTCセッションの統計をWebアプリケーションが取得可能にする。なお、統計に関する仕様は別のW3Cドキュメントになっている[18]

WebRTC自体には、シグナリング(ピア同士の検索と接続確立のためのプロセス)のためのAPIは含まれない。代わりに、アプリケーションではInteractive Connectivity Establishment(ICE)を用いる。なお、ICEのプロセスではシグナリングやNATトラバーサルのためにサーバーを介した通信が必要な場合がある。

サポート 編集

WebRTCは以下のブラウザでサポートされている。

仕様 編集

次の 6 つの機能グループ(functionality groups)からなる:

表. 機能グループの一覧
グループ名 要件・機能例
メディア転送基盤 (media transport infrastructure[24])
データ転送 (Data transport) RFC8835 に準拠[25]
データフレーミング (Data framing) RTP 形式・SRTP 実装が必須[26]

非 RTP 形式に関する対応も必須[27] データチャネル確立プロトコルはrfc8832準拠

データ形式 (Data formats) 最小限のコーデック・フォーマットを指定[28]

音声: Opus, PCMA, PCMU, comfort noise

メディアサービス (media service[29])
接続管理 (Connection management)
表示と制御 (Presentation and control)
ローカルシステム補助機能 (Local system support functions) エコー除去自動利得制御録音

認証認可、OSアクセス制御[30]

Local system support functions 編集

  • プライバシー懸念の解消は必須[31](例: カメラアクセス認可)
  • endpoint は RFC7874 の processing functions を必ず実装[32]

用語 編集

以下は WebRTC の文脈で専門用語として意味が定義された用語の一例である[33]

リアルタイムメディア 編集

WebRTC におけるリアルタイムメディア (Real-Time Media) はコンテンツの生成と提示が時間的に密接して起きるよう意図されたメディアである(生成-表示遅延が数 100 ミリ秒以内)[34]

電話ビデオ会議はリアルタイムメディアといえる。WebRTC はリアルタイムメディアの仕様である。

規格書 編集

W3C や IETF において WebRTC の規格が策定されている。以下はその一部である:

表. WebRTC 規格
規格書名 規格種別 発行日
WebRTC: Real-Time Communication in Browsers W3C Recommendation 2023-03-06
WebRTC 1.0: Real-Time Communication Between Browsers W3C Recommendation 2021-01-26
RFC 8835 Transports for WebRTC RFC Proposed Standard 2021-01-18
RFC 8834 Media Transport and Use of RTP in WebRTC RFC Proposed Standard 2021-01-18
RFC 8832 WebRTC Data Channel Establishment Protocol RFC Proposed Standard 2021-01-18
RFC 8831 WebRTC Data Channels RFC Proposed Standard 2021-01-18
RFC 8826 Security Considerations for WebRTC RFC Proposed Standard 2021-01-18
RFC 8825 Overview: Real-Time Protocols for Browser-Based Applications RFC Proposed Standard 2021-01-18
RFC 7874 WebRTC Audio Codec and Processing Requirements RFC Proposed Standard 2016-05-25

脚注 編集

  1. ^ https://webrtc.googlesource.com/src/webrtc/
  2. ^ "to be compliant with Web Real-Time Communication (WebRTC)." RFC 8825 より引用。
  3. ^ How WebRTC Is Revolutionizing Telephony. Blogs.trilogy-lte.com (2014-02-21). Retrieved on 2014-04-11.
  4. ^ "The total WebRTC effort consists of two major parts ... A protocol specification ... A JavaScript API specification" RFC 8825 より引用。
  5. ^ WebRTC”. WebRTC. 2018年1月8日時点のオリジナルよりアーカイブ。2018年2月6日閲覧。
  6. ^ WebRTC: Plugin-free realtime communication”. 2018年2月6日閲覧。
  7. ^ Google release of WebRTC source code from Harald Alvestrand on 2011-05-31 (public-webrtc@w3.org from May 2011)”. Lists.w3.org. 2012年9月12日閲覧。
  8. ^ https://tools.ietf.org/wg/rtcweb/charters?item=charter-rtcweb-2011-05-03.txt
  9. ^ WebRTC 1.0: Real-time Communication Between Browsers”. W3.org. 2012年9月12日閲覧。
  10. ^ WebRTC 1.0: Real-time Communication Between Browsers”. Dev.w3.org. 2012年9月12日閲覧。
  11. ^ href. “1 Introduction — HTML Standard”. Whatwg.org. 2012年9月12日閲覧。
  12. ^ Beyond HTML5: Peer-to-Peer Conversational Video | Ericsson Labs”. Labs.ericsson.com. 2012年9月12日閲覧。
  13. ^ Rtcweb Status Pages”. Tools.ietf.org. 2012年9月12日閲覧。
  14. ^ draft-jesup-rtcweb-data-protocol-00 - WebRTC Data Channel Protocol”. Tools.ietf.org. 2012年9月12日閲覧。
  15. ^ Media Capture and Streams: getUserMedia”. W3C (2013年9月3日). 2014年1月15日閲覧。
  16. ^ WebRTC: RTCPeerConnection Interface”. W3C (2013年9月10日). 2014年1月15日閲覧。
  17. ^ WebRTC: RTCDataChannel”. W3C (2013年9月10日). 2014年1月15日閲覧。
  18. ^ Identifiers for WebRTC's Statistics API”. W3C (2014年9月29日). 2020年8月31日閲覧。
  19. ^ ORTC API is now available in Microsoft Edge”. Microsoft (2015年9月18日). 2020年8月31日閲覧。
  20. ^ Firefox Notes - Desktop. Mozilla.org (2013-06-25). Retrieved on 2014-04-11.
  21. ^ Safari 11.0”. Apple Inc.. 2017年6月6日閲覧。
  22. ^ Opera News. blogs.opera.com (2013-11-19). Retrieved on 2015-09-17.
  23. ^ Firefox Notes - Desktop. Mozilla.org (2013-09-17). Retrieved on 2014-08-04.
  24. ^ 'first three groups as forming a "media transport infrastructure"' RFC 8825 より引用。
  25. ^ "WebRTC endpoints MUST implement the transport protocols described in [RFC8835]." RFC 8825 より引用。
  26. ^ "The format for media transport is RTP ... Implementation of the Secure Real-time Transport Protocol (SRTP) [RFC3711] is REQUIRED for all implementations." RFC 8825 より引用。
  27. ^ "Considerations for the transfer of data that is not in RTP format are described in [RFC8831] ... WebRTC endpoints MUST implement these two specifications." RFC 8825 より引用。
  28. ^ "This document specifies a minimum baseline ... and leaves further codecs to be included" RFC 8825 より引用。
  29. ^ 'the last three groups as forming a "media service".' RFC 8825 より引用。
  30. ^ "Local system support functions ... Examples in this category include echo cancellation ... local authentication and authorization mechanisms, OS access control, and the ability to do local recording of conversations." RFC 8825 より引用。
  31. ^ "Privacy concerns MUST be satisfied" RFC 8825 より引用。
  32. ^ "WebRTC endpoints MUST implement the processing functions in [RFC7874]" RFC 8825 より引用。
  33. ^ "The following terms are used across the documents specifying the WebRTC suite, with the specific meanings given here." RFC 8825 より引用。
  34. ^ "Media where the generation and display of content are intended to occur closely together in time (on the order of no more than hundreds of milliseconds)." RFC 8825 より引用。

関連項目 編集

外部リンク 編集