mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2025-02-23 00:15:04 +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 href="/" class="round-button">Back</a>
|
||||||
<a class="round-button" onclick="{openFullscreen()}">Fullscreen</a>
|
<a class="round-button" onclick="{openFullscreen()}">Fullscreen</a>
|
||||||
<a class="round-button" onclick="{muteMicrophone()}" id="muteButton">Mute </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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -279,10 +279,10 @@ function openFullscreen() {
|
|||||||
|
|
||||||
|
|
||||||
function muteMicrophone() {
|
function muteMicrophone() {
|
||||||
var muted = !VideoChat.localStream.getAudioTracks()[0].enabled;
|
var muted = VideoChat.localStream.getAudioTracks()[0].enabled;
|
||||||
VideoChat.localStream.getAudioTracks()[0].enabled = muted;
|
VideoChat.localStream.getAudioTracks()[0].enabled = !muted;
|
||||||
var mutedButton = document.getElementById("muteButton");
|
const mutedButton = document.getElementById("muteButton");
|
||||||
if (!muted) {
|
if (muted) {
|
||||||
mutedButton.innerText = "Unmute"
|
mutedButton.innerText = "Unmute"
|
||||||
} else {
|
} else {
|
||||||
mutedButton.innerText = "Mute"
|
mutedButton.innerText = "Mute"
|
||||||
@ -290,9 +290,10 @@ function muteMicrophone() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function pauseVideo() {
|
function pauseVideo() {
|
||||||
VideoChat.localStream.getVideoTracks()[0].enabled = !VideoChat.localStream.getVideoTracks()[0].enabled;
|
var paused = VideoChat.localStream.getVideoTracks()[0].enabled;
|
||||||
var pausedButton = document.getElementById("videoPauseButton");
|
VideoChat.localStream.getVideoTracks()[0].enabled = !paused;
|
||||||
if (!muted) {
|
const pausedButton = document.getElementById("videoPauseButton");
|
||||||
|
if (paused) {
|
||||||
pausedButton.innerText = "Unpause"
|
pausedButton.innerText = "Unpause"
|
||||||
} else {
|
} else {
|
||||||
pausedButton.innerText = "Pause"
|
pausedButton.innerText = "Pause"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user