Using Player to play video

I have a simple function that will launch the `player` that handles video playback for the Apple TV



    function launchPlayer() {
      var player = new Player();
      var playlist = new Playlist();
      var mediaItem = new MediaItem("video", "http://localhost:9001/videos/nsoperations.mp4");
      player.playlist = playlist;
      player.playlist.push(mediaItem);
      player.present();
    }



I'm calling this function this way:



//in application.js
App.onLaunch = function(options) {
   launchPlayer();
}


For testing purposes, I want to launch the player right away. However, I'm met with dozens of `NSLayoutConstraint` errors, `unsatisfiable constraints`. Is this the wrong way to present the player?

I get the same behavior, even when launching in response to a button click. :/

Push a template e.g. alertTemplate onto the stack using navigationDocument.pushDocument() prior to presenting the player. Please file bug report if it's not working per your expectations.

Looks like you need to point to a URL on a different web server and not a local python one.

Try this url "http://trailers.apple.com/movies/focus_features/9/9-clip_480p.mov"


http://stackoverflow.com/questions/32518673/setting-up-apple-tv-video-javascript

Try using player.play() to start playback, rather then player.present().


Please note that TVMLKit playback crashes the simulator.

Using Player to play video
 
 
Q