-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
5,322 additions
and
4,646 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [ develop ] | ||
schedule: | ||
- cron: '41 3 * * 2' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'javascript' ] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
# Learn more about CodeQL language support at https://git.io/codeql-language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>E2EE test</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h1>E2EE test</h1> | ||
<p id="error-message" style="color: red;"></p> | ||
<div style="display: flex;"> | ||
<div> | ||
<h2>local</h2> | ||
<button id="start-sendrecv">start</button> | ||
<button id="stop-sendrecv">stop</button><br /> | ||
<p id="local-connection-id"></p> | ||
<p id="local-fingerprint"></p> | ||
<video id="sendrecv-local-video" autoplay="" playsinline="" controls="" style="width: 320px; height: 240px; border: 1px solid black;"></video> | ||
|
||
<h2>remote</h2> | ||
<div id="sendrecv-remote-videos"></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script src="./sora.js"></script> | ||
<script type="text/javascript"> | ||
const channelId = 'Sora'; | ||
const debug = false; | ||
Sora.initE2EE("https://sora-e2ee-wasm.shiguredo.jp/2020.2/wasm.wasm").catch((e) => { | ||
document.querySelector("#error-message").textContent = "E2EE用 wasm ファイルの読み込みに失敗しました"; | ||
}); | ||
const sora = Sora.connection('ws://127.0.0.1:5000/signaling', debug); | ||
const sendrecv = sora.sendrecv(channelId, null, { | ||
multistream: true, | ||
e2ee: true | ||
}); | ||
sendrecv.on('track', (event) => { | ||
const stream = event.streams[0]; | ||
if (!stream) return; | ||
const remoteVideoBoxId = 'remote-video-box-' + stream.id; | ||
const remoteVideos = document.querySelector('#sendrecv-remote-videos'); | ||
if (!remoteVideos.querySelector('#' + remoteVideoBoxId)) { | ||
const remoteVideoBox = document.createElement('div'); | ||
remoteVideoBox.id = remoteVideoBoxId; | ||
const connectionIdElement = document.createElement('p'); | ||
connectionIdElement.id = remoteVideoBoxId + "-connection-id"; | ||
connectionIdElement.textContent = 'connectionId: ' + stream.id; | ||
remoteVideoBox.appendChild(connectionIdElement); | ||
const fingerprintElement = document.createElement('p'); | ||
fingerprintElement.id = remoteVideoBoxId + "-fingerprint"; | ||
remoteVideoBox.appendChild(fingerprintElement); | ||
const remoteVideo = document.createElement('video'); | ||
remoteVideo.style.border = '1px solid red'; | ||
remoteVideo.autoplay = true; | ||
remoteVideo.playsinline = true; | ||
remoteVideo.controls = true; | ||
remoteVideo.width = '160'; | ||
remoteVideo.height = '120'; | ||
remoteVideo.srcObject = stream; | ||
remoteVideoBox.appendChild(remoteVideo); | ||
remoteVideos.appendChild(remoteVideoBox); | ||
} | ||
}); | ||
sendrecv.on('removetrack', (event) => { | ||
const remoteVideo = document.querySelector('#remote-video-box-' + event.target.id); | ||
if (remoteVideo) { | ||
document.querySelector('#sendrecv-remote-videos').removeChild(remoteVideo); | ||
} | ||
}); | ||
sendrecv.on('notify', (event) => { | ||
if (event.event_type === "connection.created") { | ||
const remoteFingerprints = sendrecv.e2eeRemoteFingerprints; | ||
Object.keys(remoteFingerprints).forEach((connectionId) => { | ||
const fingerprintElement = document.querySelector('#remote-video-box-' + connectionId + '-fingerprint'); | ||
if (fingerprintElement) { | ||
fingerprintElement.textContent = "fingerprint: " + remoteFingerprints[connectionId]; | ||
} | ||
}); | ||
} | ||
}); | ||
|
||
document.querySelector('#start-sendrecv').addEventListener('click', async () => { | ||
const mediaStream = await navigator.mediaDevices.getUserMedia({audio: true, video: true}) | ||
await sendrecv.connect(mediaStream); | ||
document.querySelector('#local-connection-id').textContent = "connectionId: " + sendrecv.connectionId; | ||
document.querySelector('#local-fingerprint').textContent = "fingerprint: " + sendrecv.e2eeSelfFingerprint; | ||
document.querySelector('#sendrecv-local-video').srcObject = mediaStream; | ||
}); | ||
|
||
document.querySelector('#stop-sendrecv').addEventListener('click', () => { | ||
sendrecv.disconnect() | ||
.then(function() { | ||
document.querySelector('#sendrecv-local-video').srcObject = null; | ||
document.querySelector('#sendrecv-remote-videos').innerHTML = null; | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.