Skip to content

Commit

Permalink
video-player: Let the user know if we chose a stream randomly among m…
Browse files Browse the repository at this point in the history
…any available
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Feb 27, 2024
1 parent ace2e0b commit bfecd2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/widgets/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@

<script setup lang="ts">
import { storeToRefs } from 'pinia'
import Swal from 'sweetalert2'
import { computed, onBeforeMount, onBeforeUnmount, ref, toRefs, watch } from 'vue'
import { isEqual } from '@/libs/utils'
Expand Down Expand Up @@ -101,6 +102,13 @@ const streamConnectionRoutine = setInterval(() => {
if (widget.value.options.streamName === undefined && !namesAvailableStreams.value.isEmpty()) {
widget.value.options.streamName = namesAvailableStreams.value[0]
nameSelectedStream.value = widget.value.options.streamName
// If there are multiple streams available, warn user that we chose one automatically and he should change if wanted
if (namesAvailableStreams.value.length > 1) {
const text = `You have multiple streams available, so we chose one randomly to start with.
If you want to change it, please open the widget configuration on the edit-menu.`
Swal.fire({ title: 'Multiple streams detected', text: text, icon: 'info', confirmButtonText: 'OK' })
}
}
const updatedMediaStream = videoStore.getMediaStream(widget.value.options.streamName)
Expand Down

0 comments on commit bfecd2c

Please sign in to comment.