Skip to content

Commit

Permalink
video-player: Let the user know if selected stream is loading or not …
Browse files Browse the repository at this point in the history
…available
  • Loading branch information
rafaellehmkuhl authored and patrickelectric committed Feb 27, 2024
1 parent 7aa26ef commit c7c69ea
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/widgets/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
<div v-if="nameSelectedStream === undefined" class="no-video-alert">
<span>No video stream selected.</span>
</div>
<div v-else-if="!namesAvailableStreams.includes(nameSelectedStream)" class="no-video-alert">
<p>The selected stream is not available.</p>
<p>Please check its source or select another stream.</p>
</div>
<div v-else-if="mediaStream === undefined" class="no-video-alert">
<span>Loading stream...</span>
</div>
<video ref="videoElement" muted autoplay playsinline disablePictureInPicture>
Your browser does not support the video tag.
</video>
Expand Down Expand Up @@ -116,6 +123,10 @@ const streamConnectionRoutine = setInterval(() => {
if (!isEqual(updatedMediaStream, mediaStream.value)) {
mediaStream.value = updatedMediaStream
}
console.log('nameSelectedStream.value', nameSelectedStream.value)
console.log('mediaStream.value', mediaStream.value)
console.log('------------------')
}, 1000)
onBeforeUnmount(() => clearInterval(streamConnectionRoutine))
Expand Down

0 comments on commit c7c69ea

Please sign in to comment.