sobota, 21 stycznia 2012

Notatki o Windows 8 - odc. 25

Aplikacje Metro: dodatkowe informacje o sensorach, dodatkowe informacje nt. funkcjonalności PlayTo (parowanie urządzeń, rodzaje odbiorców, tips & tricks), dostęp do zawartości serwerów multimedialnych, aplikacja Metro jako odbiorca PlayTo (godne uwagi - nie ma tego jeszcze w dokumentacji MSDN), testowanie aplikacji za pomocą Windows App Certification Kit, Windows Store (nowe, dość szczegółowe informacje w dokumentacji MSDN po zaprezentowaniu sklepu opinii publicznej).

Overview of motion and device orientation for Windows Developer Preview

Accelerometer

image

image

X = 0, Y = 0, Z = -1

Inclinometr

image

image

Play To and media sharing for Metro style apps

Media sharing in the next version of Windows can be summarized by the following three scenarios.

  • Streaming media from apps to Play To Receivers - new developer API makes it easy for developers to enable Play To media streaming from apps to devices like TVs and Audio Receivers.
  • Consuming media from Media Servers - new developer API makes it easy for developers to build rich media experiences for media stored on Media Servers on a user’s home network.
  • Adding Play To Receiver functionality to apps - new developer API makes it possible for apps to embed Play To Receiver functionality and become targets for the media streaming experiences.

Play To media streaming

Play To supports streaming of local media files, files from DLNA media servers and also streaming media from the internet.

On private networks Windows automatically discovers and pairs certified Play To devices when users select Enable sharing and connect to devices while provisioning the network.

image

On a public network, and when users do not want sharing enabled by default, devices will need to be manually paired using the Control Panel.

image

Companion Experiences
The Play To API provides a number of events and interfaces that make it possible for developers to create powerful companion experiences – like media playlists, photo slideshows, and contextual information on the PC while media is playing on the remote device.
Play To Receivers for Developer Preview
Play To for Metro style apps is designed to work with only Windows Certified Play To Receivers.

Only the below list of Play To receivers are supported in the Developer Preview. For scenario testing/validation from apps the easiest solution is to use Windows Media Player on another PC on the same Private Network. Other available devices are:

  • WD Live Hub (firmware version: 2.07.17)
  • Onkyo AV Receivers (Windows 7 Certified models)
  • Windows Media Player (on Windows 7 and the Windows Developer Preview) - both PCs need to be on the same private network, and the player needs to be open to stream to it (Stream –> Allow remote control of my Player)
  • Metro style apps with Play To Receiver functionality

Tips & tricks

The ‘src’ attribute of an element can be changed after it has been connected to a Play To Receiver to stream media playlists and image slideshows.

<img id="player" src="image1.jpg" />

<script type="text/javascript">

    setTimeout(function(){

        document.getElementById("player").src = "image2.jpg";

    }, 10000);

</script>

Application can generate and stream images on the fly by drawing on the <canvas> element and taking a snapshot of its content using its msToBlob() method.

<canvas id="renderer" />

<img id="player" />

<script type="text/javascript">

    var blob = document.getElementById("renderer").msToBlob();

    document.getElementById("player").src = URL.createObjectURL(blob);

</script>

Applications can easily query the friendly name of the device that the media is being streamed to.

<script type="text/javascript">

    var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView();

    ptm.addEventListener("sourceselected", function(e) {

        log(e.friendlyName);

    });

</script>

To improve the application memory footprint the next version of Windows introduces non-reusable blob URLs. You can enable this feature by passing false as the second parameter of URL. createObjectURL(). This is currently not compatible with Play To.

Accessing media servers

You may want to access media files from other DLNA media servers connected to the home network. In order to do so, an application needs to integrate the new file picker APIs. These APIs are used to trigger the Metro style UI that gives users the option to find files locally, in removable storage, or in media servers connected to the network.

You can apply a filter to the FileOpenPicker() function to access specific paths in the hierarchy. For example, the path that shows media servers is either Files/Desktop/Computer/Media Servers or Files/Computer/Media Servers.

Any DLNA media server exposes content using its own hierarchy of containers. Each container can include other containers or media items. The first layer typically includes containers called Music, Videos, and Pictures. The second layer under Music sometimes includes a container called All Music. The file picker integrates the Windows hierarchy and the media server hierarchy into a single tree. For example, a user can navigate from the root to All Music using:

Files -> Computer -> Media Servers -> MyServerDevice -> Music -> All Music

You can use the URL.createObjectURL() function to obtain the URL for the selected file object. The URL is then inserted programmatically into a video element. The content referenced by the video element can be played by default in the App, or it can be pushed to any Play To receiver in the network.

Making apps Play To Receivers

The new Play To Receiver API in the next version of Windows makes it possible for any Metro style app to become a Play To target for audio, video, and images.

The following steps provide a walkthrough for getting started with the Play To Receiver developer sample. You can download the sample from the samples gallery.

Windows Media Player (Stream –> Turn on media streaming…)

image

  • Click Start Receiver in the sample
  • On Private networks, the receiver will automatically be paired with the machine within a few minutes; on public networks, the device will need to be manually added
  • Click Play in the Video
  • Swipe in the Device charm, and select the Receiver
  • Watch the video stream to the Play To Receiver media element!

Using the Windows App Certification Kit

Starting with Windows Developer Preview, we are introducing the Windows ACK to replace the WSLK.

Windows ACK will be available as part of the Windows Software Development Kit for Metro style Apps. The toolkit is already pre-deployed on the Windows Developer Preview image, and at present it cannot be obtained through any other mechanism.

image

Validating apps

    image

image

After the validation process concludes, Windows ACK will generate a report.

Windows Store

With successful apps on Windows you'll make more money than the industry standard, earning 80% of every customer dollar after an app makes more than 25,000 USD in sales. For the first 25,000 USD of an app's sales, you get the industry-standard 70%.

The price tier sets the price of your app. You can offer your app for free or, when the Windows Store supports sales, pick a price tier for it. Price tiers will be available from 1.49 USD on up, in increments of 0.50 USD to 4.99 USD, with higher price tiers also available.

The cost to register for a Windows Store developer account in the United States is 49 USD for an individual and 99 USD for a company.

Poland: 140 PLN / 280 PLN paid to bank or PayPal

Apps can also show ads to your customers. You can show ads from apps that also sell in-app purchases and from apps that have a trial period.

Third-party transactions

Apps can also make money in ways other than those the Windows Store provides. You can use a third-party transaction provider or benefit from ties to other lines of business as long as the transactions comply with the App Developer Agreement. For example, if you have a transaction platform that integrates into a CRM system, you can use that in your app to keep track of your subscribers.

Windows Store markets

On or before the date on which Windows 8 Release Candidate is released, Microsoft may (but is not obligated to) remove any or all apps and content from the pre-release Windows Store, as well as from any devices onto which they may previously have been downloaded or installed.

Roaming is a Windows 8 feature that enables users to use your app on up to 5 Windows 8 enabled devices at any one time, unless you identify your app as eligible for distribution by only named OEMs, or on only an ARM or X86 processor. Only the most recently distributed version of your app will be roamed to consumers.

All apps submitted through the pre-release version of the Windows Store must be for no charge. Microsoft will not process any payments related to apps during the beta period, including payments for in-app purchases.

Some certificate requirements:

  • Each app must display only one tile after it is installed
  • Your app must not display only ads
  • Your app must not use tiles or notifications for ads
  • Your app must do more than open a website or mimic the behavior of a website. Your app must provide a reasonable snap state; it shouldn't be cut off when snapped. Your app must also support touch, keyboard, and mouse input.
  • Ads must not execute program code that did not come from the ad provider
  • Your app must provide the same user experience on all processor types
  • Your app must fully support touch interactions. Your customers must be able to access all of your app's functionality using only touch interactions and gestures.
  • Your app must protect customers from unintentional large data transfers over metered networks
  • You must provide technical support info for your app

Enterprise deployment. An option for developers who create apps for use within an organization is enterprise deployment. Enterprise deployment enables your apps to be distributed to users within the enterprise without going through the Windows Store.

1 komentarz:

Lauraine pisze...

I have no words for this great post such a awe-some information i got gathered. Thanks to Author.
html5 audio player| html5 audio player