Skip to content

Commit f220d94

Browse files
Remove Unused Code
1 parent 7b8c395 commit f220d94

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

samples/CommunityToolkit.Maui.Sample/Pages/Views/MediaElement/MediaElementPage.xaml.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ async void DisplayPopup(object sender, EventArgs e)
272272
source = MediaSource.FromResource("WindowsVideo.mp4");
273273
}
274274

275-
var artworkFilePath = await GetFilePath("dotnet_bot.png");
276-
277275
var popupMediaElement = new MediaElement
278276
{
279277
AndroidViewType = AndroidViewType.SurfaceView,
@@ -288,28 +286,4 @@ async void DisplayPopup(object sender, EventArgs e)
288286
popupMediaElement.Stop();
289287
popupMediaElement.Source = null;
290288
}
291-
292-
async Task<string> GetFilePath(string fileName)
293-
{
294-
if (!await fileSystem.AppPackageFileExistsAsync(fileName))
295-
{
296-
throw new FileNotFoundException($"File not found: {fileName}");
297-
}
298-
299-
// Extract to cache directory to get a real file path
300-
string targetPath = Path.Combine(FileSystem.CacheDirectory, fileName);
301-
302-
// Check if already extracted
303-
if (File.Exists(targetPath))
304-
{
305-
return targetPath;
306-
}
307-
308-
// Extract the file
309-
await using var sourceStream = await FileSystem.OpenAppPackageFileAsync(fileName);
310-
await using var targetStream = File.Create(targetPath);
311-
await sourceStream.CopyToAsync(targetStream);
312-
313-
return targetPath;
314-
}
315289
}

0 commit comments

Comments
 (0)