I am the culprit

Two softies blog about someone blogging like crazy at the back, that would be me!

http://blogs.msdn.com/dthorpe/archive/2007/09/11/blogging-at-remix07-london.aspx

http://blogs.msdn.com/angus_logan/archive/2007/09/11/blog-envy.aspx

Ads

Mix:UK 07: Building next generation web applications using Windows Live Services

Integrate different applications together. End users will go and download the messenger client and interact with the messenger service though that tool. Our idea is to open that service to empower developers. They'll benefit from our scale, user base and services.

There's a break down in the live platform: Rich media expriences. Silverlight well push it and stream it for you. Storing and sharing, we have messenger, all your contacts is a shared infrastructure across all our services. If you have a blog and use spaces, it goes there. We also have photo sharing. Automated agents with AI on messenger. Alert infrastructure, we send million of them at 9am and they'll turn up instantly on messenger and a few minutes later by sms.

Live.com, search, maps is the Find and Locate.

And what we announced last year at mix was to say we'd have one set of use for everyone. As a developer, a company, you read these TOCs let you use everything for free, within a cap.

Dynamics Live, Office Live, XBOX Live exist too but they're not tightly integrated, so they're not handled by us and we don't look at them.

Silverlight streaming. It's on microsoft infrastructure, and it's free. You take your application, your video, the application in its whole, like the Scrum board, and uploaded on our infrastructure where we'll manage the storage, the distribution, the backup of it, you don't need to pick up the bill for streaming it. When we go from alpha to beta, you'll be able to stream a million minutes a month for free, and above that we'll figure out a way to solve that issue.

How to use it? If you 're a developer, you go to http://silverlight.live.com with your windows live ID, it'll give you an account and you get your 4GB bucket for all your code. Once you have the application and signed up, you can upload through the web interface, which is more for a one off. If you do this a lot, user generated content, thousand of files, you can use a REST (some would say HiREST), with PUT/POST/GET/DELETE. It gets distributed to our CDN and you don't have to worry about it. Someone in China will get in a local cache for fast access over there.

How do you fetch information from there? For the Halo3 Service, all the videos come from Silverlight straming. When a user browse to http://halo3.msn.com they get all the html and javascript from that server. But you can either do a javascript or an IFRAME integration. The browser will then call our Silverlight CDN and pull down everything from there. Or you can just decide to pull down the videos, and keep the flexibility to keep your application and use our servers for the video.

Three steps, Creating, Uploading and Consuming.

Demo

Opening Expression Encoder. Was released in final version last week on the web. If youre running Vista there's three default videos, import them in Encoder, decide the encode rate, but what we want is look at the output. We choose a template. There's one small window called Publish thats an add-on to Encoder that we'll see in a bit.

We encode the video, the template gets outputed in the output directory. This encoding will take a short time, 10 seconds microsoft time.

Question: Why Microsoft gives this for free? It's a big bill, but we're saying upload your content, at a later time when you go over your limit we'll exchange more bandwith with ads. We don't know yet. The long part of the tail, the free bits, are paid for by the top of the tale, the ones that pay for it.

I got all my rendering done in my otput directory, and there's a few files i want to delete, silverlight, csproj and htm files that are used to be opening in Blend, delete them as they're not needed on the sliverlight CDN. I'll go to http://dev.live.com which should be your favourite web site. It's got SDK, samples, RSS, etc. One of the tasks is creating apps with the encoder, which gives you a full tutorial for it.

You need to create a manifest file which is an xml file. Its a silverlight 1.0 application, you can also upload 1.1. You decide which js files and which functions are called. You right click it and zip the manifest and add all the other files. Make sure you zip them at the root of the zip file or the content won't get uploaded.

You can go to the silverlight web, and you can manage all your applications from there. You can from there upload the zip file you created, choose a name and upload.

We only allow you to upload 30meg chuncks. The video portion needs to be less than 22MB. If you go over 12 minutes of content, you go over the MPEG limits, break your license.

You can launch the test application page from there and will load the content from agappdom which is the silverlight CDN network. We can do up to a terabyte per second of bandwidth for video streaming.

That was the slow way, let's look at the quick way. I have a web service in a solution within visual studio 2008 and i'm going to debug it to show what is going on. There's a couple of webmethods. One is UploadFiles. You pass the file from the test page, give a title and click Invoke. The code in the demo sets the URL to the address for the account id (http://silverlight.services.live.com/accountid), pass the data as a POST which returns an OK response. And it's been uploaded programmatically automatically.

So how do we fetch this data programmatically? We call a GetVideos method. Same URL, call a GET. One thing we're lacking a way of capturing additional metadata, for example GeoCode. You can do it manually by escaping data and uploading fake names. The web service can then return this data after decoding it. From the web service data, we get the address for the IFRAME we can put on our application. You can also get the IFRAME address manually.

Question: How did you add these extra attributes? I encoded the data and Base64 encoded them and put them as filenames. It's a hack and we'll hope to fix up.

Question: What happens if you use all your minutes for bandwidth time? It won't disconnect you, we haven't locked it down yet. Someone will shoot you an email telling you you're popular and wanting to help you more popular.

Virtual Earth is used a lot in the UK. There's a lot of aspects to it. The user experience is from http://local.live.com you can get maps, or see my street on birds eye view, or New York on 3D. They have not much to do with development. What we do is manage all the data, 14 petabytes of data, for our service. A while ago we opened it up for developers to leverage. You can use the mappoint service you have a SOAP api. You can embed a map with a javascript control. If you want to do tricky stuff like overlaying things then you can use things like Map Cruncher.

Demo of Virtual Earth.

From http://dev.live.com, you have cookbooks containing examples, that show the example, source code, references from msdn and interesting links. It shows the javascript code to show based on Longitude / Latitude, which you can get easily by lookig at the URL when you're browsing the live maps.

In this demo it's all javascript so no code behind. There's a reference to the javascript map control, and we call the GetMap, Load the Map, set the zoom level except you can't look up, we don't have that yet. We have a map showing up, its all running off the live code.

We want to push the video we saw earlier onto this map, and we do that with a pushpin. How do we do that? Back to the virtual earth SDK. There's a tool to add custom shapes, you can look at the code, and see the javascript to do that. Copy and go back to the code, we add the pushpin, add an icon, change the style, add a description. Then we call the javascript code to pull the videos. What we do is add the ScriptMethod and AJAX extensions to call that web service.

In action, there's now 3 pushpins on the map. In the Virtual Earth SDK you can add HTML content to the pushpin which lets you show HTML data whenever you click on the pushpin.

You can also switch to bird eye view or hybrid view, the pushpin is still there.

SportsDo shows a bird eye view of the trajectory of a run above a map. The thing works to where people were swimming, and in bird view you can follow their trajectory!

Another is skiing in Les Arcs, in 2d View you have a pushpin of a geo coded picture. If you switch to 3d mode. The 3d is an ActiveX control, so you can choose high ef or low def experience.

Looking in 3d you can see the contour of the mountain, and you can sin the demo around and the track followed by the skiers is still there. There was no programming changes done at all.

If you have an xbox controller, you can plug it into your PC, it will control your 3d view.

Switching to hubrid mode you can see the textures on top of the geometry of the mountain.

Last one is booking a tour of Toronto. Pictures on a Windows phone, everything gets uploaded and geo-coded. In building view you can zoom in and see the pictures overlayed on the map in 3d view of the buildings. As the track followed gets animated, the icon is automatically put behind the buildings which lets you follow where he was going. I encourage you to have a play on our site. We thnk it's a great example of what can be done with 3D.

Windows Live is opening. People have their worlds in Hotmail, Messenger, etc. If you;re doing any silverlight development, deploy it on Silverlight streaming. With one click of a button from encoder you can publish immediately. On Virtual Earth, you code once in javascript.

We have another session covering everything else on Wednesday at 12:15, covering Messenger, and some pre-release things.

Question:

What is the 700kbs limit? If you load 5 files from your domain you'd get 5 times the bandwidth. What we enforce is the average. We've capped to test how good we push on the server.

How much does it cost for Virtual Earth license for a company? I don't know come see me and leave me your email. Mappoint is another technology, which is a sister of VirtualEarth you may have to choose between the two.

Is it possible to host asp.net services on silverlight streaming? No it's about silverlight content only. You'll still have a web host for a rich asp.net experience, we only provide the silverlight answer. 3 million map tiles for free, above that there's a charge, we can put you in contact with people. There are commercial terms on search, 750k queries for free even for commercial terms.

The 22MB limit, is it going to change over time? Although it's streaming, are you doing http download of the videos? First, 22MB is a temporary which will be changed over a time limit, as long as it stays under 10 minutes limit. We'll be able to offer commercial terms, but there's MPEG royalties involved. The streaming, it's only Http.

What about live video? We don't support live video, but we offer the Windows Media Services as part of Windows Server.

On the Virtual Earth API, it looks different from maps.live.com? No answer. There's nothing different from the demo.

You mentioned an IFRAME part, where do you get the IFRAME URL from? It's in the SDK and it's released so you should be able to get it through there. It's appID and accountID.

Is there a Silverlight compatible api for VirtualEarth? Right now it's not possible, someone may be working on that. An aspect of that is that silverlight 1.1 can call out on javascript, so you can reach to the javascript code from silverlight 1.1 .net code.

Is there any plan for windows live access to receive and send live messenger? From a server point of view, we bought a company which are Windows Live Agents with an SDK ported from Java to .net to program bots against the Messenger platform. We're running an alpha and search for Windows Live Agents you'll find it. There's a lot of things that will be included in the future with contact lists.

Technorati Tags: , ,

Ads

Mix:UK 07: Building Silverlight applications using .net Part 2

I wonder if I made the right decision to only blog the second part, we shall know very soon.

Questions:

Availability: The control toolkit for silverlight, will be full source soon.

Is it possible to rename assemblies to help with SharePoint? By the next refresh, instead of building the assemblies in separate files, everything will be zipped in a common package: Secure request and dynamically compressed.

Is there a date for CE support? There's a CE version of Silverlight that was shown at the Las Vegas Mix conference. The issue is the distribution aspects on phones. We're trying to sort out a few of these issues.

For those that missed Part 1 [EDIT: I'm the only one in the room it seems], there will be a link to the slides at the end of the session.

As it happens, Part 1 was about Shapes, Controls, UI, with no code. Part two we'll talk about events and write some code, how you can create your own controls, and tak about some of the non UI aspects like networking.

You need to name your controls, which then lets you address them programatically. That's what you'll use to bind events.

The Page_Loaded event is called when the app has been downloaded, which means everything referenced inside the XAML file, including images and videos, the event won't be fired until they've all been downloaded.

What you would want to do is to load all your assets as a background task instead of waiting for everything has been loaded.

Everything youve downloaded goes through the browser cache. You don't have to download assemblies or videos twice, the browser cache handles that.

Question: Can you download byte level access to what gets downloaded? Yes we'll see that later.

You can go and bind event on any UIElement, like MouseMove, MouseEnter, tc. Al shapes and controls derive from UIElement.

You can wire your event inside your XAML file, passing it the method name that will get executed, which is similar to the way it's done in asp.net. Instead of having OnMouseEnter uses MouseEnter and doesn't have the OnXx syntax.

You can also use the Handles keyword from code in VB, or in CSharp in the Page_Loaded event handler.

Question: Can you link to external handlers? Absolutely, not declaratively, but procedurally.

Demonstration: It's a blank page, and wherever you click, it shows a text saying "Clicked". It shows code getting the point where the mouse clicked, create an element, and set the Canvas.Top and Canvas.Left attached property to the newly created element.

Another demo changes the color of a sphere whenever clicked on. By having an Ellipse in the XAML, and in code behind, the Brush, Stroke and Fill properties are being modified programmatically.

It would be painful to add shapes every time you add a button, so let's look at example 3. Three buttons. They're wired to handlers.

Dependency properties will be supported in 1.1, but not sure if property triggers will be supported.

We want people to use Events for designers to stylize the buttons without having developers writting all the wiring code.

To build your own controls, you can do that. You derive from the Control base class. You have full encapsulation, use any shape, controls, brushes, transforms, etc, and expose your properties methods and events you want. They get hooked up to XAML.

As a control developer you can take advantage of the InitializeFromXaml method that lets you get a XAML tree from a string.

To be XAMLable, you have to have a parameter-less constructor, have public properties and public events.

Demo of creating a custom control

You can crate a Silverlight class library. Once it's created, you can add a Silverlight User Control. The XAML from the resource is serialized as a resource, and the partial class loads it from the resource and uses InitializeFromXaml to load it.

There are still a lot of feature missing: TextBox and Input controls are coming on. Layout managers are coming in the final release too. Databinding and DataTemplates, and styling support. All these features will show up in 1.1.

For business apps they are essentials, so it would be a bit hard to develop Silverlight business applications, so you may want to wait.

Is there a licensing model for third party licensing model: There will be a DRM system within Silverlight so you can implement your own.

Is there a way to share common controls so they don't get downloaded all the time? There will be a mechanism for trusted web sites for clients to download only once. There is a versionning policy so if there's a specific version, you bind to that, and we bind versionned, so theres no conflcit there.

One of the core things we try to do is to integrate with existing document to use .net or javascript and HTML in the same application. If you build a .net application, you can import System.Windows.Browser which lets you reach outside and get the HTML DOM, works on all browsers. There's an HtmlPage object so you can navigate to other pages or get all the documents. You can use the GetElementByID to return a reference an object in the page from your code. You can use an AttachEvent to attach a DOM event and give a reference to your .net method, in any language, CSharp, VB, Python, etc. The code for AttachEvent works across all browsers because it's the .net code, it is not related to the javascript way of attaching events.

Question If you want have a client side event handler, what happens? AttachEvent respect the existing attachments.

You can reach out from Silverlight in HTML. You can then do the reverse by exposign public methods in the silverlight controls that you want your javascript in the page. You can mark it with a Scriptable attribute, and register the Scriptable object. Then you can call the FootballData object you registered and call the method marked with the Scriptable.

Question: Would you get a Javascript error before the Silverlight control is loaded? Yes you will, you can check a method to see if the silverlight control is loaded.

You can use Permalinks, integrate forward / backward navigation, etc. We support both simple and complex types across (complex type support not ready yet).

Question: Can you render HTML within Silverlight control? Absolutely. Someone build an HtmlTextBlock for Silverlight, to render HTML within Silverlight (needs to be well formatted) and you can compose HTML and Silverlight controls in the same space.

Demo: HTML interaction.

The title is a silverlight control, the textbox and button are standard html. Enter text and click the button, the sliverlight control update its text by hooking the click event of the html element and updating the TextBlock element within it.

Question: What if you want to gain access to the ClientID? You can for example embed the value as a hidden field or a javascript value.

Demo: Pure HTML page

All the UI is done in HTML. Enter text, click the button, the text appears. What is being used is to hook the button click DOM event, and call silverlight from it. From within silverlight, the .net code creates an html element and adds it to the DOM page. You could then leverage network calls from Silverlight to update data in your html page.

You can also use OpenFileDialog. Often in HTML pages people ask how to add several files in one go. For mutliple files you need several input elements, so you have to do them one at a time. With the OpenFile support in HTML you can't have access to the file from the client. You have to upload to the server, then the client goes back to the server through AJAX or other for the client to consume. The OpenFileDialog makes things easier. You can select single or multiple files, provide filters, dialog, and get what the user sleected (OK, Cancel. etc)

You cannot have access to the original file path or the default path. The user has to explicitly find the phone.

Question: Can it be persisted locally after loaded? We don't give you the path to the file. Can we see the file size: Yes, as well as the file content type.

Let's create a text file. Open a sample, open a file dialog filtered for text files, select the document, the client reads the file and puts it into the silverlight control, the server didn't get hit. You could've done selection of multiple files too.

The code has a OpenFileDialog, with a DialogResult enumeration (very similar to WPF), then reading the content.

What about the network? Same as the .net framework. There's HttpWebRequest (called BrowserWebRequest), which lets you get byte streams in the alpha.

Question: Using local URI? Will throw a security exception. The browser is responsible for cross domain calls. Is there Asynchronous? Yes absolutely, there's a demo.

There's a button, we select an image and upload it to the server. Picture of Scott's sister before the ceremony.

You can also use the web services stack. Instead of using raw HTTP you can create a proxy for JSON (supported in the alpha) and WCF & SOAP (coming soon).

Question: Cross domain? Not supported now, but policy file on the server to give rights supported for release. You can now call any service and integrate it, which opens new opportunities. Will the WCF support will be Duplex? Don't know. Send me an email I'll find out.

You can do an async callback when downloading, prevents the client freezing.

Demo: Two buttons, one call GetMessage method synchronously, the other one asynchronously, which will call another method when downloading is done, freeing your UI thread. Synchronously, the button is frozen while downloading, whereas asynch everything stays responsive.

Question: Is there a need to marshal to the correct thread? For async no because we do it for you. If you use the background thread, you don't marshal but need to let the background thread know. Is it in there? No we pulled it out because it didn't work consistently on all browsers, one of them didn't work so we pulled it out. We won't ship this new thread model when we fix it. Do services call still use the borwsing stack? For Http traffic we still use that so we integrate with the cache. For browsers you can increase the number of connections to a server. There's also sockets support coming. System.Net will work in the sandbox in the future, even though it doesn't work for WPF in xbap.

For anyone building on Amazon S3 servers you'll be able to upload files there. It's great so you don't have to have a server farm to upload your data. You can do most work on the client, a few web servers on the backend, and pay as you go.

Once you download data, you can use the IE / Safari / Firefox cache. But you can also use Isolated Storage as a giant cookie. It's a feature in .net today [EDIT: been since .net 1.0!]. You can read and write from it. There's a 1MB limit for silverlight right now, but we may give the possibility for the user to change it.

Question: Can you have access to other isolated storage from other applications? For the alpha you get a separate store. The plan is for it to be shared per site. Can users turn on and off? The user can clear the cache which clears the IsolatedStorage. We should give the users a way to not allow IsolatedStorage. That's what consumers want.

Silverlight provides LINQ support, but you cannot use LINQ to SQL. This is not using LINQ but the SQL technology, LINQ is a general purpose query language. We'll provide LINQ to XML in the final release, so you can search and sort your xml data you download. We provide LINQ to objects right now. Because LINQ lets you provide your own dataproviders, you'll see LINQ to Flickr, LINQ to S3, which will get translated, so you don't have to know the actual web services to access these services.

Question: Is there a schedule for a refresh? There's no public date for that at the moment. Next milestone will have a lot of low level plumbing to get the layout system and core text input, but there won't be a lot of surface features appearing. It will be later this year but we don't know when yet. We're thinking of not doing a refresh on this infrastructure milestone. Is there a way to have a transform over time (animation support).

Is there support for animation? Demo of animating a transform over time in Blend, which works for Silverlight. You can change the transform type you want, you can loop it, reverse, etc.

The other nice thing from an architecture perspective is that with the increase in multiple core, it's hard from the UI. Silverlight ahs built-in in multicore support, everything gets partitionned on different cores automatically. All the graphics and animations get calculated on separate threads. That means better performance.

Is there a draw API? No we have a retained mode graphics system, so we draw objects on the screen. On multicore and having retained mode, we know how to redraw without you having to write sync, and we know how to draw it efficiently without having to ask you. We can choose to go hardware accelerated without breaking your code. BitmapEffects are not in 1.1, we've not decided to include them or not.

Is there a notion of frame rate? There's a notion of a frame rate, there's an api for that. But because of keyframes this is probably not reliable.

Which platforms are you supporting? Win200, XP, 2003, Vista, Tiger and Leopard, potentially Panther for Microsoft, Novell does Linux called moonlight on redhat, freebsd, solaris, and mobile devices will be announced. Safari and firefox on the max, Firefox and IE, with Opera planned on windows.

Technorati Tags:

Ads