Sha256: 2817d09eb7c3a4640e8c40e135b0eb3cf15328391b65b6a33cfcb2a667937d37
Contents?: true
Size: 825 Bytes
Versions: 10
Compression:
Stored size: 825 Bytes
Contents
/*global Promise*/ // Chrome returns a promise from `play` that is rejected if another // operation (like calling `pause` or updating the source) happens // before playing started. If the promise rejection is not handled, // the operation that caused `play` to abort will fail with an // exception. Code following the operation will not be executed. Catch // and ignore the promise to prevent this. pageflow.mediaPlayer.catchPlayerPromise = function(player) { var originalPlay = player.play; player.play = function(/* arguments */) { var result = originalPlay.apply(player, arguments); if (result && (typeof Promise !== 'undefined') && (result instanceof Promise)) { result.catch(function() { pageflow.log('Caught pending play exception - continuing'); }); } return result; }; };
Version data entries
10 entries across 10 versions & 1 rubygems