Skip to content

Commit

Permalink
Merge branch 'release/2020.2.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Ito committed Sep 8, 2020
2 parents ff621a9 + c40938e commit 0913800
Show file tree
Hide file tree
Showing 20 changed files with 352 additions and 306 deletions.
11 changes: 11 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@
- FIX
- バグ修正

## 2020.2.0

- [UPDATE] sora-e2ee を 2020.2.0 に上げる
- @voluntas
- [FIX] disconnect() を複数回実行した場合に例外が発生しないようにする
- @yuitowest
- [UPDATE] 新スポットライトに対応する
- ConnectionOptions に spotlightNumber を追加する
- ConnectionOptions の spotlight に boolean を受け取れるよう修正する
- @yuitowest

## 2020.1.5

- [FIX] metadata が undefined の場合以外は signaling connect message に metadata を含めるように変更
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,9 @@ Sora JavaScript SDK は[株式会社時雨堂](https://shiguredo.jp/)が開発
We check PRs or Issues only when written in JAPANESE.
In other languages, we won't be able to deal with them. Thank you for your understanding.

## Discord
## 時雨堂のオープンソースソフトウェアについて

https://discord.gg/uZ5wgHE

Sora JavaScript SDK に関する質問・要望などの報告は Disocrd へお願いします。

バグに関してはまず Discord へお願いします。
ただし、 Sora のライセンス契約の有無に関わらず、 Issue への応答時間と問題の解決を保証しませんのでご了承ください。

Sora JavaScript SDK に対する有償のサポートについては提供しておりません。
利用前に https://github.com/shiguredo/oss をお読みください。

## 使い方

Expand All @@ -33,7 +26,7 @@ Sora JavaScript SDK に対する有償のサポートについては提供して

## システム条件

- WebRTC SFU Sora 19.10.8 以降
- WebRTC SFU Sora 2020.1 以降

## サンプル

Expand Down
30 changes: 15 additions & 15 deletions dist/sora.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* sora-js-sdk
* WebRTC SFU Sora JavaScript SDK
* @version: 2020.1.5
* @version: 2020.2.0
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, global.Sora = factory());
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Sora = factory());
}(this, (function () { 'use strict';

function browser() {
Expand Down Expand Up @@ -97,7 +97,7 @@
type: "connect",
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/camelcase
sora_client: `Sora JavaScript SDK ${'2020.1.5'}`,
sora_client: `Sora JavaScript SDK ${'2020.2.0'}`,
environment: window.navigator.userAgent,
role: role,
// eslint-disable-next-line @typescript-eslint/camelcase
Expand All @@ -119,6 +119,10 @@
// spotlight
if ("spotlight" in options) {
message.spotlight = options.spotlight;
if ("spotlightNumber" in options) {
// eslint-disable-next-line @typescript-eslint/camelcase
message.spotlight_number = options.spotlightNumber;
}
}
}
if ("simulcast" in options || "simulcastQuality" in options) {
Expand Down Expand Up @@ -277,10 +281,10 @@
/**
* sora-e2ee
* WebRTC SFU Sora JavaScript E2EE Library
* @version: 2020.1.0
* @version: 2020.2.0
* @author: Shiguredo Inc.
* @license: Apache-2.0
**/(function(a,b){module.exports=b();})(commonjsGlobal,function(){return class a{constructor(a){const b=!!RTCRtpSender.prototype.createEncodedVideoStreams;if(!b)throw new Error("E2EE is not supported in this browser");this.worker=null,this.masterKey=new TextEncoder().encode(a),this.onWorkerDisconnect=null;}startWorker(){const a=atob("bGV0IG1hc3RlcktleSxtYXRlcmlhbDtjb25zdCBkZXJpdmVLZXlNYXA9bmV3IE1hcCxzZXFOdW1NYXA9bmV3IE1hcCx3cml0ZUlWTWFwPW5ldyBNYXAsc2VxTnVtTGVuZ3RoPTQsc3NyY0xlbmd0aD00LHBhZGRpbmdMZW5ndGg9OCx1bmVuY3J5cHRlZEJ5dGVzPXtrZXk6MTAsZGVsdGE6Myx1bmRlZmluZWQ6MX07ZnVuY3Rpb24gZ2V0U2VxTnVtKGEpe3JldHVybiBzZXFOdW1NY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pdmVLZXlNYXAuY2xlYXIoKSxzZXFOdW1NYXAuY2xlYXIoKSx3cml0ZUlWTWFwLmNsZWFyKCkpfTsK");this.worker=new Worker(URL.createObjectURL(new Blob([a],{type:"application/javascript"}))),this.worker.onmessage=a=>{const{operation:b}=a.data;"disconnect"===b&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect();},this.worker.postMessage({operation:"setKey",masterKey:this.masterKey});}terminateWorker(){this.worker&&this.worker.terminate();}setupSenderTransform(a){if(a.track){const b="video"===a.track.kind?a.createEncodedVideoStreams():a.createEncodedAudioStreams();this.worker&&this.worker.postMessage({operation:"encrypt",readableStream:b.readableStream,writableStream:b.writableStream},[b.readableStream,b.writableStream]);}}setupReceiverTransform(a){const b="video"===a.track.kind?a.createEncodedVideoStreams():a.createEncodedAudioStreams();this.worker&&this.worker.postMessage({operation:"decrypt",readableStream:b.readableStream,writableStream:b.writableStream},[b.readableStream,b.writableStream]);}static version(){return "2020.1.0"}}});
**/(function(a,b){module.exports=b();})(commonjsGlobal,function(){return class a{constructor(a){const b=!!RTCRtpSender.prototype.createEncodedStreams;if(!b)throw new Error("E2EE is not supported in this browser");this.worker=null,this.masterKey=new TextEncoder().encode(a),this.onWorkerDisconnect=null;}startWorker(){const a=atob("bGV0IG1hc3RlcktleSxtYXRlcmlhbDtjb25zdCBkZXJpdmVLZXlNYXA9bmV3IE1hcCxzZXFOdW1NYXA9bmV3IE1hcCx3cml0ZUlWTWFwPW5ldyBNYXAsc2VxTnVtTGVuZ3RoPTQsc3NyY0xlbmd0aD00LHBhZGRpbmdMZW5ndGg9OCx1bmVuY3J5cHRlZEJ5dGVzPXtrZXk6MTAsZGVsdGE6Myx1bmRlZmluZWQ6MX07ZnVuY3Rpb24gZ2V0U2VxTnVtKGEpe3JldHVybiBzZXFOdW1NYXAuZ2V0KGEpfHwwfWZ1bmN0aW9uIHNldFNlcU51bShhLGIpe3NlcU51bU1hcC5zZXQoYSxiKX1hc3luYyBmdW5jdGlvbiB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createObjectURL(new Blob([a],{type:"application/javascript"}))),this.worker.onmessage=a=>{const{operation:b}=a.data;"disconnect"===b&&"function"==typeof this.onWorkerDisconnect&&this.onWorkerDisconnect();},this.worker.postMessage({operation:"setKey",masterKey:this.masterKey});}terminateWorker(){this.worker&&this.worker.terminate();}setupSenderTransform(a){if(a.track){const b=a.createEncodedStreams();this.worker&&this.worker.postMessage({operation:"encrypt",readableStream:b.readableStream,writableStream:b.writableStream},[b.readableStream,b.writableStream]);}}setupReceiverTransform(a){const b=a.createEncodedStreams();this.worker&&this.worker.postMessage({operation:"decrypt",readableStream:b.readableStream,writableStream:b.writableStream},[b.readableStream,b.writableStream]);}static version(){return "2020.2.0"}}});

});

Expand Down Expand Up @@ -345,12 +349,11 @@
const closeWebSocket = new Promise((resolve, reject) => {
if (!this.ws)
return resolve();
this.ws.onclose = null;
let counter = 5;
const timerId = setInterval(() => {
if (!this.ws) {
clearInterval(timerId);
return reject("WebSocket Closing Error");
return resolve();
}
if (this.ws.readyState === 3) {
this.ws = null;
Expand Down Expand Up @@ -379,7 +382,7 @@
const timerId = setInterval(() => {
if (!this.pc) {
clearInterval(timerId);
return reject("PeerConnection Closing Error");
return resolve();
}
if (this.pc.signalingState === "closed") {
clearInterval(timerId);
Expand Down Expand Up @@ -433,9 +436,8 @@
this.connectionId = data.connection_id;
if (this.ws) {
this.ws.onclose = (e) => {
this.disconnect().then(() => {
this.callbacks.disconnect(e);
});
this.callbacks.disconnect(e);
this.disconnect();
};
this.ws.onerror = null;
}
Expand Down Expand Up @@ -492,9 +494,7 @@
let config = messageConfig;
if (this.e2ee) {
// @ts-ignore
config["forceEncodedVideoInsertableStreams"] = true;
// @ts-ignore
config["forceEncodedAudioInsertableStreams"] = true;
config["encodedInsertableStreams"] = true;
}
if (window.RTCPeerConnection.generateCertificate !== undefined) {
const certificate = await window.RTCPeerConnection.generateCertificate({ name: "ECDSA", namedCurve: "P-256" });
Expand Down Expand Up @@ -889,7 +889,7 @@
},
version: function () {
// @ts-ignore
return '2020.1.5';
return '2020.2.0';
},
};

Expand Down
4 changes: 2 additions & 2 deletions dist/sora.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 0913800

Please sign in to comment.