Skip to content

Commit

Permalink
example 実行時に環境変数が設定されていない場合は空文字として扱う
Browse files Browse the repository at this point in the history
  • Loading branch information
miosakuma committed Feb 22, 2024
1 parent b4cdedf commit 7c47f3e
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 27 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
- Node.js 18,20,21 で E2E テストを実行する
- Chromium と E2E テストを実行する
- @voluntas
- [FIX] examples 実行時に環境変数が設定されていない場合は空文字にする
- 対象項目は SORA_CHANNEL_ID_PREFIX, VITE_SORA_CHANNEL_ID_PREFIX, VITE_ACCESS_TOKEN
- @miosakuma

## 2023.2.0

Expand Down
6 changes: 3 additions & 3 deletions examples/e2ee/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const debug = false
Sora.initE2EE('https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm').catch((e) => {
Expand Down
6 changes: 3 additions & 3 deletions examples/messaging/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const debug = true
const sora = Sora.connection(SORA_SIGNALING_URL, debug)
Expand Down
6 changes: 3 additions & 3 deletions examples/recvonly/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const debug = false
const sora = Sora.connection(SORA_SIGNALING_URL, debug)
Expand Down
6 changes: 3 additions & 3 deletions examples/sendonly/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const channelId = `${SORA_CHANNEL_ID_PREFIX}sendonly_recvonly${SORA_CHANNEL_ID_SUFFIX}`
const debug = false
Expand Down
6 changes: 3 additions & 3 deletions examples/sendrecv/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const channelId = `${SORA_CHANNEL_ID_PREFIX}sendrecv${SORA_CHANNEL_ID_SUFFIX}`
const debug = false
Expand Down
6 changes: 3 additions & 3 deletions examples/simulcast/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const debug = false
const sora = Sora.connection(SORA_SIGNALING_URL, debug)
Expand Down
6 changes: 3 additions & 3 deletions examples/spotlight_recvonly/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const channelId = `${SORA_CHANNEL_ID_PREFIX}spotlight_sendonly_recvonly${SORA_CHANNEL_ID_SUFFIX}`
const debug = false
Expand Down
6 changes: 3 additions & 3 deletions examples/spotlight_sendonly/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const channelId = `${SORA_CHANNEL_ID_PREFIX}spotlight_sendonly_recvonly${SORA_CHANNEL_ID_SUFFIX}`
const debug = false
Expand Down
6 changes: 3 additions & 3 deletions examples/spotlight_sendrecv/main.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Sora from '../../dist/sora.mjs'

const SORA_SIGNALING_URL = import.meta.env.VITE_SORA_SIGNALING_URL
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN
const SORA_CHANNEL_ID_PREFIX = import.meta.env.VITE_SORA_CHANNEL_ID_PREFIX || ''
const SORA_CHANNEL_ID_SUFFIX = import.meta.env.VITE_SORA_CHANNEL_ID_SUFFIX || ''
const ACCESS_TOKEN = import.meta.env.VITE_ACCESS_TOKEN || ''

const channelId = `${SORA_CHANNEL_ID_PREFIX}spotlight${SORA_CHANNEL_ID_SUFFIX}`
const debug = false
Expand Down

0 comments on commit 7c47f3e

Please sign in to comment.