Dela via


AppBroadcastBackgroundService Class

Definition

Provides an interface between the broadcasting UWP app and the system-hosted broadcast service. This class provides access to objects that facilitate broadcast service authentication, test the bandwidth capabilities of the device's internet to the broadcasting provider service, and allow your task to acquire captured audio and video frames so that they can be sent to the broadcast provider service.

Note

This API requires the appBroadcast and appBroadcastSettings capability which is not available to all Windows apps. Unless your developer account is specially provisioned by Microsoft, calls to this API will fail at runtime.

public ref class AppBroadcastBackgroundService sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Media.Capture.AppBroadcastContract, 65536)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class AppBroadcastBackgroundService final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Media.Capture.AppBroadcastContract), 65536)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class AppBroadcastBackgroundService
Public NotInheritable Class AppBroadcastBackgroundService
Inheritance
Object Platform::Object IInspectable AppBroadcastBackgroundService
Attributes

Windows requirements

Device family
Windows Desktop Extension SDK (introduced in 10.0.15063.0)
API contract
Windows.Media.Capture.AppBroadcastContract (introduced in v1.0)
App capabilities
appBroadcast appBroadcastSettings

Remarks

Get an instance of this class by casting the TriggerDetails property of the IBackgroundTaskInstance passed into your background task's Run method to a AppBroadcastTriggerDetails and then accessing the BackgroundService property.

This API may throw an error if the background service has shut down due to idle timeout.

Version history

Windows version SDK version Value added
1709 16299 BroadcastChannel
1709 16299 BroadcastChannelChanged
1709 16299 BroadcastLanguage
1709 16299 BroadcastLanguageChanged
1709 16299 BroadcastTitleChanged

Properties

AppId

Gets a string containing an identifier for the game being broadcast. When broadcasting on a desktop device, this value is the game on which the user initiated broadcasting.

BroadcastChannel

Gets a string containing the name of the current broadcast channel.

BroadcastLanguage

Gets a string representing the language of the current broadcast channel.

BroadcastTitle

Gets a string containing the user-specified title of the broadcast.

PlugInState

Gets or sets a value specifying the current state of the broadcast background task.

SignInInfo

Gets an object that represents the sign-in information for the app broadcast background service.

StreamInfo

Gets an object that manages the stream state of the app broadcast background service.

TitleId

Gets a unique identifier for the title being broadcast.

ViewerCount

Gets or sets the number of viewers of the broadcast.

Methods

TerminateBroadcast(AppBroadcastTerminationReason, UInt32)

Terminates a broadcast.

Events

BroadcastChannelChanged

Occurs when the value of the BroadcastChannel property changes.

BroadcastLanguageChanged

Occurs when the value of the BroadcastLanguage property changes.

BroadcastTitleChanged

Occurs when the value of the BroadcastTitle property changes.

HeartbeatRequested

Raised by the system periodically to confirm that the broadcasting background task is currently active.

Applies to