Skip to content

Commit

Permalink
Merge pull request mediaelement#842 from realgravity/custom_error
Browse files Browse the repository at this point in the history
Option for custom error message when no plugins are found.
  • Loading branch information
johndyer committed May 25, 2013
2 parents 50b31bb + dc2e8e6 commit 7d6240b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/js/me-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,13 @@ mejs.HtmlMediaElementShim = {
errorContainer.style.height = htmlMediaElement.height + 'px';
} catch (e) {}

errorContainer.innerHTML = (poster !== '') ?
'<a href="' + playback.url + '"><img src="' + poster + '" width="100%" height="100%" /></a>' :
'<a href="' + playback.url + '"><span>' + mejs.i18n.t('Download File') + '</span></a>';
if (options.customError) {
errorContainer.innerHTML = options.customError;
} else {
errorContainer.innerHTML = (poster !== '') ?
'<a href="' + playback.url + '"><img src="' + poster + '" width="100%" height="100%" /></a>' :
'<a href="' + playback.url + '"><span>' + mejs.i18n.t('Download File') + '</span></a>';
}

htmlMediaElement.parentNode.insertBefore(errorContainer, htmlMediaElement);
htmlMediaElement.style.display = 'none';
Expand Down

0 comments on commit 7d6240b

Please sign in to comment.