Merge pull request #1590 from edx/db/youtube-fallback

If the YouTube API JS fails to load, the rest of the JS should still run
This commit is contained in:
David Baumgold
2013-11-05 07:46:34 -08:00
2 changed files with 10 additions and 4 deletions

View File

@@ -80,10 +80,15 @@
// externally hosted files
"tender": "//edxedge.tenderapp.com/tender_widget",
"mathjax": "//edx-static.s3.amazonaws.com/mathjax-MathJax-727332c/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured",
// youtube URL does not end in ".js". We add "?noext" to the path so
// that require.js adds the ".js" to the query component of the URL,
// and leaves the path component intact.
"youtube": "//www.youtube.com/player_api?noext"
"youtube": [
// youtube URL does not end in ".js". We add "?noext" to the path so
// that require.js adds the ".js" to the query component of the URL,
// and leaves the path component intact.
"//www.youtube.com/player_api?noext",
// if youtube fails to load, fallback on a local file
// so that require doesn't fall over
"js/src/youtube_fallback"
]
},
shim: {
"gettext": {

View File

@@ -0,0 +1 @@
console.error("Can't load YouTube -- anything that relies on it will fail");