Classroom Videoplayer kısımları düzeltildi2
This commit is contained in:
parent
d1ae106db7
commit
42694bf681
5 changed files with 19 additions and 3 deletions
|
|
@ -8,7 +8,7 @@ using Microsoft.Extensions.Logging;
|
|||
using Volo.Abp.Guids;
|
||||
using Volo.Abp.Users;
|
||||
|
||||
namespace Kurs.Platform.SignalR.Hubs;
|
||||
namespace Kurs.Platform.Classrooms;
|
||||
|
||||
[Authorize]
|
||||
public class ClassroomHub : Hub
|
||||
|
|
@ -363,7 +363,7 @@ public class ClassroomHub : Hub
|
|||
[HubMethodName("SendOffer")]
|
||||
public async Task SendOfferAsync(Guid sessionId, Guid targetUserId, object offer)
|
||||
{
|
||||
// Tek hedef kullanıcıya gönderiyoruz
|
||||
_logger.LogInformation("➡️ SendOffer to {TargetUserId}, from {CurrentUser}", targetUserId, _currentUser.Id);
|
||||
await Clients.User(targetUserId.ToString())
|
||||
.SendAsync("ReceiveOffer", _currentUser.Id?.ToString(), offer);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
using Microsoft.AspNetCore.SignalR;
|
||||
|
||||
namespace Kurs.Platform.Classrooms;
|
||||
|
||||
public class CustomUserIdProvider : IUserIdProvider
|
||||
{
|
||||
public string GetUserId(HubConnectionContext connection)
|
||||
{
|
||||
return connection.User?.FindFirst("sub")?.Value;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,10 +8,10 @@ using Kurs.Languages;
|
|||
using Kurs.MailQueue;
|
||||
using Kurs.Notifications.Application;
|
||||
using Kurs.Platform.BlobStoring;
|
||||
using Kurs.Platform.Classrooms;
|
||||
using Kurs.Platform.EntityFrameworkCore;
|
||||
using Kurs.Platform.Extensions;
|
||||
using Kurs.Platform.Identity;
|
||||
using Kurs.Platform.SignalR.Hubs;
|
||||
using Kurs.Settings;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Kurs.Platform.Classrooms;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
|
@ -139,6 +141,8 @@ public class Program
|
|||
});
|
||||
});
|
||||
|
||||
builder.Services.AddSingleton<IUserIdProvider, CustomUserIdProvider>();
|
||||
|
||||
var app = builder.Build();
|
||||
app.UseCors("Dynamic");
|
||||
await app.InitializeApplicationAsync();
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ function useAuth() {
|
|||
email: tokenDetails?.email,
|
||||
authority: [tokenDetails?.role],
|
||||
name: `${tokenDetails?.given_name} ${tokenDetails?.family_name}`.trim(),
|
||||
role: 'teacher',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue