Upload
keiji-ariyama
View
503
Download
1
Embed Size (px)
Citation preview
C-LIS CO., LTD.
M100 で WebRTC アプリ開発Vuzix Developer Conference
有限会社シーリス 有山 圭二
WebRTC とはWeb Real-Time CommunicationWorld Wide Web Consortium(W3C) が提唱するリアルタイムコミュニケーション用の API の定義で、プラグイン無しでウェブブラウザ間のボイスチャット、ビデオチャット、ファイル共有ができる。
( Wikipedia https://ja.wikipedia.org/wiki/WebRTC )
WebRTC とぼくGoogle 社主催の WebRTC ハッカソンに参加。当時はまだ Chrome に Experimental として実装されていた
ボスが来た
WebRTC 構成
Peer 2 Peer
音声・ビデオ
WebRTC 構成
Peer 2 Peer
Signaling Server
7
音声・ビデオ
WebRTC 構成( ICE: Interactive Connectivity Estblishment )
Peer 2 Peer
Signaling Server
STUN(Session Traversal Utilities for NAT) Server
8
音声・ビデオ
WebRTC 構成Signaling Server
TURN(Traversal Using Relay around NAT) Server
音声・ビデオ
9
WebRTC とはWeb Real-Time CommunicationWorld Wide Web Consortium(W3C) が提唱するリアルタイムコミュニケーション用の API の定義で、プラグイン無しでウェブブラウザ間のボイスチャット、ビデオチャット、ファイル共有ができる。
( Wikipedia https://ja.wikipedia.org/wiki/WebRTC )
WebRTC とブラウザバージョン 対応状況
Chrome 47 ○Firefox 42 ○Safari 9 × (プラグイン)
Internet Explorer 11 × (プラグイン)Microsoft
Edge 25.10586 ○Android
WebView 5.x 〜 ○Mobile Safari 9.1 ×
出典:JavaScriptoon 2 WebRTC〜知識ゼロから5日でボイスチャットを作れた技術発行 : TechBooster 執筆者 : @mzsm_j
Safari ( Webkit )もようやく……
https://webkit.org/status/?utm_content=bufferd7cfd&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer#specification-webrtc
M100 で WebRTC
ブラウザ?ネイティブ?
M100 の OS
Android 5 系未満なのでブラウザによるWebRTC 対応無し
OpenWebRTC by EricssonResearch
https://github.com/EricssonResearch/openwebrtc
OpenWebRTC
http://www.openwebrtc.org/
• H.264 と VP8 コーデックに対応( GStreamer ベース)• クロスプラットフォーム• 2条項BSDライセンス
デモ
WebRTC 構成( ICE: Interactive Connectivity Estblishment )
Peer 2 Peer
Signaling Server
STUN(Session Traversal Utilities for NAT) Server
20
音声・ビデオ
ハマったところ
ライブラリの追加
https://github.com/EricssonResearch/openwebrtc-examples/wiki/Developing-Android-apps
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'io.openwebrtc:openwebrtc-android:0.3'}
今はリポジトリにあるので jar 不要
https://github.com/EricssonResearch/openwebrtc-examples/blob/master/android/Native/app/build.gradle
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'io.openwebrtc:openwebrtc-android-sdk:0.1.0'}
android-sdk が別にある
https://github.com/EricssonResearch/openwebrtc-examples/blob/master/android/NativeCall/app/build.gradle
ビルドエラー
SDK の AndroidManifest.xml にプロパティが設定されているのが原因
<manifest package="com.vuzix.samplewebrtc.android" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<application android:allowBackup="false" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" tools:replace="android:allowBackup">
ビルドエラー
AndroidHttpClient is deprecated
ビルドはできるけど、あまり気持ちよいものではないHttpUrlConnection に置き換えた
/** * Shutdown the process as a workaround until cleanup has been fully implemented. */@Overrideprotected void onStop() { finish(); System.exit(0);}
なぞのコードが……
android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "com.ericsson.research.owr.examples.nativecall" minSdkVersion 19 targetSdkVersion 22 versionCode 1 versionName "1.0"
ndk { abiFilter "armeabi-v7a" } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 }
build.gradle
対応アーキテクチャが ARM のみ!
https://github.com/EricssonResearch/openwebrtc
Intel CPU には非対応 (M300 は……? )
https://www.vuzix.com/Products/m300-smart-glasses
M300 は Android 6 がベース
https://www.vuzix.com/Products/m300-smart-glasses
WebRTC サンプルコード (M100 向け ) は、GitHub で公開予定
https://github.com/vuzixtokyo
C-LIS CO., LTD.
各製品名・ブランド名、会社名などは、一般に各社の商標または登録商標です。本資料中では、 © 、 ® 、™を割愛しています。
本資料は、有限会社シーリスの著作物であり、クリエイティブコモンズの表示 - 非営利 - 継承 3.0 Unported ライセンスの元で公開しています。