title: Play a video with AVPlayer in Swift Playground?
body: <p>I am having trouble playing a video within a swift playground using AVPlayer.  </p>
  
  <p>Here's my code. </p>
  
  <pre><code>import UIKit
  import AVFoundation
  
  var f=CGRectMake(0, 0, 500, 500)
  var url=NSURL(string: "http://s3.amazonaws.com/vids4project/sample.mp4")
  var playerItem = AVPlayerItem(URL: url)
  
  var v = UIView(frame:f)
  var player=AVPlayer(playerItem: playerItem)
  var playerLayer=AVPlayerLayer(player: player)
  
  playerLayer.frame=f
  v.layer.addSublayer(playerLayer)
  player.play()
  </code></pre>
  
  <p>Any suggestions? The code as does nothing at all.  My expectation is the 'v' variable should be showing the video.    It seems to work outside the playground when I am connecting the avplayerlayer to a view from a storyboard.  </p>