Skip to content

Commit a948d21

Browse files
committed
docker and streams
1 parent 4c02651 commit a948d21

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
ports:
1212
- '${APP_PORT:-80}:80'
1313
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
14+
- '${REVERB_SERVER_PORT:-8080}:8080'
1415
environment:
1516
WWWUSER: '${WWWUSER}'
1617
LARAVEL_SAIL: 1

resources/js/Pages/Welcome.vue

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,38 @@
11
<script setup>
2-
import { Head, Link, useForm, usePage } from '@inertiajs/vue3';
2+
import { Head, Link, useForm } from '@inertiajs/vue3';
33
import PrimaryButton from '@/Components/PrimaryButton.vue';
4-
import InputLabel from '@/components/InputLabel.vue';
5-
import TextInput from '@/components/TextInput.vue';
6-
import {onMounted} from 'vue'
4+
import InputLabel from '@/Components/InputLabel.vue';
5+
import TextInput from '@/Components/TextInput.vue';
6+
import {onMounted, ref} from 'vue'
77
const props = defineProps({
88
callerId: {
99
type: String,
1010
11+
},
12+
canLogin: {
13+
type: Boolean,
14+
15+
},
16+
canRegister: {
17+
type: Boolean,
18+
1119
}
1220
})
13-
21+
const hasStream = ref(false);
1422
const pc = new RTCPeerConnection();
15-
let stream = null;
16-
const grantPermissions = async (constraints = {audio: true}) => {
23+
const stream = ref(null);
24+
const grantPermissions = async (evt, constraints = {audio: true, video: false}) => {
1725
try {
18-
stream = await navigator.mediaDevices.getUserMedia(constraints);
19-
for (const track of stream.getTracks()) {
20-
pc.addTrack(track, stream);
26+
console.log(constraints)
27+
stream.value= await navigator.mediaDevices.getUserMedia(constraints);
28+
for (const track of stream.value.getTracks()) {
29+
pc.addTrack(track, stream.value);
2130
}
31+
hasStream.value = true
2232
/* use the stream */
2333
} catch (err) {
2434
/* handle the error */
35+
console.log(err)
2536
}
2637
}
2738
const form = useForm({
@@ -194,6 +205,7 @@ onMounted(() => {
194205
<PrimaryButton
195206
class="ms-4"
196207
@click="grantPermissions"
208+
:v-show="hasStream"
197209
>
198210
Grant Permissions
199211
</PrimaryButton>

0 commit comments

Comments
 (0)