MediaSourceAppServiceConnection
MediaSourceAppServiceConnection
MediaSourceAppServiceConnection
MediaSourceAppServiceConnection
Class
Definition
Some information relates to pre-released product which may be substantially modified before it’s commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Prerelease APIs are identified by a Prerelease label.
[Contains prerelease APIs.]
Enables the implementation of an app service that provides a custom media source that can be consumed by UWP apps.
public : sealed class MediaSourceAppServiceConnection : IMediaSourceAppServiceConnectionpublic sealed class MediaSourceAppServiceConnection : IMediaSourceAppServiceConnectionPublic NotInheritable Class MediaSourceAppServiceConnection Implements IMediaSourceAppServiceConnection// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 Insider Preview (introduced v10.0.16257.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v5)
|
Remarks
This feature must be implemented in a background task. When the background task is launched and the Run, the app should create a new instance of this class, register a handler for the InitializeMediaStreamSourceRequested event, and call Start to notify the system that the app service is ready to handle stream source requests.
The system passes an IRandomAccessStream and an a uninitialized MediaStreamSource object into the InitializeMediaStreamSourceRequested event handler. The app service should parse the IRandomAccessStream to create an IMediaStreamDescriptor. If the requested stream format is supported, then the app service can initialize the MediaStreamSource and begin providing samples.
Constructors
MediaSourceAppServiceConnection(AppServiceConnection) MediaSourceAppServiceConnection(AppServiceConnection) MediaSourceAppServiceConnection(AppServiceConnection) MediaSourceAppServiceConnection(AppServiceConnection)
Prerelease. Initializes a new instance of the MediaSourceAppServiceConnection class.
public : MediaSourceAppServiceConnection(AppServiceConnection appServiceConnection)public MediaSourceAppServiceConnection(AppServiceConnection appServiceConnection)Public Sub New(appServiceConnection As AppServiceConnection)// You can use this method in JavaScript.
- appServiceConnection
- AppServiceConnection AppServiceConnection AppServiceConnection AppServiceConnection
An AppServiceConnection object representing the connection to the endpoint for an app service.
Remarks
Get an instance of the AppServiceConnection class by casting the TriggerDetails property of the IBackgroundTaskInstance object passed into the background task's Run method to an AppServiceTriggerDetails object and then accessing the AppServiceConnection property.
Methods
Start() Start() Start() Start()
Prerelease. Notifies the system that the app service is ready to receive media stream source requests.
public : void Start()public void Start()Public Function Start() As void// You can use this method in JavaScript.
Remarks
Register for the InitializeMediaStreamSourceRequested event handler before calling Start.
Events
InitializeMediaStreamSourceRequested InitializeMediaStreamSourceRequested InitializeMediaStreamSourceRequested InitializeMediaStreamSourceRequested
Prerelease. Raised by the system to request the initialization of a new MediaStreamSource.
public : event TypedEventHandler InitializeMediaStreamSourceRequested<MediaSourceAppServiceConnection, InitializeMediaStreamSourceRequestedEventArgs>public event TypedEventHandler InitializeMediaStreamSourceRequested<MediaSourceAppServiceConnection, InitializeMediaStreamSourceRequestedEventArgs>Public Event InitializeMediaStreamSourceRequested<MediaSourceAppServiceConnection, InitializeMediaStreamSourceRequestedEventArgs>// You can use this event in JavaScript.
Remarks
After registering a handler for the InitializeMediaStreamSourceRequestedEventArgs, call Start to notify the system that the the app service is ready to handle requests.
With the InitializeMediaStreamSourceRequestedEventArgs object, the system passes an IRandomAccessStream and an a uninitialized MediaStreamSource object into the InitializeMediaStreamSourceRequested event handler. The app service should parse the IRandomAccessStream to create an IMediaStreamDescriptor. If the requested stream format is supported, then the app service can initialize the MediaStreamSource and begin providing samples.