mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Merge pull request #8236 from peppy/tournament-all-video-extensions
Allow videos to be loaded with any extension
This commit is contained in:
@ -7,7 +7,6 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Video;
|
using osu.Framework.Graphics.Video;
|
||||||
using osu.Framework.Platform;
|
|
||||||
using osu.Framework.Timing;
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
@ -28,9 +27,9 @@ namespace osu.Game.Tournament.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(Storage storage)
|
private void load(TournamentStorage storage)
|
||||||
{
|
{
|
||||||
var stream = storage.GetStream($@"videos/{filename}.m4v");
|
var stream = storage.GetStream($@"videos/{filename}");
|
||||||
|
|
||||||
if (stream != null)
|
if (stream != null)
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,8 @@ namespace osu.Game.Tournament
|
|||||||
|
|
||||||
private Storage storage;
|
private Storage storage;
|
||||||
|
|
||||||
|
private TournamentStorage tournamentStorage;
|
||||||
|
|
||||||
private DependencyContainer dependencies;
|
private DependencyContainer dependencies;
|
||||||
|
|
||||||
private Bindable<Size> windowSize;
|
private Bindable<Size> windowSize;
|
||||||
@ -54,7 +56,9 @@ namespace osu.Game.Tournament
|
|||||||
{
|
{
|
||||||
Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));
|
Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));
|
||||||
|
|
||||||
Textures.AddStore(new TextureLoaderStore(new ResourceStore<byte[]>(new StorageBackedResourceStore(storage))));
|
dependencies.CacheAs(tournamentStorage = new TournamentStorage(storage));
|
||||||
|
|
||||||
|
Textures.AddStore(new TextureLoaderStore(tournamentStorage));
|
||||||
|
|
||||||
this.storage = storage;
|
this.storage = storage;
|
||||||
|
|
||||||
|
19
osu.Game.Tournament/TournamentStorage.cs
Normal file
19
osu.Game.Tournament/TournamentStorage.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.IO.Stores;
|
||||||
|
using osu.Framework.Platform;
|
||||||
|
|
||||||
|
namespace osu.Game.Tournament
|
||||||
|
{
|
||||||
|
internal class TournamentStorage : NamespacedResourceStore<byte[]>
|
||||||
|
{
|
||||||
|
public TournamentStorage(Storage storage)
|
||||||
|
: base(new StorageBackedResourceStore(storage), "tournament")
|
||||||
|
{
|
||||||
|
AddExtension("m4v");
|
||||||
|
AddExtension("avi");
|
||||||
|
AddExtension("mp4");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user