').html('Retrying in 10 seconds ...') .css({ 'font-size': '120%', 'margin': '15px', })); this.container && this.container.$el.prepend(this._err); }, onError: function(e) { if (!this.container) return; this.show(); this.container.getPlugin('click_to_pause').disable(); var tid, t = 10, retry = function() { clearTimeout(tid); if (t === 0) { this.container.getPlugin('click_to_pause').enable(); if (this.options.errorPlugin && this.options.errorPlugin.onRetry) { this.options.errorPlugin.onRetry(e); return; } else { this.container.stop(); this.container.play(); return; } } $('.retry-counter').text(t); t--; tid = setTimeout(retry, 1000); }.bind(this); retry(); } }); var player = new Clappr.Player({ disableErrorScreen: true, // Disable the internal error screen plugin source: 'http://clappr.io/bad_highline.mp4', plugins: [ErrorPlugin], errorPlugin: { // text: 'My custom error message.', onRetry: function(e) { // simulate successful recovery // or decide here what to do between each retry player.configure({ source: 'http://clappr.io/highline.mp4', autoPlay: true, }); } }, height: 360, width: 640 }); player.attachTo(playerElement); ``` :rocket: Companies using Clappr --- https://github.com/clappr/clappr/issues/522 :raised_hands: Contributors --- This project exists thanks to all the people who [contribute](https://github.com/clappr/clappr/graphs/contributors). :star2: Sponsor --- [![image](https://cloud.githubusercontent.com/assets/244265/5900100/ef156258-a54b-11e4-9862-7e5851ed9b81.png)](http://globo.com)