A Custom Error Message

A demo of how users can control player behavior when an error occurs.

License: All
Player Version:
Author: JW Player | GitHub
This demo includes:
  • load()
  • play()
  • on('buffer')
  • on('play')
<script type="text/javascript">

var player = jwplayer('player');

// Trigger error on player setup
player.setup({
  file: "//content.jwplatform.com//videos/not-a-real-video-file.mp4"
});

// Load custom video file on error
player.on('error', function() {
  player.load({
    file:"//content.jwplatform.com/videos/7RtXk3vl-52qL9xLP.mp4",
    image:"//content.jwplatform.com/thumbs/7RtXk3vl-480.jpg"
  });
  player.play();
});

// Also load custom video file on buffer
player.on('buffer', function() {
  theTimeout = setTimeout(function() {
    player.load({
      file:"//content.jwplatform.com/videos/7RtXk3vl-52qL9xLP.mp4",
      image:"//content.jwplatform.com/thumbs/7RtXk3vl-480.jpg"
    });
    player.play();
  }, 5000);
});

player.on('play', function() {
  clearTimeout(theTimeout);
});

</script>
Please Note: This player implementation is a Proof of Concept only provided to show the possibilities of the JW Player and Platform and should not be taken as an offer to create, edit or maintain custom integration or development.