anchor.diff:  // Copyright 2015 The Chromium Authors. All rights reserved.
   // Use of this source code is governed by a BSD-style license that can be
   // found in the LICENSE file.
  +
  +import 'dart:async';
   
   import 'package:mojo/mojo/url_response.mojom.dart';
   import 'package:sky_services/media/media.mojom.dart';
  
positive.code:     new Key(Colors.purple[500], iLoveYou),
    ];
  
    PianoApp() {
      loadSounds();
    }
  
    loadSounds() async {
      MediaServiceProxy mediaService = new MediaServiceProxy.unbound();
      shell.requestService(null, mediaService);
  
      for (Key key in keys) {
        MediaPlayerProxy player = new MediaPlayerProxy.unbound();
        mediaService.ptr.createPlayer(player);
  
        UrlResponse response = await fetchUrl(key.soundUrl);
        await player.ptr.prepare(response.body);
        key.player = player;
      }
      mediaService.close();
      // Are we leaking all the player connections?
    }
  
    Widget build(BuildContext context) {
      List<Widget> children = [];
      for (Key key in keys) {
        children.add(
          new Flexible(
            child: new Listener(
              child: new Container(
                decoration: new BoxDecoration(backgroundColor: key.color)
              ),
              onPointerCancel: (_) => key.up(),
              onPointerDown: (_) => key.down(),
              onPointerUp: (_) => key.up()
            )
          )
        );
      }
  
      return new Column(children);
    }
  }
  
  void main() {
    runApp(new PianoApp());
  }
  
negative.code: 
    final Color color;
    final String soundUrl;
    final MediaPlayerProxy player = new MediaPlayerProxy.unbound();
  
    bool get isPlayerOpen => player.impl.isOpen;
  
    void down() {
      if (!isPlayerOpen) return;
      player.ptr.seekTo(0);
      player.ptr.start();
    }
  
    void up() {
      if (!isPlayerOpen) return;
      player.ptr.pause();
    }
  
    Future load(MediaServiceProxy mediaService) async {
      try {
        mediaService.ptr.createPlayer(player);
        UrlResponse response = await fetchUrl(soundUrl);
        await player.ptr.prepare(response.body);
      } catch (e) {
        print("Error: failed to load sound file $soundUrl");
        player.close();
      }
    }
  }
  
  