mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Add "stream mode" as an option for WebRTC video.
This commit is contained in:
parent
c00883e267
commit
e4df1e24a3
@ -15,10 +15,9 @@ namespace Remotely.Desktop.Core.Models
|
||||
{
|
||||
public class Viewer : IDisposable
|
||||
{
|
||||
private readonly int defaultImageQuality = 60;
|
||||
private int imageQuality;
|
||||
private DateTimeOffset lastQualityAdjustment;
|
||||
private readonly int defaultImageQuality = 60;
|
||||
|
||||
public Viewer(CasterSocket casterSocket,
|
||||
IScreenCapturer screenCapturer,
|
||||
IClipboardService clipboardService,
|
||||
@ -68,6 +67,30 @@ namespace Remotely.Desktop.Core.Models
|
||||
}
|
||||
|
||||
public bool IsConnected => CasterSocket.IsConnected;
|
||||
public bool IsStalled
|
||||
{
|
||||
get
|
||||
{
|
||||
return PendingSentFrames.TryPeek(out var result) && DateTimeOffset.Now - result > TimeSpan.FromSeconds(15);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsUsingWebRtc
|
||||
{
|
||||
get
|
||||
{
|
||||
return RtcSession?.IsPeerConnected == true && RtcSession?.IsDataChannelOpen == true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsUsingWebRtcVideo
|
||||
{
|
||||
get
|
||||
{
|
||||
return RtcSession?.IsPeerConnected == true && RtcSession?.IsVideoTrackConnected == true;
|
||||
}
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public ConcurrentQueue<DateTimeOffset> PendingSentFrames { get; } = new ConcurrentQueue<DateTimeOffset>();
|
||||
public WebRtcSession RtcSession { get; set; }
|
||||
@ -106,31 +129,6 @@ namespace Remotely.Desktop.Core.Models
|
||||
Logger.Write(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsUsingWebRtcVideo
|
||||
{
|
||||
get
|
||||
{
|
||||
return RtcSession?.IsPeerConnected == true && RtcSession?.IsVideoTrackConnected == true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsStalled
|
||||
{
|
||||
get
|
||||
{
|
||||
return PendingSentFrames.TryPeek(out var result) && DateTimeOffset.Now - result > TimeSpan.FromSeconds(15);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsUsingWebRtc
|
||||
{
|
||||
get
|
||||
{
|
||||
return RtcSession?.IsPeerConnected == true && RtcSession?.IsDataChannelOpen == true;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SendAudioSample(byte[] audioSample)
|
||||
{
|
||||
await SendToViewer(() => RtcSession.SendAudioSample(audioSample),
|
||||
@ -203,7 +201,7 @@ namespace Remotely.Desktop.Core.Models
|
||||
ImageQuality = defaultImageQuality;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TaskHelper.DelayUntil(() => PendingSentFrames.Count < 5 &&
|
||||
(
|
||||
!PendingSentFrames.TryPeek(out var result) || DateTimeOffset.Now - result < TimeSpan.FromSeconds(1)
|
||||
@ -211,6 +209,10 @@ namespace Remotely.Desktop.Core.Models
|
||||
TimeSpan.MaxValue);
|
||||
}
|
||||
|
||||
public void ToggleWebRtcVideo(bool toggleOn)
|
||||
{
|
||||
RtcSession.ToggleWebRtcVideo(toggleOn);
|
||||
}
|
||||
private async void AudioCapturer_AudioSampleReady(object sender, byte[] sample)
|
||||
{
|
||||
await SendAudioSample(sample);
|
||||
|
||||
@ -435,6 +435,14 @@ namespace Remotely.Desktop.Core.Services
|
||||
}
|
||||
});
|
||||
|
||||
Connection.On("ToggleWebRtcVideo", (bool toggleOn, string viewerID) =>
|
||||
{
|
||||
if (conductor.Viewers.TryGetValue(viewerID, out var viewer))
|
||||
{
|
||||
viewer.ToggleWebRtcVideo(toggleOn);
|
||||
}
|
||||
});
|
||||
|
||||
Connection.On("TouchDown", (string viewerID) =>
|
||||
{
|
||||
if (conductor.Viewers.TryGetValue(viewerID, out var viewer) && viewer.HasControl)
|
||||
|
||||
@ -111,6 +111,9 @@ namespace Remotely.Desktop.Core.Services
|
||||
case BinaryDtoType.ToggleBlockInput:
|
||||
ToggleBlockInput(message);
|
||||
break;
|
||||
case BinaryDtoType.ToggleWebRtcVideo:
|
||||
ToggleWebRtcVideo(message);
|
||||
break;
|
||||
case BinaryDtoType.ClipboardTransfer:
|
||||
ClipboardTransfer(message);
|
||||
break;
|
||||
@ -180,6 +183,7 @@ namespace Remotely.Desktop.Core.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void KeyDown(byte[] message)
|
||||
{
|
||||
var dto = MessagePackSerializer.Deserialize<KeyDownDto>(message);
|
||||
@ -260,6 +264,7 @@ namespace Remotely.Desktop.Core.Services
|
||||
{
|
||||
KeyboardMouseInput.SetKeyStatesUp();
|
||||
}
|
||||
|
||||
private void Tap(byte[] message)
|
||||
{
|
||||
var dto = MessagePackSerializer.Deserialize<TapDto>(message);
|
||||
@ -278,5 +283,11 @@ namespace Remotely.Desktop.Core.Services
|
||||
var dto = MessagePackSerializer.Deserialize<ToggleBlockInputDto>(message);
|
||||
KeyboardMouseInput.ToggleBlockInput(dto.ToggleOn);
|
||||
}
|
||||
|
||||
private void ToggleWebRtcVideo(byte[] message)
|
||||
{
|
||||
var dto = MessagePackSerializer.Deserialize<ToggleWebRtcVideoDto>(message);
|
||||
Viewer.ToggleWebRtcVideo(dto.ToggleOn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,14 +28,6 @@ namespace Remotely.Desktop.Core.Services
|
||||
public ulong CurrentBuffer { get; private set; }
|
||||
public bool IsDataChannelOpen => CaptureChannel?.State == DataChannel.ChannelState.Open;
|
||||
public bool IsPeerConnected => PeerSession?.IsConnected == true;
|
||||
private DataChannel CaptureChannel { get; set; }
|
||||
private IceServerModel[] IceServers { get; set; }
|
||||
private PeerConnection PeerSession { get; set; }
|
||||
private IRtcMessageHandler RtcMessageHandler { get; }
|
||||
private Transceiver Transceiver { get; set; }
|
||||
private ExternalVideoTrackSource VideoSource { get; set; }
|
||||
private Viewer Viewer { get; }
|
||||
|
||||
public bool IsVideoTrackConnected
|
||||
{
|
||||
get
|
||||
@ -44,6 +36,13 @@ namespace Remotely.Desktop.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
private DataChannel CaptureChannel { get; set; }
|
||||
private IceServerModel[] IceServers { get; set; }
|
||||
private PeerConnection PeerSession { get; set; }
|
||||
private IRtcMessageHandler RtcMessageHandler { get; }
|
||||
private Transceiver Transceiver { get; set; }
|
||||
private ExternalVideoTrackSource VideoSource { get; set; }
|
||||
private Viewer Viewer { get; }
|
||||
public void AddIceCandidate(string sdpMid, int sdpMlineIndex, string candidate)
|
||||
{
|
||||
PeerSession.AddIceCandidate(new IceCandidate()
|
||||
@ -106,10 +105,6 @@ namespace Remotely.Desktop.Core.Services
|
||||
|
||||
VideoSource = ExternalVideoTrackSource.CreateFromArgb32Callback(GetCaptureFrame);
|
||||
Transceiver = PeerSession.AddTransceiver(MediaKind.Video);
|
||||
Transceiver.LocalVideoTrack = LocalVideoTrack.CreateFromSource(VideoSource, new LocalVideoTrackInitConfig()
|
||||
{
|
||||
trackName = "ScreenCapture"
|
||||
});
|
||||
|
||||
PeerSession.CreateOffer();
|
||||
}
|
||||
@ -195,12 +190,28 @@ namespace Remotely.Desktop.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggleWebRtcVideo(bool toggleOn)
|
||||
{
|
||||
if (Transceiver?.LocalVideoTrack != null)
|
||||
{
|
||||
Transceiver.LocalVideoTrack.Dispose();
|
||||
Transceiver.LocalVideoTrack = null;
|
||||
}
|
||||
|
||||
if (toggleOn)
|
||||
{
|
||||
Transceiver.LocalVideoTrack = LocalVideoTrack.CreateFromSource(VideoSource, new LocalVideoTrackInitConfig()
|
||||
{
|
||||
trackName = "ScreenCapture"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private async void CaptureChannel_MessageReceived(byte[] obj)
|
||||
{
|
||||
Logger.Debug($"DataChannel message received. Size: {obj.Length}");
|
||||
await RtcMessageHandler.ParseMessage(obj);
|
||||
}
|
||||
|
||||
private async void CaptureChannel_StateChanged()
|
||||
{
|
||||
Logger.Debug($"DataChannel state changed. New State: {CaptureChannel.State}");
|
||||
|
||||
@ -302,6 +302,11 @@ namespace Remotely.Server.Hubs
|
||||
{
|
||||
return CasterHubContext.Clients.Client(ScreenCasterID).SendAsync("ToggleBlockInput", toggleOn, Context.ConnectionId);
|
||||
}
|
||||
public Task SendToggleWebRtcVideo(bool toggleOn)
|
||||
{
|
||||
return CasterHubContext.Clients.Client(ScreenCasterID).SendAsync("ToggleWebRtcVideo", toggleOn, Context.ConnectionId);
|
||||
}
|
||||
|
||||
public Task Tap(double percentX, double percentY)
|
||||
{
|
||||
return CasterHubContext.Clients.Client(ScreenCasterID).SendAsync("Tap", percentX, percentY, Context.ConnectionId);
|
||||
|
||||
@ -94,14 +94,35 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button id="clipboardTransferButton" class="option-button">Clipboard <i class="fas fa-clipboard"></i></button>
|
||||
<button id="blockInputButton" class="option-button">Block Remote Input <i class="fas fa-mouse"></i></button>
|
||||
<button id="clipboardTransferButton" class="option-button" title="Type the current clipboard text on the remote computer.">
|
||||
Clipboard <i class="fas fa-clipboard"></i>
|
||||
</button>
|
||||
|
||||
<button id="blockInputButton" class="option-button" title="Prevent remote user from using keyboard and mouse.">
|
||||
Block Remote Input <i class="fas fa-mouse"></i>
|
||||
</button>
|
||||
|
||||
<button id="inviteButton" class="option-button">Invite Others <i class="fas fa-user-plus"></i></button>
|
||||
<button id="audioButton" class="option-button">Audio <i class="fas fa-volume-up"></i></button>
|
||||
<button id="fileTransferButton" class="option-button">File Transfer <i class="fas fa-file-upload"></i></button>
|
||||
<button id="ctrlAltDelButton" class="option-button">Ctrl+Alt+Del <i class="fas fa-sign-in-alt"></i></button>
|
||||
<button id="keyboardButton" hidden="hidden" class="option-button">Keyboard <i class="fas fa-keyboard"></i></button>
|
||||
<button id="disconnectButton" class="option-button">Disconnect <i class="fas fa-window-close"></i></button>
|
||||
|
||||
<button id="audioButton" class="option-button" title="Windows only. Stream the remote audio to the browser.">
|
||||
Audio <i class="fas fa-volume-up"></i>
|
||||
</button>
|
||||
|
||||
<button id="fileTransferButton" class="option-button" title="Transfer files to the remote computer.">
|
||||
File Transfer <i class="fas fa-file-upload"></i>
|
||||
</button>
|
||||
|
||||
<button id="ctrlAltDelButton" class="option-button" title="Simulate the Ctrl+Alt+Del command on the remote computer.">
|
||||
Ctrl+Alt+Del <i class="fas fa-sign-in-alt"></i>
|
||||
</button>
|
||||
|
||||
<button id="keyboardButton" hidden="hidden" class="option-button" title="Invoke the mobile touch keyboard.">
|
||||
Keyboard <i class="fas fa-keyboard"></i>
|
||||
</button>
|
||||
|
||||
<button id="disconnectButton" class="option-button" title="Disconnect from the current session.">
|
||||
Disconnect <i class="fas fa-window-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@ -110,9 +131,21 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button id="changeScreenButton" class="option-button">Monitors <i class="fas fa-desktop"></i></button>
|
||||
<button id="fitToScreenButton" class="toggled option-button">Fit <i class="fas fa-expand"></i></button>
|
||||
<button id="qualityButton" class="option-button">Quality <i class="far fa-image"></i></button>
|
||||
<button id="streamVideoButton" class="option-button" hidden title="Reduce bandwidth and increase FPS, but increase input delay.">
|
||||
Stream Mode <i class="fas fa-video"></i>
|
||||
</button>
|
||||
|
||||
<button id="changeScreenButton" class="option-button" title="Switch monitors on remote multi-monitor setups.">
|
||||
Monitors <i class="fas fa-desktop"></i>
|
||||
</button>
|
||||
|
||||
<button id="fitToScreenButton" class="toggled option-button" title="If toggled, will resize image to fit in the window.">
|
||||
Fit <i class="fas fa-expand"></i>
|
||||
</button>
|
||||
|
||||
<button id="qualityButton" class="option-button" title="Adjust the image quality when not in Stream Mode.">
|
||||
Quality <i class="far fa-image"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@ -121,8 +154,13 @@
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button id="recordSessionButton" class="option-button">Start <i class="fas fa-record-vinyl"></i></button>
|
||||
<button id="downloadRecordingButton" class="option-button">Download <i class="fas fa-download"></i></button>
|
||||
<button id="recordSessionButton" class="option-button" title="Record session as a WEBM video in the browser.">
|
||||
Start <i class="fas fa-record-vinyl"></i>
|
||||
</button>
|
||||
|
||||
<button id="downloadRecordingButton" class="option-button" title="Download the recorded session as a WEBM file.">
|
||||
Download <i class="fas fa-download"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="menu-options-header">
|
||||
@ -130,6 +168,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<select id="windowsSessionSelect"
|
||||
title="Switch to a different Windows session."
|
||||
class="option-button"
|
||||
style="height: 30px; width: 90%; margin: 5px 0;"></select>
|
||||
</div>
|
||||
|
||||
@ -26,5 +26,6 @@ export var BinaryDtoType;
|
||||
BinaryDtoType[BinaryDtoType["WindowsSessions"] = 23] = "WindowsSessions";
|
||||
BinaryDtoType[BinaryDtoType["SetKeyStatesUp"] = 24] = "SetKeyStatesUp";
|
||||
BinaryDtoType[BinaryDtoType["FrameReceived"] = 25] = "FrameReceived";
|
||||
BinaryDtoType[BinaryDtoType["ToggleWebRtcVideo"] = 26] = "ToggleWebRtcVideo";
|
||||
})(BinaryDtoType || (BinaryDtoType = {}));
|
||||
//# sourceMappingURL=BinaryDtoType.js.map
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"BinaryDtoType.js","sourceRoot":"","sources":["BinaryDtoType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aA2BX;AA3BD,WAAY,aAAa;IACrB,iEAAgB,CAAA;IAChB,6DAAc,CAAA;IACd,6DAAc,CAAA;IACd,+DAAe,CAAA;IACf,mEAAiB,CAAA;IACjB,+DAAe,CAAA;IACf,iEAAgB,CAAA;IAChB,iEAAgB,CAAA;IAChB,2DAAa,CAAA;IACb,2DAAa,CAAA;IACb,wDAAY,CAAA;IACZ,gDAAQ,CAAA;IACR,8DAAe,CAAA;IACf,wDAAY,CAAA;IACZ,oDAAU,CAAA;IACV,8DAAe,CAAA;IACf,4EAAsB,CAAA;IACtB,gEAAgB,CAAA;IAChB,0EAAqB,CAAA;IACrB,4EAAsB,CAAA;IACtB,0DAAa,CAAA;IACb,oEAAkB,CAAA;IAClB,kDAAS,CAAA;IACT,wEAAoB,CAAA;IACpB,sEAAmB,CAAA;IACnB,oEAAkB,CAAA;AACtB,CAAC,EA3BW,aAAa,KAAb,aAAa,QA2BxB"}
|
||||
{"version":3,"file":"BinaryDtoType.js","sourceRoot":"","sources":["BinaryDtoType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aA4BX;AA5BD,WAAY,aAAa;IACrB,iEAAgB,CAAA;IAChB,6DAAc,CAAA;IACd,6DAAc,CAAA;IACd,+DAAe,CAAA;IACf,mEAAiB,CAAA;IACjB,+DAAe,CAAA;IACf,iEAAgB,CAAA;IAChB,iEAAgB,CAAA;IAChB,2DAAa,CAAA;IACb,2DAAa,CAAA;IACb,wDAAY,CAAA;IACZ,gDAAQ,CAAA;IACR,8DAAe,CAAA;IACf,wDAAY,CAAA;IACZ,oDAAU,CAAA;IACV,8DAAe,CAAA;IACf,4EAAsB,CAAA;IACtB,gEAAgB,CAAA;IAChB,0EAAqB,CAAA;IACrB,4EAAsB,CAAA;IACtB,0DAAa,CAAA;IACb,oEAAkB,CAAA;IAClB,kDAAS,CAAA;IACT,wEAAoB,CAAA;IACpB,sEAAmB,CAAA;IACnB,oEAAkB,CAAA;IAClB,4EAAsB,CAAA;AAC1B,CAAC,EA5BW,aAAa,KAAb,aAAa,QA4BxB"}
|
||||
@ -24,5 +24,6 @@
|
||||
File = 22,
|
||||
WindowsSessions = 23,
|
||||
SetKeyStatesUp = 24,
|
||||
FrameReceived = 25
|
||||
FrameReceived = 25,
|
||||
ToggleWebRtcVideo = 26
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
import { AudioButton, ChangeScreenButton, HorizontalBars, ScreenSelectBar, ClipboardTransferButton, ClipboardTransferBar, TypeClipboardButton, ShowMessage, ConnectButton, CtrlAltDelButton, DisconnectButton, FileTransferButton, FileTransferInput, FitToScreenButton, ScreenViewer, BlockInputButton, InviteButton, KeyboardButton, TouchKeyboardTextArea, MenuFrame, MenuButton, QualityButton, QualityBar, QualitySlider, AutoQualityAdjustCheckBox, ScreenViewerWrapper, WindowsSessionSelect, RecordSessionButton, DownloadRecordingButton, VideoScreenViewer } from "./UI.js";
|
||||
import { AudioButton, ChangeScreenButton, HorizontalBars, ScreenSelectBar, ClipboardTransferButton, ClipboardTransferBar, TypeClipboardButton, ShowMessage, ConnectButton, CtrlAltDelButton, DisconnectButton, FileTransferButton, FileTransferInput, FitToScreenButton, ScreenViewer, BlockInputButton, InviteButton, KeyboardButton, TouchKeyboardTextArea, MenuFrame, MenuButton, QualityButton, QualityBar, QualitySlider, AutoQualityAdjustCheckBox, ScreenViewerWrapper, WindowsSessionSelect, RecordSessionButton, DownloadRecordingButton, VideoScreenViewer, StreamVideoButton } from "./UI.js";
|
||||
import { Sound } from "../Sound.js";
|
||||
import { MainRc } from "./Main.js";
|
||||
import { UploadFiles } from "./FileUploader.js";
|
||||
@ -95,9 +95,8 @@ export function ApplyInputHandlers() {
|
||||
}
|
||||
});
|
||||
BlockInputButton.addEventListener("click", (ev) => {
|
||||
var button = ev.currentTarget;
|
||||
button.classList.toggle("toggled");
|
||||
if (button.classList.contains("toggled")) {
|
||||
BlockInputButton.classList.toggle("toggled");
|
||||
if (BlockInputButton.classList.contains("toggled")) {
|
||||
MainRc.MessageSender.SendToggleBlockInput(true);
|
||||
}
|
||||
else {
|
||||
@ -150,6 +149,21 @@ export function ApplyInputHandlers() {
|
||||
QualitySlider.addEventListener("change", (ev) => {
|
||||
MainRc.MessageSender.SendQualityChange(Number(QualitySlider.value));
|
||||
});
|
||||
StreamVideoButton.addEventListener("click", (ev) => {
|
||||
StreamVideoButton.classList.toggle("toggled");
|
||||
if (StreamVideoButton.classList.contains("toggled")) {
|
||||
MainRc.MessageSender.SendToggleWebRtcVideo(true);
|
||||
VideoScreenViewer.removeAttribute("hidden");
|
||||
ScreenViewer.setAttribute("hidden", "hidden");
|
||||
QualityButton.setAttribute("hidden", "hidden");
|
||||
}
|
||||
else {
|
||||
MainRc.MessageSender.SendToggleWebRtcVideo(false);
|
||||
ScreenViewer.removeAttribute("hidden");
|
||||
QualityButton.removeAttribute("hidden");
|
||||
VideoScreenViewer.setAttribute("hidden", "hidden");
|
||||
}
|
||||
});
|
||||
AutoQualityAdjustCheckBox.addEventListener("change", ev => {
|
||||
MainRc.MessageSender.SendAutoQualityAdjust(AutoQualityAdjustCheckBox.checked);
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
import { MainRc } from "./Main.js";
|
||||
import { CtrlAltDelDto, KeyDownDto, KeyPressDto, KeyUpDto, MouseDownDto, MouseMoveDto, MouseUpDto, MouseWheelDto, QualityChangeDto, SelectScreenDto, TapDto, AutoQualityAdjustDto, ToggleAudioDto, ToggleBlockInputDto, ClipboardTransferDto, FileDto, WindowsSessionsDto, GenericDto } from "./RtcDtos.js";
|
||||
import { CtrlAltDelDto, KeyDownDto, KeyPressDto, KeyUpDto, MouseDownDto, MouseMoveDto, MouseUpDto, MouseWheelDto, QualityChangeDto, SelectScreenDto, TapDto, AutoQualityAdjustDto, ToggleAudioDto, ToggleBlockInputDto, ClipboardTransferDto, FileDto, WindowsSessionsDto, GenericDto, ToggleWebRtcVideoDto } from "./RtcDtos.js";
|
||||
import { CreateGUID, When } from "../Utilities.js";
|
||||
import { FileTransferProgress } from "./UI.js";
|
||||
import { BinaryDtoType } from "../Enums/BinaryDtoType.js";
|
||||
@ -75,6 +75,9 @@ export class MessageSender {
|
||||
SendToggleBlockInput(toggleOn) {
|
||||
this.SendToAgent(() => MainRc.RtcSession.SendDto(new ToggleBlockInputDto(toggleOn)), () => MainRc.RCHubConnection.SendToggleBlockInput(toggleOn));
|
||||
}
|
||||
SendToggleWebRtcVideo(toggleOn) {
|
||||
this.SendToAgent(() => MainRc.RtcSession.SendDto(new ToggleWebRtcVideoDto(toggleOn)), () => MainRc.RCHubConnection.SendToggleWebRtcVideo(toggleOn));
|
||||
}
|
||||
SendClipboardTransfer(text, typeText) {
|
||||
this.SendToAgent(() => MainRc.RtcSession.SendDto(new ClipboardTransferDto(text, typeText)), () => MainRc.RCHubConnection.SendClipboardTransfer(text, typeText));
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -17,7 +17,8 @@ import {
|
||||
ClipboardTransferDto,
|
||||
FileDto,
|
||||
WindowsSessionsDto,
|
||||
GenericDto
|
||||
GenericDto,
|
||||
ToggleWebRtcVideoDto
|
||||
} from "./RtcDtos.js";
|
||||
import { CreateGUID, When } from "../Utilities.js";
|
||||
import { FileTransferProgress } from "./UI.js";
|
||||
@ -120,6 +121,10 @@ export class MessageSender {
|
||||
this.SendToAgent(() => MainRc.RtcSession.SendDto(new ToggleBlockInputDto(toggleOn)),
|
||||
() => MainRc.RCHubConnection.SendToggleBlockInput(toggleOn));
|
||||
}
|
||||
SendToggleWebRtcVideo(toggleOn: boolean) {
|
||||
this.SendToAgent(() => MainRc.RtcSession.SendDto(new ToggleWebRtcVideoDto(toggleOn)),
|
||||
() => MainRc.RCHubConnection.SendToggleWebRtcVideo(toggleOn));
|
||||
}
|
||||
SendClipboardTransfer(text: string, typeText: boolean) {
|
||||
this.SendToAgent(() => MainRc.RtcSession.SendDto(new ClipboardTransferDto(text, typeText)),
|
||||
() => MainRc.RCHubConnection.SendClipboardTransfer(text, typeText));
|
||||
|
||||
@ -129,6 +129,9 @@ export class RCHubConnection {
|
||||
SendToggleBlockInput(toggleOn) {
|
||||
this.Connection.invoke("SendToggleBlockInput", toggleOn);
|
||||
}
|
||||
SendToggleWebRtcVideo(toggleOn) {
|
||||
this.Connection.invoke("SendToggleWebRtcVideo", toggleOn);
|
||||
}
|
||||
SendClipboardTransfer(text, typeText) {
|
||||
this.Connection.invoke("SendClipboardTransfer", text, typeText);
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -146,6 +146,9 @@ export class RCHubConnection {
|
||||
SendToggleBlockInput(toggleOn: boolean) {
|
||||
this.Connection.invoke("SendToggleBlockInput", toggleOn);
|
||||
}
|
||||
SendToggleWebRtcVideo(toggleOn: boolean) {
|
||||
this.Connection.invoke("SendToggleWebRtcVideo", toggleOn);
|
||||
}
|
||||
SendClipboardTransfer(text: string, typeText: boolean) {
|
||||
this.Connection.invoke("SendClipboardTransfer", text, typeText);
|
||||
}
|
||||
|
||||
@ -112,6 +112,12 @@ export class ToggleBlockInputDto {
|
||||
this.ToggleOn = toggleOn;
|
||||
}
|
||||
}
|
||||
export class ToggleWebRtcVideoDto {
|
||||
constructor(toggleOn) {
|
||||
this.DtoType = BinaryDtoType.ToggleWebRtcVideo;
|
||||
this.ToggleOn = toggleOn;
|
||||
}
|
||||
}
|
||||
export class WindowsSessionsDto {
|
||||
constructor() {
|
||||
this.DtoType = BinaryDtoType.WindowsSessions;
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"RtcDtos.js","sourceRoot":"","sources":["RtcDtos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAI1D,MAAM,OAAO,oBAAoB;IAC7B,YAAY,IAAa;QAKzB,YAAO,GAAkB,aAAa,CAAC,iBAAiB,CAAC;QAJrD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CAIJ;AAsBD,MAAM,OAAO,oBAAoB;IAC7B,YAAY,IAAY,EAAE,QAAgB;QAO1C,YAAO,GAAkB,aAAa,CAAC,iBAAiB,CAAC;QANrD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;CAKJ;AAGD,MAAM,OAAO,aAAa;IAA1B;QACI,YAAO,GAAkB,aAAa,CAAC,UAAU,CAAC;IACtD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,GAAkB,aAAa,CAAC,gBAAgB,CAAC;QAJpD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;CAIJ;AAED,MAAM,OAAO,oBAAoB;IAC7B,YAAY,QAAiB;QAK7B,YAAO,GAAkB,aAAa,CAAC,iBAAiB,CAAC;QAJrD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;CAIJ;AAGD,MAAM,OAAO,kBAAkB;IAA/B;QAGI,YAAO,GAAkB,aAAa,CAAC,eAAe,CAAC;IAC3D,CAAC;CAAA;AAED,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACnB,mDAAW,CAAA;IACX,2CAAO,CAAA;AACX,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,MAAM,OAAO,cAAc;CAK1B"}
|
||||
@ -221,6 +221,16 @@ export class ToggleBlockInputDto implements BinaryDto {
|
||||
DtoType: BinaryDtoType = BinaryDtoType.ToggleBlockInput;
|
||||
}
|
||||
|
||||
export class ToggleWebRtcVideoDto implements BinaryDto {
|
||||
constructor(toggleOn: boolean) {
|
||||
this.ToggleOn = toggleOn;
|
||||
}
|
||||
|
||||
ToggleOn: boolean;
|
||||
DtoType: BinaryDtoType = BinaryDtoType.ToggleWebRtcVideo;
|
||||
}
|
||||
|
||||
|
||||
export class WindowsSessionsDto implements BinaryDto {
|
||||
|
||||
WindowsSessions: Array<WindowsSession>;
|
||||
|
||||
@ -23,11 +23,19 @@ export class RtcSession {
|
||||
console.log("Data channel closed.");
|
||||
UI.ConnectionP2PIcon.style.display = "none";
|
||||
UI.ConnectionRelayedIcon.style.display = "unset";
|
||||
UI.StreamVideoButton.setAttribute("hidden", "hidden");
|
||||
UI.ScreenViewer.removeAttribute("hidden");
|
||||
UI.QualityButton.removeAttribute("hidden");
|
||||
UI.VideoScreenViewer.setAttribute("hidden", "hidden");
|
||||
};
|
||||
this.DataChannel.onerror = (ev) => {
|
||||
console.log("Data channel error.", ev.error);
|
||||
UI.ConnectionP2PIcon.style.display = "none";
|
||||
UI.ConnectionRelayedIcon.style.display = "unset";
|
||||
UI.StreamVideoButton.setAttribute("hidden", "hidden");
|
||||
UI.ScreenViewer.removeAttribute("hidden");
|
||||
UI.QualityButton.removeAttribute("hidden");
|
||||
UI.VideoScreenViewer.setAttribute("hidden", "hidden");
|
||||
};
|
||||
this.DataChannel.onmessage = async (ev) => {
|
||||
var data = ev.data;
|
||||
@ -37,6 +45,7 @@ export class RtcSession {
|
||||
console.log("Data channel opened.");
|
||||
UI.ConnectionP2PIcon.style.display = "unset";
|
||||
UI.ConnectionRelayedIcon.style.display = "none";
|
||||
UI.StreamVideoButton.removeAttribute("hidden");
|
||||
};
|
||||
};
|
||||
this.PeerConnection.onconnectionstatechange = function (ev) {
|
||||
@ -52,9 +61,9 @@ export class RtcSession {
|
||||
UI.VideoScreenViewer.play();
|
||||
};
|
||||
this.PeerConnection.ontrack = (event) => {
|
||||
UI.VideoScreenViewer.srcObject = new MediaStream([event.track]);
|
||||
UI.VideoScreenViewer.removeAttribute("hidden");
|
||||
UI.ScreenViewer.setAttribute("hidden", "hidden");
|
||||
if (event.track) {
|
||||
UI.VideoScreenViewer.srcObject = new MediaStream([event.track]);
|
||||
}
|
||||
};
|
||||
}
|
||||
Disconnect() {
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"RtcSession.js","sourceRoot":"","sources":["RtcSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,MAAM,OAAO,UAAU;IAAvB;QAGI,gBAAW,GAAQ,MAAM,CAAC,aAAa,CAAC,CAAC;IA6E7C,CAAC;IA5EG,IAAI,CAAC,UAA4B;QAE7B,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAiB,CAAC;YACxC,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAC3B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AC,GAAG,CAAC,CAAC,CAAC;IACxD,CAAC;CACJ"}
|
||||
@ -28,11 +28,21 @@ export class RtcSession {
|
||||
console.log("Data channel closed.");
|
||||
UI.ConnectionP2PIcon.style.display = "none";
|
||||
UI.ConnectionRelayedIcon.style.display = "unset";
|
||||
|
||||
UI.StreamVideoButton.setAttribute("hidden", "hidden");
|
||||
UI.ScreenViewer.removeAttribute("hidden");
|
||||
UI.QualityButton.removeAttribute("hidden");
|
||||
UI.VideoScreenViewer.setAttribute("hidden", "hidden");
|
||||
};
|
||||
this.DataChannel.onerror = (ev) => {
|
||||
console.log("Data channel error.", ev.error);
|
||||
UI.ConnectionP2PIcon.style.display = "none";
|
||||
UI.ConnectionRelayedIcon.style.display = "unset";
|
||||
|
||||
UI.StreamVideoButton.setAttribute("hidden", "hidden");
|
||||
UI.ScreenViewer.removeAttribute("hidden");
|
||||
UI.QualityButton.removeAttribute("hidden");
|
||||
UI.VideoScreenViewer.setAttribute("hidden", "hidden");
|
||||
};
|
||||
this.DataChannel.onmessage = async (ev) => {
|
||||
var data = ev.data as ArrayBuffer;
|
||||
@ -43,6 +53,8 @@ export class RtcSession {
|
||||
console.log("Data channel opened.");
|
||||
UI.ConnectionP2PIcon.style.display = "unset";
|
||||
UI.ConnectionRelayedIcon.style.display = "none";
|
||||
|
||||
UI.StreamVideoButton.removeAttribute("hidden");
|
||||
};
|
||||
};
|
||||
this.PeerConnection.onconnectionstatechange = function (ev) {
|
||||
@ -60,9 +72,9 @@ export class RtcSession {
|
||||
UI.VideoScreenViewer.play();
|
||||
}
|
||||
this.PeerConnection.ontrack = (event) => {
|
||||
UI.VideoScreenViewer.srcObject = new MediaStream([event.track]);
|
||||
UI.VideoScreenViewer.removeAttribute("hidden");
|
||||
UI.ScreenViewer.setAttribute("hidden", "hidden");
|
||||
if (event.track) {
|
||||
UI.VideoScreenViewer.srcObject = new MediaStream([event.track]);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ export var ActionsBar = document.getElementById("actionsBar");
|
||||
export var ViewBar = document.getElementById("viewBar");
|
||||
export var ChangeScreenButton = document.getElementById("changeScreenButton");
|
||||
export var QualityButton = document.getElementById("qualityButton");
|
||||
export var StreamVideoButton = document.getElementById("streamVideoButton");
|
||||
export var FitToScreenButton = document.getElementById("fitToScreenButton");
|
||||
export var BlockInputButton = document.getElementById("blockInputButton");
|
||||
export var DisconnectButton = document.getElementById("disconnectButton");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -23,6 +23,7 @@ export var ActionsBar = document.getElementById("actionsBar") as HTMLDivElement;
|
||||
export var ViewBar = document.getElementById("viewBar") as HTMLDivElement;
|
||||
export var ChangeScreenButton = document.getElementById("changeScreenButton") as HTMLButtonElement;
|
||||
export var QualityButton = document.getElementById("qualityButton") as HTMLButtonElement;
|
||||
export var StreamVideoButton = document.getElementById("streamVideoButton") as HTMLButtonElement;
|
||||
export var FitToScreenButton = document.getElementById("fitToScreenButton") as HTMLButtonElement;
|
||||
export var BlockInputButton = document.getElementById("blockInputButton") as HTMLButtonElement;
|
||||
export var DisconnectButton = document.getElementById("disconnectButton") as HTMLButtonElement;
|
||||
|
||||
@ -56,6 +56,8 @@ namespace Remotely.Shared.Enums
|
||||
[EnumMember(Value = "SetKeyStatesUp")]
|
||||
SetKeyStatesUp = 24,
|
||||
[EnumMember(Value = "FrameReceived")]
|
||||
FrameReceived = 25
|
||||
FrameReceived = 25,
|
||||
[EnumMember(Value = "ToggleWebRtcVideo")]
|
||||
ToggleWebRtcVideo = 26
|
||||
}
|
||||
}
|
||||
|
||||
18
Shared/Models/RtcDtos/ToggleWebRtcVideoDto.cs
Normal file
18
Shared/Models/RtcDtos/ToggleWebRtcVideoDto.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Remotely.Shared.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
|
||||
namespace Remotely.Shared.Models.RtcDtos
|
||||
{
|
||||
[DataContract]
|
||||
public class ToggleWebRtcVideoDto : BinaryDtoBase
|
||||
{
|
||||
[DataMember(Name = "ToggleOn")]
|
||||
public bool ToggleOn { get; set; }
|
||||
|
||||
[DataMember(Name = "DtoType")]
|
||||
public new BinaryDtoType DtoType { get; } = BinaryDtoType.ToggleWebRtcVideo;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user