Auto stash before merge of "main" and "origin/main"
This commit is contained in:
@@ -479,15 +479,17 @@ public partial class MainPage : ContentPage
|
||||
|
||||
public async Task AnswerCallback(RtcDescription answer)
|
||||
{
|
||||
string json = JsonSerializer.Serialize(answer);
|
||||
SafeSendRawToWebView("WriteRtcAnswer answered with: " + json);
|
||||
var test = new RtcDescription{type="answer", sdp = "Long\r\n string of data"};
|
||||
test.sdp = test.sdp.Replace("\r\n", "(rn)");
|
||||
// SafeSendRawToWebView("TEST: " + test);
|
||||
answer.sdp = answer.sdp.Replace("\r\n", "(rn)");
|
||||
string json = JsonSerializer.Serialize(test, HybridJSType.Default.RtcDescription);
|
||||
SafeSendRawToWebView("JSON: " + json);
|
||||
|
||||
try
|
||||
{
|
||||
SafeSendRawToWebView("Pre");
|
||||
// await hybridWebView.InvokeJavaScriptAsync("CSharpCallTest", ["value from C#"], [HybridJSTypeString.Default.String]);
|
||||
// SafeSendRawToWebView("Mid");
|
||||
await hybridWebView.InvokeJavaScriptAsync("AnswerCallback", [json], [HybridJSTypeString.Default.String]);
|
||||
SafeSendRawToWebView("End");
|
||||
await hybridWebView.InvokeJavaScriptAsync("AnswerCallbackJS", [answer], [HybridJSType.Default.RtcDescription]);
|
||||
SafeSendRawToWebView("After JS");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -582,16 +584,11 @@ public partial class MainPage : ContentPage
|
||||
});
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(string))]
|
||||
internal partial class HybridJSTypeString : JsonSerializerContext
|
||||
{
|
||||
// This type's attributes specify JSON serialization info to preserve type structure
|
||||
// for trimmed builds.
|
||||
}
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSourceGenerationOptions(WriteIndented = false)]
|
||||
[JsonSerializable(typeof(RtcDescription))]
|
||||
internal partial class HybridJSTypeRtcDescription : JsonSerializerContext
|
||||
[JsonSerializable(typeof(List<RtcSignalMessage>))]
|
||||
[JsonSerializable(typeof(string))]
|
||||
internal partial class HybridJSType : JsonSerializerContext
|
||||
{
|
||||
// This type's attributes specify JSON serialization info to preserve type structure
|
||||
// for trimmed builds.
|
||||
|
||||
@@ -85,5 +85,5 @@ textarea::-webkit-scrollbar-thumb {
|
||||
background: #1F1A24;
|
||||
border: 1px solid #332940;
|
||||
border-radius: 10px;
|
||||
padding: 11px;
|
||||
padding: 12px;
|
||||
}
|
||||
@@ -262,17 +262,22 @@ async function channelCallJoin(activeCall)
|
||||
async function CSharpCallTest(value)
|
||||
{
|
||||
LogMessage("Called from C#: " + value);
|
||||
// let test = JSON.parse(value);
|
||||
// LogMessage("JSON : " + JSON.stringify(test));
|
||||
}
|
||||
async function AnswerCallback(answer)
|
||||
async function AnswerCallbackJS(answer)
|
||||
{
|
||||
LogMessage("Answer: " + answer);
|
||||
answer.sdp = answer.sdp.replaceAll("(rn)", "\r\n");
|
||||
// answer.sdp += "\n";
|
||||
LogMessage("Answer: " + JSON.stringify(answer));
|
||||
|
||||
let callBack = JSON.parse(answer);
|
||||
LogMessage("Call Back: " + callBack);
|
||||
// let callBack = JSON.parse(answer);
|
||||
// LogMessage("Call Back: " + callBack);
|
||||
LogMessage("RemoteDescription: " + peerConnection.currentRemoteDescription);
|
||||
|
||||
if (!peerConnection.currentRemoteDescription && callBack)
|
||||
if (!peerConnection.currentRemoteDescription && answer)
|
||||
{
|
||||
LogMessage("Current answer: " + callBack);
|
||||
LogMessage("Current answer: " + JSON.stringify(answer));
|
||||
const desc = new RTCSessionDescription(answer);
|
||||
await peerConnection.setRemoteDescription(desc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user