Skip to content

Commit 2e548c6

Browse files
committed
Remove http server as it's unused
1 parent 126ecd3 commit 2e548c6

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

Telegram/App.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public App()
7777
}
7878

7979
WatchDog.Initialize();
80-
MediaHttpServer.Start();
8180
TypeResolver.Current.Configure();
8281

8382
RequestedTheme = SettingsService.Current.Appearance.GetCalculatedApplicationTheme();

Telegram/Common/VideoPreloader.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
using Telegram.Native.Media;
1414
using Telegram.Navigation;
1515
using Telegram.Services;
16+
using Telegram.Streams;
1617
using Telegram.Td.Api;
1718

1819
namespace Telegram.Common
1920
{
20-
public record VideoPresentation(int SessionId, int FileId, int Duration);
21+
public record VideoPresentation(IClientService ClientService, File File, int Duration);
2122

2223
public partial class VideoPreloader
2324
{
@@ -60,7 +61,7 @@ public void Load(IClientService clientService, File file, int duration)
6061
return;
6162
}
6263

63-
var presentation = new VideoPresentation(clientService.SessionId, file.Id, duration);
64+
var presentation = new VideoPresentation(clientService, file, duration);
6465

6566
_presenters[token] = presentation;
6667
_workQueue.Push(new WorkItem(token, presentation));
@@ -106,8 +107,6 @@ private void Work()
106107

107108
private void LoadCachedVideo(WorkItem work)
108109
{
109-
var token = 0L;
110-
111110
var options = new AsyncMediaPlayerOptions
112111
{
113112
Mode = AsyncMediaPlayerMode.Video
@@ -122,12 +121,11 @@ void handler(AsyncMediaPlayer sender, AsyncMediaPlayerBufferingEventArgs e)
122121
player.Close();
123122

124123
_presenters.TryRemove(work.Token, out _);
125-
MediaHttpServer.Stop(ref token);
126124
}
127125
}
128126

129127
player.Buffering += handler;
130-
player.Play(MediaHttpServer.Start(work.Presentation, ref token));
128+
player.Play(new RemoteFileSource(work.Presentation.ClientService, work.Presentation.File, work.Presentation.Duration));
131129
}
132130

133131
record WorkItem(long Token, VideoPresentation Presentation);

Telegram/Telegram.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,9 @@
215215
<Compile Include="Common\DebouncedPropertyWithToken.cs" />
216216
<Compile Include="Common\FeatureTokenGenerator.cs" />
217217
<Compile Include="Collections\HashSetDictionary.cs" />
218-
<Compile Include="Common\HttpServer.cs" />
219218
<Compile Include="Common\MediaDeviceTracker.cs" />
220219
<Compile Include="Common\MediaDeviceList.cs" />
221220
<Compile Include="Common\MediaDevicePermissions.cs" />
222-
<Compile Include="Common\MediaHttpServer.cs" />
223221
<Compile Include="Common\SliderHelper.cs" />
224222
<Compile Include="Common\ThemeShadowEx.cs" />
225223
<Compile Include="Common\NormalizingStringBuilder.cs" />

0 commit comments

Comments
 (0)