160 likes | 292 Views
06 | Advanced Contracts Pt 2. Jerry Nixon | Microsoft Developer Evangelist Daren May | President & Co-founder, Crank211. Agenda for the Day. Visit xamlShow on CodePlex http://xaml.codeplex.com. Module Agenda. Search Contract PlayTo Contract. Search. Activations. Search Contract.
E N D
06 | Advanced Contracts Pt 2 Jerry Nixon | Microsoft Developer Evangelist Daren May | President & Co-founder, Crank211
Agenda for the Day • Visit xamlShow on CodePlex • http://xaml.codeplex.com
Module Agenda • Search Contract • PlayTo Contract
Activations Search Contract • PlaceholderText = “People” • SuggestionsRequested • AppendQuerySuggestions • AppendSearchSeparator(“Person”) • AppendResultSuggestion • QuerySubmitted • ResultSuggestionChosen • ShowOnKeyboardInput • TrySetQueryText
Play To contract • Streams audio, video or images from your app to target devices • Target devices include • Xbox 360 • DLNA compliant devices such as TVs, Media Extenders, etc. • Windows 8 devices that implement the PlayTo receiver contract
Play To architecture SourceRequested MediaElement PlayToManager Media Stream PlayToReceiver
Adding Play To flow • Declare: “Private Networks” Capability • Register the view to the current PlayToManager • Handle the SourceRequestEvent and return the MediaElement that contains the content to be shared:
Building a Play To receiver • Declare the “Private Networks” capability • PlayToReceiver • Configure receiver • Pass events to MediaElement • Pass MediaElement events to the receiver • Start the receiver • Advertises on local network
Handle events PlayToReceiver MediaElement CurrentStateChanged MediaEnded MediaFailed MediaOpened RateChanged SeekCompleted VolumeChanged • CurrentTimeChangeRequested • MuteChangeRequested • PauseRequested • PlaybackRateChangeRequested • PlayRequested • SourceChangeRequested • StopRequested • TimeUpdateRequested • VolumeChangeRequested
Module Review • Search • PlayTo