☂️ Adds dynamic location service
This commit is contained in:
+2
-1
@@ -4,9 +4,10 @@
|
|||||||
import { connect } from './lib/socket';
|
import { connect } from './lib/socket';
|
||||||
import Stream from './components/Views/Stream.svelte';
|
import Stream from './components/Views/Stream.svelte';
|
||||||
import Controls from './components/Controls.svelte';
|
import Controls from './components/Controls.svelte';
|
||||||
|
import location from './lib/location';
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
connect('ws://leika.local');
|
connect(`ws://${location}`);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onDestroy } from 'svelte';
|
import { onDestroy } from 'svelte';
|
||||||
|
import location from '../../lib/location';
|
||||||
|
|
||||||
let videoStream = '//leika.local/stream';
|
let videoStream = `//${location}/stream`;
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
videoStream = '#';
|
videoStream = '#';
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
const location = import.meta.env.DEV ? "leika.local" : window.location.host
|
||||||
|
|
||||||
|
export default location;
|
||||||
Reference in New Issue
Block a user