Home » Microsoft » 70-485 » What should you do?
You need to implement the requirements for streaming media.
What should you do? (Each correct answer presents part of the solution. Choose all that apply.)
A. Enable access to the Videos Library.
B. Ensure that the app stays in the foreground while media is being streamed.
C. Enable access to the Pictures Library.
D. Register for the SourceRequested event.
E. Enable access to the Music Library.
F. Register for the PlayRequested event.
Correct Answer: AD
Explanation/Reference:
From scenario:
Team members must be able to stream video clips to other devices in the vicinity of the team member’s device. The app will not support the streaming of photographs.
D: You can use Play To to stream the audio or video in your application, as well as images, by implementing the Play To contract. To implement the Play To contract in your application, register for the sourceRequested event.
Note:
To register for the sourceRequested event, get a reference to the current PlayToManager by calling the getForCurrentView method. You can then call addEventHandler on the PlayToManager to associate your event handler with the sourceRequested event. In your event handler, pass the media element from your application to the setSource method of the PlayToSourceRequestedEventArgs object passed to the event handler as shown in the following example.
// Play To Contract
private Windows.Media.PlayTo.PlayToManager ptm =
Windows.Media.PlayTo.PlayToManager.GetForCurrentView();
protected override void OnNavigatedTo(NavigationEventArgs e)
{
ptm.SourceRequested += sourceRequestHandler;
}
private void sourceRequestHandler(
Etc.