// ------------------------------------------------------------------------ // Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. // ------------------------------------------------------------------------ namespace Engine.Utilities { using System; using System.Collections.Generic; using UnityEngine; public static class UnitySupportedVideoFormats { public static readonly HashSet WindowsSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase) { ".asf", ".avi", ".dv", ".m4v", ".mov", ".mp4", ".mpg", ".mpeg", ".ogv", ".vp8", ".webm", ".wmv", }; public static readonly HashSet MacOSSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase) { ".dv", ".m4v", ".mov", ".mp4", ".mpg", ".mpeg", ".ogv", ".vp8", ".webm", }; public static readonly HashSet LinuxSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase) { ".ogv", ".vp8", ".webm", }; public static readonly HashSet AndroidSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase) { ".webm", ".mp4", }; public static readonly HashSet iOSSupportedVideoFormats = new (StringComparer.OrdinalIgnoreCase) { ".webm", ".mp4", }; public static HashSet GetSupportedVideoFormats(RuntimePlatform platform) { return platform switch { RuntimePlatform.WindowsPlayer or RuntimePlatform.WindowsEditor => WindowsSupportedVideoFormats, RuntimePlatform.OSXPlayer or RuntimePlatform.OSXEditor => MacOSSupportedVideoFormats, RuntimePlatform.LinuxPlayer or RuntimePlatform.LinuxEditor => LinuxSupportedVideoFormats, RuntimePlatform.IPhonePlayer => iOSSupportedVideoFormats, RuntimePlatform.Android => AndroidSupportedVideoFormats, _ => new HashSet (StringComparer.OrdinalIgnoreCase) {".mp4" } }; } } }