Skip to content

Commit

Permalink
Merge pull request #886 from CodeCrowCorp/dev
Browse files Browse the repository at this point in the history
Fix: autoplay unmuted videos
  • Loading branch information
gagansuie authored Jan 26, 2024
2 parents 6f5e882 + 4defc7d commit df36a9c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/lib/components/Channel/Stream/VideoItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@
webrtcWhep = new WHEPClient(video.webRTCPlayback.url, webrtc_video_element)
webrtcWhep.addEventListener(`isScreenLive`, (ev: any) => {
isScreenLive = ev.detail
webrtc_video_element.play()
})
webrtcWhep.addEventListener(`localAudioSpeakingValue`, (ev: any) => {
speakingValue = ev.detail
Expand Down Expand Up @@ -360,9 +359,20 @@
<audio bind:this={audio_element} autoplay class="rounded-md w-0 h-0" />
<canvas bind:this={webrtc_canvas_element} class="rounded-md w-full h-full hidden" />
{:else}
<video bind:this={webrtc_video_element} class="rounded-md w-full h-full" autoplay />
<iframe
src="https://olafwempe.com/mp3/silence/silence.mp3"
allow="autoplay"
id="audio"
style="display:none" />
<video
bind:this={webrtc_video_element}
class="rounded-md w-full h-full {video.isConnected && video.trackType === 'webrtc'
? ''
: 'hidden'}"
autoplay
controls />
{/if}
<div class="absolute left-2 bottom-2 rounded-md dropdown {iframeUrl ? 'mb-16' : ''}">
<div class="absolute left-2 bottom-2 rounded-md dropdown {video.isConnected ? 'mb-16' : ''}">
<label
tabindex="0"
class="{coloredRole.textColor} bg-base-100 btn btn-sm normal-case flex gap-1 {speakingValue >
Expand Down

0 comments on commit df36a9c

Please sign in to comment.