Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(nickname!==StumbleChat.Self.nick&&StumbleChat.Userlist.User){StumbleChat.WebSocket.send(`{"stumble":"nick","nick":"${document.getElementById("modal-text-input").value}"}`);Modal.Destroy();}}}};let Modal={Create:(Type,msg)=>{Modal.Destroy();StumbleChat.Chat.Status.ModalOpened=Type;document.getElementById('modal-back').classList.add("visible");Modal.Items[Type](msg);Modal.Center();},Destroy:()=>{StumbleChat.Chat.Status.AdjustingQueue=false;StumbleChat.Chat.Status.ModalOpened=-1;document.getElementById('modal-back').classList.remove('visible');document.getElementById('modal-exit').classList.remove('visible');},Center:()=>{let el=document.querySelector("#modal");if(el)el.style.marginTop=(window.innerHeight-el.offsetHeight)/2+'px';},Items:{0:()=>{document.getElementById('modal-back').classList.remove("visible");document.querySelector("#modal > #title > p").innerHTML=`MEDIA OPTIONS`;document.querySelector("#modal > span").innerHTML=`<div id="broadcast-wrapper"><video id="previewvideo" autoplay="" class="hidden" playsinline="">Your browser does not support the video tag...</video><select id="videoSelect"></select><select id="audioSelect"></select><p>FRAMERATE:</p><div class="framerate-wrapper"><input class="framerate-options" type="radio" id="framerate1" name="framerate" value="15" ${(StumbleChat.Chat.Settings.FrameRate==15)?'checked="checked"':""}"><label for="framerate1">15</label><input class="framerate-options" type="radio" id="framerate2" name="framerate" value="30" ${(StumbleChat.Chat.Settings.FrameRate==30)?'checked="checked"':""}"><label for="framerate2">30</label><input class="framerate-options" type="radio" id="framerate3" name="framerate" value="60" ${(StumbleChat.Chat.Settings.FrameRate==60)?'checked="checked"':""}"><label for="framerate3">60</label></div><p>RESOLUTION: </p><div class="resolution-wrapper"><input class="resolution-options" type="radio" id="resolution1" name="resolution" value="0" ${(StumbleChat.Chat.Settings.Resolution==0)?'checked="checked"':""}><label for="resolution1">352x240 (240p)</label><br><input class="resolution-options" type="radio" id="resolution2" name="resolution" value="1" ${(StumbleChat.Chat.Settings.Resolution==1)?'checked="checked"':""}><label for="resolution2">480x360 (360p)</label><br><input class="resolution-options" type="radio" id="resolution3" name="resolution" value="2" ${(StumbleChat.Chat.Settings.Resolution==2)?'checked="checked"':""}><label for="resolution3">858x480 (480p)</label><br><input class="resolution-options" type="radio" id="resolution4" name="resolution" value="3" ${(StumbleChat.Chat.Settings.Resolution==3)?'checked="checked"':""}><label for="resolution4">1280x720 (720p)</label> <br><input class="resolution-options" type="radio" id="resolution5" name="resolution" value="4" ${(StumbleChat.Chat.Settings.Resolution==4)?'checked="checked"':""}> <label for="resolution5">1920x1080 (1080p)</label> <br><input class="resolution-options" type="radio" id="resolution6" name="resolution" value="5" ${(StumbleChat.Chat.Settings.Resolution==5)?'checked="checked"':""}> <label for="resolution6">4096x2160 (4K)</label></div><p>ENHANCEMENTS:</p><div class="enhancement-wrapper"><input type="checkbox" id="enhancement1" name="enhancement" value="echoCancellation" ${(StumbleChat.Chat.Settings.EchoCancellation)?'checked="checked"':""}><label for="enhancement1">Echo Cancellation</label><br><input type="checkbox" id="enhancement2" name="enhancement" value="autoGainControl" ${(StumbleChat.Chat.Settings.AutoGainControl)?'checked="checked"':""}><label for="enhancement2">Auto Gain Control</label><br><input type="checkbox" id="enhancement3" name="enhancement" value="noiseSuppression" ${(StumbleChat.Chat.Settings.NoiseSupression)?'checked="checked"':""}><label for="enhancement3">Noise Supression</label></div><button id='broadcastsettings'>SAVE</button></div>`;navigator.mediaDevices.enumerateDevices().then((Devices)=>{createBroadcastItem(window.videoSelect,StumbleChat.Chat.Settings.videodevice,(StumbleChat.Chat.Settings.videodevice=="NONE"||StumbleChat.Chat.Settings.videodevice==null)?"NONE":"Saved Video Device");createBroadcastItem(window.audioSelect,StumbleChat.Chat.Settings.audiodevice,(StumbleChat.Chat.Settings.audiodevice=="NONE"||StumbleChat.Chat.Settings.audiodevice==null)?"NONE":"Saved Audio Device");if(StumbleChat.Chat.Settings.videodevice!="NONE")createBroadcastItem(window.videoSelect,"NONE","NONE");if(StumbleChat.Chat.Settings.audiodevice!="NONE")createBroadcastItem(window.audioSelect,"NONE","NONE");let audiocount=0;let videocount=0;for(let i=0;i!==Devices.length;++i){const deviceInfo=Devices[i];if(deviceInfo.kind==='audioinput'){createBroadcastItem(window.audioSelect,deviceInfo.deviceId,deviceInfo.label||`microphone ${++audiocount}`);}else if(deviceInfo.kind==='videoinput'){createBroadcastItem(window.videoSelect,deviceInfo.deviceId,deviceInfo.label||`camera ${++videocount}`);}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement