mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2025-02-22 16:05:03 +08:00
Add pause video button
This commit is contained in:
parent
478f67ec9a
commit
18bb31c529
@ -34,7 +34,7 @@
|
||||
<a href="/" class="round-button">Back</a>
|
||||
<a class="round-button" onclick="{openFullscreen()}">Fullscreen</a>
|
||||
<a class="round-button" onclick="{muteMicrophone()}" id="muteButton">Mute </a>
|
||||
<!-- <a class="round-button" onclick="{pauseVideo()}" id="videoPauseButton">Pause </a>-->
|
||||
<a class="round-button" onclick="{pauseVideo()}" id="videoPauseButton">Pause </a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -279,10 +279,10 @@ function openFullscreen() {
|
||||
|
||||
|
||||
function muteMicrophone() {
|
||||
var muted = !VideoChat.localStream.getAudioTracks()[0].enabled;
|
||||
VideoChat.localStream.getAudioTracks()[0].enabled = muted;
|
||||
var mutedButton = document.getElementById("muteButton");
|
||||
if (!muted) {
|
||||
var muted = VideoChat.localStream.getAudioTracks()[0].enabled;
|
||||
VideoChat.localStream.getAudioTracks()[0].enabled = !muted;
|
||||
const mutedButton = document.getElementById("muteButton");
|
||||
if (muted) {
|
||||
mutedButton.innerText = "Unmute"
|
||||
} else {
|
||||
mutedButton.innerText = "Mute"
|
||||
@ -290,9 +290,10 @@ function muteMicrophone() {
|
||||
}
|
||||
|
||||
function pauseVideo() {
|
||||
VideoChat.localStream.getVideoTracks()[0].enabled = !VideoChat.localStream.getVideoTracks()[0].enabled;
|
||||
var pausedButton = document.getElementById("videoPauseButton");
|
||||
if (!muted) {
|
||||
var paused = VideoChat.localStream.getVideoTracks()[0].enabled;
|
||||
VideoChat.localStream.getVideoTracks()[0].enabled = !paused;
|
||||
const pausedButton = document.getElementById("videoPauseButton");
|
||||
if (paused) {
|
||||
pausedButton.innerText = "Unpause"
|
||||
} else {
|
||||
pausedButton.innerText = "Pause"
|
||||
|
Loading…
x
Reference in New Issue
Block a user