using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using Steamworks.Data; namespace Steamworks { /// /// Class for utilizing the Steam Video API. /// public class SteamVideo : SteamClientClass { internal static ISteamVideo? Internal => Interface as ISteamVideo; internal override bool InitializeInterface( bool server ) { SetInterface( server, new ISteamVideo( server ) ); if ( Interface is null || Interface.Self == IntPtr.Zero ) return false; InstallEvents(); return true; } internal static void InstallEvents() { } /// /// Return if currently using Steam's live broadcasting /// public static bool IsBroadcasting { get { int viewers = 0; return Internal != null && Internal.IsBroadcasting( ref viewers ); } } /// /// Returns the number of viewers that are watching the stream, or 0 if is . /// public static int NumViewers { get { int viewers = 0; if ( Internal is null || !Internal.IsBroadcasting( ref viewers ) ) return 0; return viewers; } } } }