@internetarchive/bookreader 5.0.0-8 → 5.0.0-80
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +17 -15
- package/.github/workflows/node.js.yml +73 -10
- package/.github/workflows/npm-publish.yml +6 -20
- package/.testcaferc.js +10 -0
- package/BookReader/BookReader.css +398 -1133
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.LICENSE.txt +20 -20
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +1782 -0
- package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +7 -0
- package/BookReader/ia-bookreader-bundle.js.map +1 -0
- package/BookReader/icons/1up.svg +1 -1
- package/BookReader/icons/2up.svg +1 -1
- package/BookReader/icons/advance.svg +1 -1
- package/BookReader/icons/chevron-right.svg +1 -1
- package/BookReader/icons/close-circle-dark.svg +1 -1
- package/BookReader/icons/close-circle.svg +1 -1
- package/BookReader/icons/fullscreen.svg +1 -1
- package/BookReader/icons/fullscreen_exit.svg +1 -1
- package/BookReader/icons/hamburger.svg +1 -1
- package/BookReader/icons/left-arrow.svg +1 -1
- package/BookReader/icons/magnify-minus.svg +1 -1
- package/BookReader/icons/magnify-plus.svg +1 -1
- package/BookReader/icons/magnify.svg +1 -1
- package/BookReader/icons/pause.svg +1 -1
- package/BookReader/icons/play.svg +1 -1
- package/BookReader/icons/playback-speed.svg +1 -1
- package/BookReader/icons/read-aloud.svg +1 -1
- package/BookReader/icons/review.svg +1 -1
- package/BookReader/icons/thumbnails.svg +1 -1
- package/BookReader/icons/voice.svg +1 -0
- package/BookReader/icons/volume-full.svg +1 -1
- package/BookReader/images/BRicons.svg +3 -3
- package/BookReader/images/books_graphic.svg +1 -1
- package/BookReader/images/icon_book.svg +1 -1
- package/BookReader/images/icon_bookmark.svg +1 -1
- package/BookReader/images/icon_gear.svg +1 -1
- package/BookReader/images/icon_hamburger.svg +1 -1
- package/BookReader/images/icon_home.svg +1 -1
- package/BookReader/images/icon_info.svg +1 -1
- package/BookReader/images/icon_one_page.svg +1 -1
- package/BookReader/images/icon_pause.svg +1 -1
- package/BookReader/images/icon_play.svg +1 -1
- package/BookReader/images/icon_playback-rate.svg +1 -1
- package/BookReader/images/icon_search_button.svg +1 -1
- package/BookReader/images/icon_share.svg +1 -1
- package/BookReader/images/icon_skip-ahead.svg +1 -1
- package/BookReader/images/icon_skip-back.svg +1 -1
- package/BookReader/images/icon_speaker.svg +1 -1
- package/BookReader/images/icon_speaker_open.svg +1 -1
- package/BookReader/images/icon_thumbnails.svg +1 -1
- package/BookReader/images/icon_toc.svg +1 -1
- package/BookReader/images/icon_two_pages.svg +1 -1
- package/BookReader/images/marker_chap-off.svg +1 -1
- package/BookReader/images/marker_chap-on.svg +1 -1
- package/BookReader/images/marker_srch-on.svg +1 -1
- package/BookReader/jquery-3.js +2 -0
- package/BookReader/jquery-3.js.LICENSE.txt +24 -0
- package/BookReader/plugins/plugin.archive_analytics.js +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +1 -1
- package/BookReader/plugins/plugin.autoplay.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +25 -1
- package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.iframe.js +1 -1
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.iiif.js +2 -0
- package/BookReader/plugins/plugin.iiif.js.map +1 -0
- package/BookReader/plugins/plugin.resume.js +1 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +2 -1
- package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +2 -1
- package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +1 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/webcomponents-bundle.js +3 -0
- package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
- package/BookReader/webcomponents-bundle.js.map +1 -0
- package/BookReaderDemo/BookReaderDemo.css +18 -19
- package/BookReaderDemo/BookReaderJSAdvanced.js +0 -3
- package/BookReaderDemo/BookReaderJSAutoplay.js +4 -1
- package/BookReaderDemo/BookReaderJSSimple.js +1 -0
- package/BookReaderDemo/IADemoBr.js +147 -0
- package/BookReaderDemo/demo-advanced.html +2 -2
- package/BookReaderDemo/demo-autoplay.html +2 -3
- package/BookReaderDemo/demo-embed-iframe-src.html +2 -1
- package/BookReaderDemo/demo-fullscreen-mobile.html +3 -5
- package/BookReaderDemo/demo-fullscreen.html +2 -4
- package/BookReaderDemo/demo-iiif.html +99 -12
- package/BookReaderDemo/demo-internetarchive.html +214 -18
- package/BookReaderDemo/demo-multiple.html +2 -1
- package/BookReaderDemo/demo-preview-pages.html +2 -1
- package/BookReaderDemo/demo-simple.html +2 -1
- package/BookReaderDemo/demo-vendor-fullscreen.html +2 -4
- package/BookReaderDemo/ia-multiple-volumes-manifest.js +170 -0
- package/BookReaderDemo/immersion-1up.html +2 -2
- package/BookReaderDemo/immersion-mode.html +2 -4
- package/BookReaderDemo/toggle_controls.html +3 -2
- package/BookReaderDemo/view_mode.html +2 -1
- package/BookReaderDemo/viewmode-cycle.html +2 -3
- package/CHANGELOG.md +536 -33
- package/README.md +14 -1
- package/babel.config.js +20 -0
- package/codecov.yml +6 -0
- package/index.html +4 -1
- package/jsconfig.json +19 -0
- package/netlify.toml +9 -0
- package/package.json +70 -60
- package/renovate.json +52 -0
- package/scripts/preversion.js +0 -1
- package/src/BookNavigator/assets/bookmark-colors.js +1 -1
- package/src/BookNavigator/assets/button-base.js +4 -2
- package/src/BookNavigator/assets/ia-logo.js +17 -0
- package/src/BookNavigator/assets/icon_checkmark.js +1 -1
- package/src/BookNavigator/assets/icon_close.js +1 -1
- package/src/BookNavigator/book-navigator.js +590 -0
- package/src/BookNavigator/bookmarks/bookmark-button.js +3 -2
- package/src/BookNavigator/bookmarks/bookmark-edit.js +3 -4
- package/src/BookNavigator/bookmarks/bookmarks-list.js +2 -3
- package/src/BookNavigator/bookmarks/bookmarks-loginCTA.js +3 -8
- package/src/BookNavigator/bookmarks/bookmarks-provider.js +27 -17
- package/src/BookNavigator/bookmarks/ia-bookmarks.js +116 -67
- package/src/BookNavigator/delete-modal-actions.js +1 -1
- package/src/BookNavigator/downloads/downloads-provider.js +36 -21
- package/src/BookNavigator/downloads/downloads.js +41 -25
- package/src/BookNavigator/search/search-provider.js +49 -27
- package/src/BookNavigator/search/search-results.js +23 -9
- package/src/BookNavigator/sharing.js +27 -0
- package/src/BookNavigator/viewable-files.js +95 -0
- package/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js +11 -10
- package/src/BookNavigator/visual-adjustments/visual-adjustments.js +3 -3
- package/src/BookReader/BookModel.js +64 -34
- package/src/BookReader/DragScrollable.js +233 -0
- package/src/BookReader/Mode1Up.js +56 -351
- package/src/BookReader/Mode1UpLit.js +388 -0
- package/src/BookReader/Mode2Up.js +73 -1318
- package/src/BookReader/Mode2UpLit.js +776 -0
- package/src/BookReader/ModeCoordinateSpace.js +29 -0
- package/src/BookReader/ModeSmoothZoom.js +312 -0
- package/src/BookReader/ModeThumb.js +18 -12
- package/src/BookReader/Navbar/Navbar.js +14 -40
- package/src/BookReader/PageContainer.js +81 -6
- package/src/BookReader/ReduceSet.js +1 -1
- package/src/BookReader/Toolbar/Toolbar.js +10 -37
- package/src/BookReader/events.js +2 -3
- package/src/BookReader/options.js +27 -2
- package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
- package/src/BookReader/utils/ScrollClassAdder.js +31 -0
- package/src/BookReader/utils/SelectionObserver.js +45 -0
- package/src/BookReader/utils.js +118 -13
- package/src/BookReader.js +427 -1061
- package/src/assets/icons/magnify-minus.svg +3 -7
- package/src/assets/icons/magnify-plus.svg +3 -7
- package/src/assets/icons/voice.svg +1 -0
- package/src/css/BookReader.scss +1 -5
- package/src/css/_BRBookmarks.scss +1 -1
- package/src/css/_BRComponent.scss +1 -1
- package/src/css/_BRmain.scss +16 -3
- package/src/css/_BRnav.scss +12 -39
- package/src/css/_BRpages.scss +149 -40
- package/src/css/_BRsearch.scss +68 -25
- package/src/css/_BRtoolbar.scss +5 -5
- package/src/css/_TextSelection.scss +87 -27
- package/src/css/_colorbox.scss +2 -2
- package/src/css/_controls.scss +20 -7
- package/src/css/_icons.scss +1 -1
- package/src/ia-bookreader/ia-bookreader.js +224 -0
- package/src/plugins/plugin.archive_analytics.js +3 -3
- package/src/plugins/plugin.autoplay.js +5 -11
- package/src/plugins/plugin.chapters.js +237 -191
- package/src/plugins/plugin.iiif.js +151 -0
- package/src/plugins/plugin.resume.js +3 -3
- package/src/plugins/plugin.text_selection.js +464 -134
- package/src/plugins/plugin.vendor-fullscreen.js +4 -4
- package/src/plugins/search/plugin.search.js +142 -125
- package/src/plugins/search/utils.js +43 -0
- package/src/plugins/search/view.js +33 -58
- package/src/plugins/tts/AbstractTTSEngine.js +71 -40
- package/src/plugins/tts/FestivalTTSEngine.js +13 -14
- package/src/plugins/tts/PageChunk.js +15 -21
- package/src/plugins/tts/PageChunkIterator.js +8 -12
- package/src/plugins/tts/WebTTSEngine.js +87 -71
- package/src/plugins/tts/plugin.tts.js +96 -127
- package/src/plugins/tts/utils.js +15 -25
- package/src/plugins/url/UrlPlugin.js +191 -0
- package/src/plugins/{plugin.url.js → url/plugin.url.js} +45 -16
- package/src/util/browserSniffing.js +22 -0
- package/src/util/docCookies.js +21 -2
- package/tests/e2e/README.md +37 -0
- package/tests/e2e/autoplay.test.js +2 -2
- package/tests/e2e/base.test.js +8 -16
- package/tests/e2e/helpers/base.js +53 -48
- package/tests/e2e/helpers/debug.js +1 -1
- package/tests/e2e/helpers/params.js +17 -0
- package/tests/e2e/helpers/rightToLeft.js +8 -14
- package/tests/e2e/helpers/search.js +73 -0
- package/tests/e2e/models/Navigation.js +20 -37
- package/tests/e2e/rightToLeft.test.js +4 -5
- package/tests/e2e/viewmode.test.js +40 -33
- package/tests/jest/BookNavigator/book-navigator.test.js +661 -0
- package/tests/jest/BookNavigator/bookmarks/bookmark-button.test.js +43 -0
- package/tests/{karma → jest}/BookNavigator/bookmarks/bookmark-edit.test.js +25 -26
- package/tests/{karma → jest}/BookNavigator/bookmarks/bookmarks-list.test.js +41 -42
- package/tests/jest/BookNavigator/bookmarks/ia-bookmarks.test.js +45 -0
- package/tests/jest/BookNavigator/downloads/downloads-provider.test.js +67 -0
- package/tests/jest/BookNavigator/downloads/downloads.test.js +53 -0
- package/tests/jest/BookNavigator/search/search-provider.test.js +167 -0
- package/tests/{karma → jest}/BookNavigator/search/search-results.test.js +109 -60
- package/tests/jest/BookNavigator/sharing/sharing-provider.test.js +49 -0
- package/tests/jest/BookNavigator/viewable-files/viewable-files-provider.test.js +80 -0
- package/tests/jest/BookNavigator/visual-adjustments.test.js +200 -0
- package/tests/{BookReader → jest/BookReader}/BookModel.test.js +74 -14
- package/tests/jest/BookReader/BookReaderPublicFunctions.test.js +193 -0
- package/tests/{BookReader → jest/BookReader}/ImageCache.test.js +4 -4
- package/tests/jest/BookReader/Mode1UpLit.test.js +73 -0
- package/tests/jest/BookReader/Mode2Up.test.js +98 -0
- package/tests/jest/BookReader/Mode2UpLit.test.js +190 -0
- package/tests/jest/BookReader/ModeCoordinateSpace.test.js +16 -0
- package/tests/jest/BookReader/ModeSmoothZoom.test.js +218 -0
- package/tests/jest/BookReader/ModeThumb.test.js +71 -0
- package/tests/{BookReader → jest/BookReader}/Navbar/Navbar.test.js +10 -10
- package/tests/{BookReader → jest/BookReader}/PageContainer.test.js +88 -6
- package/tests/{BookReader → jest/BookReader}/ReduceSet.test.js +1 -1
- package/tests/{BookReader → jest/BookReader}/Toolbar/Toolbar.test.js +2 -2
- package/tests/jest/BookReader/utils/HTMLDimensionsCacher.test.js +59 -0
- package/tests/jest/BookReader/utils/ScrollClassAdder.test.js +49 -0
- package/tests/jest/BookReader/utils/SelectionObserver.test.js +57 -0
- package/tests/{BookReader → jest/BookReader}/utils/classes.test.js +1 -1
- package/tests/jest/BookReader/utils.test.js +229 -0
- package/tests/jest/BookReader.keyboard.test.js +190 -0
- package/tests/{BookReader.options.test.js → jest/BookReader.options.test.js} +9 -1
- package/tests/{BookReader.test.js → jest/BookReader.test.js} +26 -37
- package/tests/{plugins → jest/plugins}/plugin.archive_analytics.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.autoplay.test.js +4 -4
- package/tests/jest/plugins/plugin.chapters.test.js +195 -0
- package/tests/{plugins → jest/plugins}/plugin.iframe.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.resume.test.js +3 -3
- package/tests/jest/plugins/plugin.text_selection.test.js +317 -0
- package/tests/{plugins → jest/plugins}/plugin.vendor-fullscreen.test.js +2 -2
- package/tests/{plugins → jest/plugins}/search/plugin.search.test.js +25 -47
- package/tests/{plugins → jest/plugins}/search/plugin.search.view.test.js +39 -6
- package/tests/jest/plugins/search/utils.js +25 -0
- package/tests/jest/plugins/search/utils.test.js +29 -0
- package/tests/{plugins → jest/plugins}/tts/AbstractTTSEngine.test.js +29 -9
- package/tests/{plugins → jest/plugins}/tts/FestivalTTSEngine.test.js +4 -4
- package/tests/{plugins → jest/plugins}/tts/PageChunk.test.js +1 -1
- package/tests/{plugins → jest/plugins}/tts/PageChunkIterator.test.js +3 -3
- package/tests/{plugins → jest/plugins}/tts/WebTTSEngine.test.js +47 -1
- package/tests/{plugins → jest/plugins}/tts/utils.test.js +1 -60
- package/tests/jest/plugins/url/UrlPlugin.test.js +198 -0
- package/tests/{plugins → jest/plugins/url}/plugin.url.test.js +53 -14
- package/tests/jest/setup.js +3 -0
- package/tests/{util → jest/util}/browserSniffing.test.js +1 -1
- package/tests/jest/util/docCookies.test.js +24 -0
- package/tests/{util → jest/util}/strings.test.js +1 -1
- package/tests/{utils.js → jest/utils.js} +38 -0
- package/webpack.config.js +12 -6
- package/.babelrc +0 -12
- package/.dependabot/config.yml +0 -6
- package/.testcaferc.json +0 -5
- package/BookReader/bookreader-component-bundle.js +0 -1450
- package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
- package/BookReader/bookreader-component-bundle.js.map +0 -1
- package/BookReader/jquery-1.10.1.js +0 -2
- package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
- package/BookReader/plugins/plugin.menu_toggle.js +0 -2
- package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
- package/BookReader/plugins/plugin.mobile_nav.js +0 -2
- package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
- package/BookReaderDemo/IIIFBookReader.js +0 -207
- package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
- package/BookReaderDemo/demo-iiif.js +0 -26
- package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
- package/karma.conf.js +0 -23
- package/src/BookNavigator/BookModel.js +0 -14
- package/src/BookNavigator/BookNavigator.js +0 -446
- package/src/BookNavigator/assets/book-loader.js +0 -27
- package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
- package/src/BookNavigator/search/a-search-result.js +0 -55
- package/src/BookReader/DebugConsole.js +0 -54
- package/src/BookReaderComponent/BookReaderComponent.js +0 -112
- package/src/ItemNavigator/ItemNavigator.js +0 -376
- package/src/ItemNavigator/providers/sharing.js +0 -29
- package/src/css/_MobileNav.scss +0 -194
- package/src/dragscrollable-br.js +0 -261
- package/src/lit-wrapper.js +0 -2
- package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
- package/src/plugins/plugin.mobile_nav.js +0 -287
- package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
- package/tests/BookReader/DebugConsole.test.js +0 -25
- package/tests/BookReader/Mode1Up.test.js +0 -164
- package/tests/BookReader/Mode2Up.test.js +0 -247
- package/tests/BookReader/utils.test.js +0 -109
- package/tests/e2e/helpers/desktopSearch.js +0 -72
- package/tests/e2e/helpers/mobileSearch.js +0 -85
- package/tests/e2e/ia-production/ia-prod-base.js +0 -17
- package/tests/karma/BookNavigator/book-navigator.test.js +0 -132
- package/tests/karma/BookNavigator/search/search-provider.test.js +0 -23
- package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
- package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
- package/tests/plugins/plugin.chapters.test.js +0 -130
- package/tests/plugins/plugin.mobile_nav.test.js +0 -66
- package/tests/plugins/plugin.text_selection.test.js +0 -203
- package/tests/util/docCookies.test.js +0 -15
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunk.js","webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunkIterator.js","webpack://@internetarchive/bookreader/./src/plugins/tts/AbstractTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/utils.js","webpack://@internetarchive/bookreader/./src/plugins/tts/FestivalTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/plugin.tts.js","webpack://@internetarchive/bookreader/./src/plugins/tts/WebTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/tooltip_dict.js","webpack://@internetarchive/bookreader/./src/util/browserSniffing.js","webpack://@internetarchive/bookreader/./node_modules/core-js/internals/function-bind.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.assign.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.get-prototype-of.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.reflect.construct.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.reflect.get.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.match.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.string.starts-with.js","webpack://@internetarchive/bookreader/./node_modules/iso-language-codes/js/data.js","webpack://@internetarchive/bookreader/./node_modules/jquery.browser/dist/jquery.browser.js","webpack://@internetarchive/bookreader/./node_modules/soundmanager2/script/soundmanager2.js"],"names":["PageChunk","leafIndex","chunkIndex","text","lineRects","this","server","bookPath","Promise","res","rej","$","ajax","type","url","dataType","cache","data","path","page","error","then","chunks","_fromTextWrapperResponse","chunksResponse","map","c","i","correctedLineRects","_fixChunkRects","slice","correctedText","_removeDanglingHyphens","rects","length","firstRect","secondRect","left","bottom","width","secondHeight","secondWidth","secondRight","replace","PageChunkIterator","pageCount","start","opts","Object","assign","DEFAULT_OPTS","_cursor","chunk","_bufferedPages","_bufferingPages","_cursorLock","resolve","_nextUncontrolled","_decrementUncontrolled","AT_END","_recenterBuffer","_fetchPageChunks","cursorChangePromise","prevPageChunks","index","Math","max","pageBufferSize","end","min","_removePageFromBuffer","_fetchPageChunksDirect","fetch","AbstractTTSEngine","options","playing","paused","_chunkIterator","activeSound","playbackRate","events","voice","on","getBestBookVoice","getVoices","bookLanguage","trigger","Error","voices","userLanguages","navigator","languages","bookLangVoices","filter","v","lang","startsWith","matchingUserLangs","language","getMatchingVoice","find","default","matchingVoices","numLeafs","onLoadingStart","step","stop","fireEvent","pause","resume","finish","all","decrement","newRate","setPlaybackRate","next","onDone","sound","createSound","rate","load","onLoadingComplete","beforeChunkPlay","playPromise","playSound","afterChunkPlay","loaded","play","promisifyEvent","target","eventType","addEventListener","resolver","ev","removeEventListener","sleep","ms","setTimeout","isAndroid","userAgent","test","COLUMN_TO_LANG_INDEX","searchForISO6391","columnsToSearch","langs","colI","column","split","x","toLowerCase","indexOf","FestivalTTSEngine","audioFormat","browser","mozilla","localService","name","voiceURI","soundManager","setup","debugMode","preferFlash","useHTML5Audio","flashVersion","promise","match","iOSCaptureUserIntentHack","FestivalTTSSound","getSoundUrl","dataString","encodeURIComponent","SILENCE_1MS","onfinish","destruct","supported","soundUrl","_finishResolver","onload","onresume","mp3","ogg","super_","WebTTSEngine","speechSynthesis","audio","Audio","SILENCE_6S_MP3","loop","src","mediaSession","metadata","MediaMetadata","title","br","bookTitle","artist","m","label","value","artwork","thumbnail","setActionHandler","jumpBackward","jumpForward","WebTTSSound","window","started","stopped","utterance","_lastEvents","boundary","_charIndex","_finishPromise","SpeechSynthesisUtterance","location","toString","console","log","dispatchEvent","CustomEvent","wasPaused","recentEvent","charIndex","cancel","speak","isLocalVoice","isChrome","_chromePausingBugFix","endPromise","race","Event","pausePromise","pauseMightNotWork","isFirefox","timeoutPromise","result","resumeMightNotWork","resumeMightNotFire","resumePromise","reload","en","jQuery","extend","BookReader","defaultOptions","enableTtsPlugin","prototype","call","ttsHilites","TTSEngine","isSupported","engineName","festival","web","ttsEngine","showProgressPopup","bind","removeProgressPopup","ttsStop","ttsBeforeChunkPlay","ttsSendChunkFinishedAnalyticsEvent","init","eventNames","fragmentChange","mode","constMode2up","visibleSelector","twoPage","currentIndexL","currentIndexR","join","show","not","hide","PostInit","click","ttsToggle","ttsStart","buildMobileDrawerElement","$el","after","imagesBaseURL","initNavbar","refs","$BRReadAloudToolbar","prepend","ttsUpdateState","ttsPlayPause","ttsJumpForward","ttsJumpBackward","$rateSelector","change","parseFloat","val","tooltips","insertBefore","closest","autoStop","startTTSEngine","constModeThumb","switchMode","constMode1up","addClass","ttsSendAnalyticsEvent","currentIndex","getNumLeafs","isPlaying","toggleClass","togglePlayPause","removeClass","ttsRemoveHilites","ttsMaybeFlipToIndex","ttsHighlightChunk","ttsScrollToChunk","in2PageMode","animationFinishedCallback","prev","jumpToIndex","ttsHilite2UP","ttsHilite1UP","leafTop","parseInt","_getPageHeight","reduce","padding","chunkTop","chunkBot","topOfFirstChunk","botOfLastChunk","containerTop","$brContainer","prop","containerBot","height","animate","scrollTop","l","b","r","t","div","document","createElement","push","appendTo","css","top","$brTwoPageView","setHilightCss2UP","remove","action","archiveAnalyticsSendEvent","extraValues","mediaLanguage","vendor","isSafari","aFunction","isObject","factories","construct","C","argsLength","args","list","Function","module","exports","that","fn","partArgs","arguments","boundFunction","concat","apply","stat","forced","fails","toObject","nativeGetPrototypeOf","CORRECT_PROTOTYPE_GETTER","sham","getPrototypeOf","it","getBuiltIn","anObject","create","nativeConstruct","NEW_TARGET_BUG","F","ARGS_BUG","FORCED","Target","newTarget","$args","proto","instance","has","getOwnPropertyDescriptorModule","get","propertyKey","descriptor","receiver","f","undefined","fixRegExpWellKnownSymbolLogic","toLength","requireObjectCoercible","advanceStringIndex","regExpExec","MATCH","nativeMatch","maybeCallNative","regexp","O","matcher","RegExp","String","done","rx","S","global","fullUnicode","unicode","lastIndex","A","n","matchStr","getOwnPropertyDescriptor","notARegExp","correctIsRegExpLogic","IS_PURE","$startsWith","CORRECT_IS_REGEXP_LOGIC","writable","searchString","search","uaMatch","ua","exec","platform_match","matched","version","versionNumber","platform","android","bb","blackberry","ipad","iphone","ipod","kindle","playbook","silk","mobile","cros","mac","linux","win","desktop","chrome","opr","safari","webkit","rv","iemobile","ie","edge","msedge","opera","jQBrowser","factory","_undefined","SoundManager","smURL","smID","setupOptions","debugFlash","useConsole","consoleOnly","waitForWindowLoad","bgColor","useHighPerformance","flashPollingInterval","html5PollingInterval","flashLoadTimeout","wmode","allowScriptAccess","useFlashBlock","forceUseGlobalHTML5Audio","ignoreMobileRestrictions","html5Test","noSWFCache","idPrefix","autoLoad","autoPlay","from","loops","onid3","onerror","whileloading","onplay","onpause","whileplaying","onposition","onstop","multiShot","multiShotEvents","position","pan","stream","to","usePolicyFile","volume","flash9Options","onfailure","isMovieStar","usePeakData","useWaveformData","useEQData","onbufferchange","ondataerror","movieStarOptions","bufferTime","serverURL","onconnect","duration","audioFormats","required","mp4","related","opus","wav","flac","movieID","id","debugID","debugURLParam","movieURL","altURL","swfLoaded","enabled","oMC","sounds","soundIDs","muted","didFlashBlock","filePattern","filePatterns","flash8","flash9","features","buffering","peakData","waveformData","eqData","movieStar","sandbox","types","remote","localWithFile","localWithNetwork","localTrusted","description","noRemote","noLocal","html5","usingFlash","flash","html5Only","ignoreFlash","SMSound","doNothing","setProperties","fV","debugTS","_wDS","initComplete","mixin","extraOptions","addOnEvent","processOnEvents","initUserOnload","delayWaitForEI","waitForEI","rebootIntoHTML5","setVersionInfo","handleFocus","strings","initMovie","domContentLoaded","winOnLoad","didDCLoaded","getDocument","createMovie","catchError","setPolling","initDebug","disableObject","failSafely","normalizeMovieURL","str","flashBlockHandler","getSWFCSS","swfCSS","toggleDebug","loopFix","policyFix","complain","idCheck","startTimer","stopTimer","timerExecute","parseURL","canIgnoreFlash","featureCheck","html5OK","html5CanPlay","html5ErrorCodes","html5Ext","html5Unload","domContentLoadedIE","testHTML5","event","lastGlobalHTML5URL","hasFlash","detectFlash","badSafariFix","html5_events","showSupport","flushMessages","wrapCallback","didSetup","sm2","globalHTML5Audio","sm","smc","wl","href","doc","on_queue","debugOpen","didAppend","appendSuccess","didInit","disabled","windowLoaded","wdCount","debugLevels","oRemoved","oRemovedHTML","waitingForEI","initPending","h5TimerCount","h5IntervalTimer","messages","needsFlash","Array","useGlobalHTML5Audio","idCounter","msecScale","is_iDevice","isIE","isWebkit","isOpera","mobileHTML5","isBadSafari","hasConsole","isFocused","hasFocus","tryInitOnFocus","okToDisable","flashMIME","emptyURL","overHTTP","protocol","http","netStreamMimeTypes","netStreamTypes","netStreamPattern","preferFlashCheck","kind","html5_event","oFn","e","s","_s","_a","_wD","h5","mimePattern","useAltURL","swfBox","swfDefault","swfError","swfTimedout","swfUnblocked","sm2Debug","highPerf","flashDebug","hasHTML5","canPlayType","noURL","ok","globalHTML5","ignoreMobile","mobileUA","beginDelayedInit","readyState","getMovie","movie_id","oOptions","_url","cs","cs_string","oSound","charAt","make","_setup_html5","_createSound","connected","destroySound","sID","_bFromSound","oS","_iO","unload","splice","onPosition","nPosition","oMethod","oScope","clearOnPosition","overloaded","allowOverride","setPosition","nMsecOffset","stopAll","hasOwnProperty","pauseAll","resumeAll","togglePause","setPan","nPan","setVolume","nVol","j","isNaN","mute","muteAll","unmute","unmuteAll","toggleMute","getMemoryUse","ram","_getMemoryUse","disable","bNoDisable","canPlayMIME","sMIME","canPlayURL","sURL","canPlayLink","oLink","getSoundById","_suppressDebug","onready","sType","ontimeout","_writeDebug","sText","sTypeOrObject","o","oItem","className","appendChild","createTextNode","style","fontWeight","color","firstChild","alert","_debug","reboot","resetEvents","excludeInit","k","innerHTML","parentNode","removeChild","fired","reset","getMoviePercent","PercentLoaded","resetProperties","add_html5_events","remove_html5_events","stop_html5_timer","start_html5_timer","attachOnPosition","detachOnPosition","applyFromTo","lastHTML5State","urlOmitted","onplay_called","onPositionItems","onPositionFired","lastURL","time","instanceOptions","isHTML5","id3","playState","_called_load","_html5_canplay","autobuffer","preload","_load","fatal","_unload","_bFromSM","_destroySound","_updatePlayState","fN","a","audioClone","onended","oncanplay","startOK","getAutoPlay","setAutoPlay","substr","lastIndexOf","instanceCount","_oncanplay","_onfinish","currentTime","err","add","_start","onplayerror","bAll","originalPosition","_onbufferchange","_resetOnPosition","_onTimer","_stop","_setAutoPlay","normalizedRate","message","position1K","offset","toFixed","_setPosition","_bCallFlash","_pause","bInstanceOnly","_setPan","_bInstanceOnly","_setVolume","hasIO","method","scope","_processOnPosition","item","op","retainPosition","_hasTimer","bytesLoaded","bytesTotal","durationEstimate","buffered","right","failures","isBuffering","bForce","isNew","_get_html5_duration","_whileplaying","d","Infinity","_apply_loop","nLoops","sameURL","dURL","decodeURI","_added_events","oEvt","_onload","nSuccess","loadOK","_onerror","errorCode","nIsBuffering","_onsuspend","onsuspend","_onfailure","msg","level","code","_onwarning","onwarning","io_onfinish","_whileloading","nBytesLoaded","nBytesTotal","nDuration","nBufferLength","floor","bufferLength","oPeakData","oWaveformDataLeft","oWaveformDataRight","oEQData","eqLeft","leftPeak","rightPeak","leftEQ","rightEQ","_oncaptiondata","oData","captiondata","oncaptiondata","_onmetadata","oMDProps","oMDData","onmetadata","_onid3","oID3Props","oID3Data","_onconnect","bSuccess","_ondataerror","sError","body","getElementsByTagName","getElementById","oMain","oAdd","o2","o1","callback","oParent","hasParent","bonusOptions","old","evt","getArgs","oArgs","len","pop","element","shift","abort","canplay","ee","canplaythrough","durationchange","ended","loadeddata","_loaded","loadedmetadata","loadstart","fromCharCode","progress","progStr","isProgress","ranges","total","ratechange","suspend","stalled","timeupdate","waiting","iO","oAudio","_called_unload","fileExt","mime","aF","lookup","support","cp","canPlay","isOK","notReady","notOK","domError","spcWmode","swf404","tryDebug","checkSWF","localFail","waitFocus","waitForever","waitSWF","needFunction","badID","currentObj","waitOnload","docLoaded","onloadOK","secNote","badRemove","shutdown","queue","smError","fbTimeout","fbLoaded","fbHandler","manURL","onURL","badFV","as2loop","noNSLoop","needfl9","mfTimeout","needFlash","gotFocus","policy","setupError","setupUndef","setupLate","sm2Loaded","sstr","sOpt","sPre","sMsg","warn","oProp","Date","getTime","isDebug","bPolling","bHighPerformance","_setPolling","oD","oDebug","oTarget","oToggle","tmp","lineHeight","margin","textAlign","border","cursor","background","zIndex","onclick","display","e2","errorLevel","oT","sEventType","sMessage","sm2Debugger","handleEvent","p","ignoreInit","status","success","srcQueue","canRetry","obj","nP","hasPlugin","AX","ActiveXObject","plugins","mimeTypes","enabledPlugin","flashNeeded","formats","urlResult","setInterval","clearInterval","_setSandboxType","sandboxType","sb","_externalInterfaceOK","swfVersion","initMsg","isRTL","oEmbed","oMovie","movieHTML","oEl","sClass","remoteURL","localURL","extraClass","html","param","dir","quality","bgcolor","pluginspage","hasPriority","FlashVars","setAttribute","overflow","abs","oninitmovie","loadIncomplete","cleanup","tests","_externalInterfaceTest","_disableDebug","detachEvent","attachEvent","SM2_DEFER","constructor","getInstance","smBuilder"],"mappings":";m9CAGqBA,E,WAOnB,WAAYC,EAAWC,EAAYC,EAAMC,I,4FAAW,SAClDC,KAAKJ,UAAYA,EACjBI,KAAKH,WAAaA,EAClBG,KAAKF,KAA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Q,aAAeA,EAQtB3Q,EAAO/C,aAAeA,EAtnMtB,CAwnME+C,U","file":"plugins/plugin.tts.js","sourcesContent":["/**\n * Class to manage a 'chunk' (approximately a paragraph) of text on a page.\n */\nexport default class PageChunk {\n /**\n * @param {number} leafIndex\n * @param {number} chunkIndex\n * @param {string} text\n * @param {DJVURect[]} lineRects\n */\n constructor(leafIndex, chunkIndex, text, lineRects) {\n this.leafIndex = leafIndex;\n this.chunkIndex = chunkIndex;\n this.text = text;\n this.lineRects = lineRects;\n }\n\n /**\n * @param {string} server\n * @param {string} bookPath\n * @param {number} leafIndex\n * @return {Promise<PageChunk[]>}\n */\n static fetch(server, bookPath, leafIndex) {\n // jquery's ajax \"PromiseLike\" implementation is inconsistent with\n // modern Promises, so convert it to a full promise (it doesn't forward\n // a returned promise to the next handler in the chain, which kind of\n // defeats the entire point of using promises to avoid \"callback hell\")\n return new Promise((res, rej) => {\n $.ajax({\n type: 'GET',\n url: `https://${server}/BookReader/BookReaderGetTextWrapper.php`,\n dataType:'jsonp',\n cache: true,\n data: {\n path: `${bookPath}_djvu.xml`,\n page: leafIndex\n },\n error: rej,\n })\n .then(chunks => {\n res(PageChunk._fromTextWrapperResponse(leafIndex, chunks));\n });\n });\n }\n\n /**\n * Convert the response from BookReaderGetTextWrapper.php into a {@link PageChunk} instance\n * @param {number} leafIndex\n * @param {Array<[String, ...DJVURect[]]>} chunksResponse\n * @return {PageChunk[]}\n */\n static _fromTextWrapperResponse(leafIndex, chunksResponse) {\n return chunksResponse.map((c, i) => {\n const correctedLineRects = PageChunk._fixChunkRects(c.slice(1));\n const correctedText = PageChunk._removeDanglingHyphens(c[0]);\n return new PageChunk(leafIndex, i, correctedText, correctedLineRects);\n });\n }\n\n /**\n * @private\n * Sometimes the first rectangle will be ridiculously wide/tall. Find those and fix them\n * *NOTE*: Modifies the original array and returns it.\n * *NOTE*: This should probably be fixed on the petabox side, and then removed here\n * Has 2 problems:\n * - If the rect is the last rect on the page (and hence the only rect in the array),\n * the rect's size isn't fixed\n * - Because this relies on the second rect, there's a chance it won't be the right\n * width\n * @param {DJVURect[]} rects\n * @return {DJVURect[]}\n */\n static _fixChunkRects(rects) {\n if (rects.length < 2) return rects;\n\n const [firstRect, secondRect] = rects;\n const [left, bottom, right] = firstRect;\n const width = right - left;\n const secondHeight = secondRect[1] - secondRect[3];\n const secondWidth = secondRect[2] - secondRect[0];\n const secondRight = secondRect[2];\n\n if (width > secondWidth * 30) {\n // Set the end to be the same\n firstRect[2] = secondRight;\n // And the top to be the same height\n firstRect[3] = bottom - secondHeight;\n }\n\n return rects;\n }\n\n /**\n * Remove \"dangling\" hyphens from read aloud text to avoid TTS stuttering\n * @param {string} text\n * @return {string}\n */\n static _removeDanglingHyphens(text) {\n return text.replace(/-\\s+/g, '');\n }\n}\n\n/**\n * @typedef {[number, number, number, number]} DJVURect\n * coords are in l,b,r,t order\n */\n","import PageChunk from './PageChunk.js';\n\n/**\n * Class that iterates over the page chunks of a book; caching/buffering\n * as much as possible to try to ensure a smooth experience.\n */\nexport default class PageChunkIterator {\n /**\n * @param {number} pageCount total number of pages\n * @param {number} start page to start on\n * @param {PageChunkIteratorOptions} opts\n */\n constructor(pageCount, start, opts) {\n this.pageCount = pageCount;\n this.opts = Object.assign({}, DEFAULT_OPTS, opts);\n /** Position in the chunk sequence */\n this._cursor = { page: start, chunk: 0 };\n /** @type {Object<number, PageChunk[]>} leaf index -> chunks*/\n this._bufferedPages = {};\n /** @type {Object<number, PromiseLike<PageChunk[]>} leaf index -> chunks*/\n this._bufferingPages = {};\n /**\n * @type {Promise} promise that manages cursor modifications so that they\n * happen in order triggered as opposed to order the server responds\n **/\n this._cursorLock = Promise.resolve();\n }\n\n /**\n * Get the next chunk\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n next() {\n return this._cursorLock = this._cursorLock\n .then(() => this._nextUncontrolled());\n }\n\n /**\n * Sends the cursor back 1\n * @return {Promise}\n **/\n decrement() {\n return this._cursorLock = this._cursorLock\n .then(() => this._decrementUncontrolled());\n }\n\n /**\n * Gets without ensuring synchronization. Since this iterator has a lot of async\n * code, calling e.g. \"next\" twice (before the first call to next has finished)\n * would cause the system to be in a weird state. To avoid that, we make sure calls\n * to next and decrement (functions that modify the cursor) are synchronized,\n * so that regardless how long it takes for one to respond, they'll always be executed\n * in the correct order.\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n _nextUncontrolled() {\n if (this._cursor.page == this.pageCount) {\n return Promise.resolve(PageChunkIterator.AT_END);\n }\n\n this._recenterBuffer(this._cursor.page);\n\n return this._fetchPageChunks(this._cursor.page)\n .then(chunks => {\n if (this._cursor.chunk == chunks.length) {\n this._cursor.page++;\n this._cursor.chunk = 0;\n return this._nextUncontrolled();\n }\n return chunks[this._cursor.chunk++];\n });\n }\n\n /**\n * Decrements without ensuring synchronization. (See {@link PageChunkIterator._nextUncontrolled});\n * @return {Promise}\n */\n _decrementUncontrolled() {\n let cursorChangePromise = Promise.resolve();\n\n if (this._cursor.chunk > 0) {\n this._cursor.chunk--;\n } else if (this._cursor.page > 0) {\n this._cursor.page--;\n // Go back possibly multiple pages, because pages can be blank\n cursorChangePromise = this._fetchPageChunks(this._cursor.page)\n .then(prevPageChunks => {\n if (prevPageChunks.length == 0) return this._decrementUncontrolled();\n else this._cursor.chunk = prevPageChunks.length - 1;\n });\n }\n\n return cursorChangePromise\n .then(() => this._fetchPageChunks(this._cursor.page));\n }\n\n /**\n * Recenter the buffer around the provided page index\n * @param {number} index\n */\n _recenterBuffer(index) {\n const start = Math.max(0, index - this.opts.pageBufferSize);\n const end = Math.min(this.pageCount, index + this.opts.pageBufferSize + 1);\n for (let i = start; i < end; i++) {\n this._fetchPageChunks(i);\n }\n\n this._removePageFromBuffer(start - 1);\n this._removePageFromBuffer(end + 1);\n }\n\n /**\n * @param {number} index\n */\n _removePageFromBuffer(index) {\n delete this._bufferingPages[index];\n delete this._bufferedPages[index];\n }\n\n /**\n * Fetches the chunks on a page; checks the buffer, so it won't make unnecessary\n * requests if it's called multiple times for the same index.\n * @param {number} index\n * @return {Promise<PageChunk[]>}\n */\n _fetchPageChunks(index) {\n if (index in this._bufferingPages) return this._bufferingPages[index];\n if (index in this._bufferedPages) return Promise.resolve(this._bufferedPages[index]);\n\n this._bufferingPages[index] = this._fetchPageChunksDirect(index)\n .then(chunks => {\n delete this._bufferingPages[index];\n this._bufferedPages[index] = chunks;\n return chunks;\n });\n\n return this._bufferingPages[index];\n }\n\n /**\n * Fetches a page without checking buffer\n * @param {number} index\n */\n _fetchPageChunksDirect(index) {\n return PageChunk.fetch(this.opts.server, this.opts.bookPath, index);\n }\n}\n\nPageChunkIterator.AT_END = \"__PageChunkIterator.AT_END__\";\n\n/** @type {PageChunkIteratorOptions} */\nconst DEFAULT_OPTS = {\n server: null,\n bookPath: null,\n pageBufferSize: 2,\n};\n\n/**\n * @typedef {Object} PageChunkIteratorOptions\n * @property {string} server\n * @property {string} bookPath\n * @property {number} [pageBufferSize] number of pages to buffer before/after the current page\n */\n","import PageChunkIterator from './PageChunkIterator.js';\n/** @typedef {import('./utils.js').ISO6391} ISO6391 */\n/** @typedef {import('./PageChunk.js')} PageChunk */\n\n/**\n * @export\n * @typedef {Object} TTSEngineOptions\n * @property {String} server\n * @property {String} bookPath\n * @property {ISO6391} bookLanguage\n * @property {Function} onLoadingStart\n * @property {Function} onLoadingComplete\n * @property {Function} onDone called when the entire book is done\n * @property {function(PageChunk): PromiseLike} beforeChunkPlay will delay the playing of the chunk\n * @property {function(PageChunk): void} afterChunkPlay fires once a chunk has fully finished\n */\n\n/**\n * @typedef {Object} AbstractTTSSound\n * @property {PageChunk} chunk\n * @property {boolean} loaded\n * @property {number} rate\n * @property {SpeechSynthesisVoice} voice\n * @property {(callback: Function) => void} load\n * @property {() => PromiseLike} play\n * @property {() => Promise} stop\n * @property {() => void} pause\n * @property {() => void} resume\n * @property {() => void} finish force the sound to 'finish'\n * @property {number => void} setPlaybackRate\n **/\n\n/** Handling bookreader's text-to-speech */\nexport default class AbstractTTSEngine {\n /**\n * @protected\n * @param {TTSEngineOptions} options\n */\n constructor(options) {\n this.playing = false;\n this.paused = false;\n this.opts = options;\n /** @type {PageChunkIterator} */\n this._chunkIterator = null;\n /** @type {AbstractTTSSound} */\n this.activeSound = null;\n this.playbackRate = 1;\n /** Events we can bind to */\n this.events = $({});\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n // Listen for voice changes (fired by subclasses)\n this.events.on('voiceschanged', () => {\n this.voice = AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n });\n this.events.trigger('voiceschanged');\n }\n\n /**\n * @abstract\n * @return {boolean}\n */\n static isSupported() { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @abstract\n * @return {SpeechSynthesisVoice[]}\n */\n getVoices() { throw new Error(\"Unimplemented abstract class\"); }\n\n /** @abstract */\n init() { return null; }\n\n /**\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n this.playing = true;\n this.opts.onLoadingStart();\n\n this._chunkIterator = new PageChunkIterator(numLeafs, leafIndex, {\n server: this.opts.server,\n bookPath: this.opts.bookPath,\n pageBufferSize: 5,\n });\n\n this.step();\n this.events.trigger('start');\n }\n\n stop() {\n if (this.activeSound) this.activeSound.stop();\n this.playing = false;\n this._chunkIterator = null;\n this.activeSound = null;\n this.events.trigger('stop');\n }\n\n /** @public */\n pause() {\n const fireEvent = !this.paused && this.activeSound;\n this.paused = true;\n if (this.activeSound) this.activeSound.pause();\n if (fireEvent) this.events.trigger('pause');\n }\n\n /** @public */\n resume() {\n const fireEvent = this.paused && this.activeSound;\n this.paused = false;\n if (this.activeSound) this.activeSound.resume();\n if (fireEvent) this.events.trigger('resume');\n }\n\n togglePlayPause() {\n if (this.paused) this.resume();\n else this.pause();\n }\n\n /** @public */\n jumpForward() {\n if (this.activeSound) this.activeSound.finish();\n }\n\n /** @public */\n jumpBackward() {\n Promise.all([\n this.activeSound.stop(),\n this._chunkIterator.decrement()\n .then(() => this._chunkIterator.decrement())\n ])\n .then(() => this.step());\n }\n\n /** @param {number} newRate */\n setPlaybackRate(newRate) {\n this.playbackRate = newRate;\n if (this.activeSound) this.activeSound.setPlaybackRate(newRate);\n }\n\n /** @private */\n step() {\n this._chunkIterator.next()\n .then(chunk => {\n if (chunk == PageChunkIterator.AT_END) {\n this.stop();\n this.opts.onDone();\n return;\n }\n\n this.opts.onLoadingStart();\n const sound = this.createSound(chunk);\n sound.chunk = chunk;\n sound.rate = this.playbackRate;\n sound.voice = this.voice;\n sound.load(() => this.opts.onLoadingComplete());\n\n this.opts.onLoadingComplete();\n return this.opts.beforeChunkPlay(chunk).then(() => sound);\n })\n .then(sound => {\n if (!this.playing) return;\n\n const playPromise = this.playSound(sound)\n .then(() => this.opts.afterChunkPlay(sound.chunk));\n if (this.paused) this.pause();\n return playPromise;\n })\n .then(() => {\n if (this.playing) return this.step();\n });\n }\n\n /**\n * @abstract\n * @param {PageChunk} chunk\n * @return {AbstractTTSSound}\n */\n createSound(chunk) { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @param {AbstractTTSSound} sound\n * @return {PromiseLike} promise called once playing finished\n */\n playSound(sound) {\n this.activeSound = sound;\n if (!this.activeSound.loaded) this.opts.onLoadingStart();\n return this.activeSound.play();\n }\n\n /** Convenience wrapper for {@see AbstractTTSEngine.getBestVoice} */\n getBestVoice() {\n return AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n }\n\n /**\n * @private\n * Find the best voice to use given the available voices, the book language, and the user's\n * languages.\n * @param {SpeechSynthesisVoice[]} voices\n * @param {ISO6391} bookLanguage\n * @param {string[]} userLanguages languages in BCP47 format (e.g. en-US). Ordered by preference.\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getBestBookVoice(voices, bookLanguage, userLanguages = navigator.languages) {\n const bookLangVoices = voices.filter(v => v.lang.startsWith(bookLanguage));\n // navigator.languages browser support isn't great yet, so get just 1 language otherwise\n // Sample navigator.languages: [\"en-CA\", \"fr-CA\", \"fr\", \"en-US\", \"en\", \"de-DE\", \"de\"]\n userLanguages = userLanguages || (navigator.language ? [navigator.language] : []);\n\n // user languages that match the book language\n const matchingUserLangs = userLanguages.filter(lang => lang.startsWith(bookLanguage));\n\n // Try to find voices that intersect these two sets\n return AbstractTTSEngine.getMatchingVoice(matchingUserLangs, bookLangVoices) ||\n // no user languages match the books; let's return the best voice for the book language\n (bookLangVoices.find(v => v.default) || bookLangVoices[0])\n // No voices match the book language? let's find a voice in the user's language\n // and ignore book lang\n || AbstractTTSEngine.getMatchingVoice(userLanguages, voices)\n // C'mon! Ok, just read with whatever we got!\n || (voices.find(v => v.default) || voices[0]);\n }\n\n /**\n * @private\n * Get the best voice that matches one of the BCP47 languages (order by preference)\n * @param {string[]} languages in BCP 47 format (e.g. 'en-US', or 'en'); ordered by preference\n * @param {SpeechSynthesisVoice[]} voices voices to choose from\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getMatchingVoice(languages, voices) {\n for (const lang of languages) {\n // Chrome Android was returning voice languages like `en_US` instead of `en-US`\n const matchingVoices = voices.filter(v => v.lang.replace('_', '-').startsWith(lang));\n if (matchingVoices.length) {\n return matchingVoices.find(v => v.default) || matchingVoices[0];\n }\n }\n }\n}\n","import langs from 'iso-language-codes/js/data.js';\n\n/**\n * Convert a EventTarget style event into a promise\n * @param {EventTarget} target\n * @param {string} eventType\n * @return {Promise<Event>}\n */\nexport function promisifyEvent(target, eventType) {\n return new Promise(res => {\n const resolver = ev => {\n target.removeEventListener(eventType, resolver);\n res(ev);\n };\n target.addEventListener(eventType, resolver);\n });\n}\n\n/**\n * Use regex to approximate word count in a string\n * @param {string} text\n * @return {number}\n */\nexport function approximateWordCount(text) {\n const m = text.match(/\\S+/g);\n return m ? m.length : 0;\n}\n\n/**\n * Waits the provided number of ms and then resolves with a promise\n * @param {number} ms\n * @return {Promise}\n */\nexport function sleep(ms) {\n return new Promise(res => setTimeout(res, ms));\n}\n\n/**\n * Checks whether the current browser is on android\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isAndroid(userAgent = navigator.userAgent) {\n return /android/i.test(userAgent);\n}\n\n/**\n * @typedef {string} ISO6391\n * Language code in ISO 639-1 format. e.g. en, fr, zh\n **/\n\n/** Each lang is an array, with each index mapping to a different property */\nconst COLUMN_TO_LANG_INDEX = {\n 'Name': 0,\n 'Endonym': 1,\n 'ISO 639-1': 2,\n 'ISO 639-2/T': 3,\n 'ISO 639-2/B': 4\n};\n\n/**\n * @param {string} language in some format\n * @return {ISO6391?}\n */\nexport function toISO6391(language) {\n if (!language) return null;\n language = language.toLowerCase();\n\n return searchForISO6391(language, ['ISO 639-1']) ||\n searchForISO6391(language, ['ISO 639-2/B']) ||\n searchForISO6391(language, ['ISO 639-2/T', 'Endonym', 'Name']);\n}\n\n/**\n * Searches for the given long in the given columns.\n * @param {string} language\n * @param {Array<keyof COLUMN_TO_LANG_INDEX>} columnsToSearch\n * @return {ISO6391?}\n */\nfunction searchForISO6391(language, columnsToSearch) {\n for (let i = 0; i < langs.length; i++) {\n for (let colI = 0; colI < columnsToSearch.length; colI++) {\n const column = columnsToSearch[colI];\n const columnValue = langs[i][COLUMN_TO_LANG_INDEX[column]];\n if (columnValue.split(', ').map(x => x.toLowerCase()).indexOf(language) != -1) {\n return langs[i][COLUMN_TO_LANG_INDEX['ISO 639-1']];\n }\n }\n }\n return null;\n}\n","import AbstractTTSEngine from './AbstractTTSEngine.js';\nimport { sleep } from './utils.js';\n/* global soundManager */\nimport 'soundmanager2';\nimport 'jquery.browser';\n\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Festival endpoint\n **/\nexport default class FestivalTTSEngine extends AbstractTTSEngine {\n /** @override */\n static isSupported() {\n return typeof(soundManager) !== 'undefined' && soundManager.supported();\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n // $.browsers is sometimes undefined on some Android browsers :/\n // Likely related to when $.browser was moved to npm\n /** @type {'mp3' | 'ogg'} format of audio to get */\n this.audioFormat = $.browser?.mozilla ? 'ogg' : 'mp3';\n }\n\n /** @override */\n getVoices() {\n return [\n { default: true, lang: \"en-US\", localService: false, name: \"Festival - English (US)\", voiceURI: null }\n ];\n }\n\n /** @override */\n init() {\n // setup sound manager\n soundManager.setup({\n debugMode: false,\n // Note, there's a bug in Chrome regarding range requests.\n // Flash is used as a workaround.\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=505707\n preferFlash: true,\n url: '/bookreader/BookReader/soundmanager/swf',\n useHTML5Audio: true,\n //flash 8 version of swf is buggy when calling play() on a sound that is still loading\n flashVersion: 9\n });\n }\n\n /**\n * @override\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n let promise = null;\n\n // Hack for iOS\n if (navigator.userAgent.match(/mobile/i)) {\n promise = this.iOSCaptureUserIntentHack();\n }\n\n promise = promise || Promise.resolve();\n promise.then(() => super.start(leafIndex, numLeafs));\n }\n\n /** @override */\n createSound(chunk) {\n return new FestivalTTSSound(this.getSoundUrl(chunk.text));\n }\n\n /**\n * @private\n * Get URL for audio that says this text\n * @param {String} dataString the thing to say\n * @return {String} url\n */\n getSoundUrl(dataString) {\n return 'https://' + this.opts.server + '/BookReader/BookReaderGetTTS.php?string='\n + encodeURIComponent(dataString)\n + '&format=.' + this.audioFormat;\n }\n\n /**\n * @private\n * Security restrictions require playback to be triggered\n * by a user click/touch. This intention gets lost in the async calls\n * on iOS, but, for some reason, if we start the audio here, it works.\n * See https://stackoverflow.com/questions/12206631/html5-audio-cant-play-through-javascript-unless-triggered-manually-once\n * @return {PromiseLike}\n */\n iOSCaptureUserIntentHack() {\n const sound = soundManager.createSound({ url: SILENCE_1MS[this.audioFormat] });\n return new Promise(res => sound.play({onfinish: res}))\n .then(() => sound.destruct());\n }\n}\n\n/** @extends AbstractTTSSound */\nclass FestivalTTSSound {\n /** @param {string} soundUrl **/\n constructor(soundUrl) {\n this.soundUrl = soundUrl;\n /** @type {SMSound} */\n this.sound = null;\n this.rate = 1;\n /** @type {function} calling this resolves the \"play\" promise */\n this._finishResolver = null\n }\n\n get loaded() {\n return this.sound && this.sound.loaded;\n }\n\n load(onload) {\n this.sound = soundManager.createSound({\n url: this.soundUrl,\n // API recommended, but only fires once play started on safari\n onload: () => {\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n onload();\n },\n onresume: () => {\n sleep(25).then(() => {\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n });\n }\n });\n return this.sound.load();\n }\n\n play() {\n return new Promise(res => {\n this._finishResolver = res;\n this.sound.play({ onfinish: res });\n })\n .then(() => this.sound.destruct());\n }\n\n /** @override */\n stop() {\n this.sound.stop();\n return Promise.resolve();\n }\n\n /** @override */\n pause() { this.sound.pause(); }\n /** @override */\n resume() { this.sound.resume(); }\n /** @override */\n setPlaybackRate(rate) {\n this.rate = rate;\n this.sound.setPlaybackRate(rate);\n }\n\n /** @override */\n finish() {\n this.sound.stop();\n this._finishResolver();\n }\n}\n\n/** Needed to capture the audio context for iOS hack. Generated using Audacity. */\nconst SILENCE_1MS = {\n mp3: 'data:audio/mp3;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAAeTEFNRTMuOTlyBJwAAAAAAAAAADUgJAaUQQABrgAAAnHIf8sZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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gAOEBCkAoLDA0DFcBATkEjIKDArHhHPSaQMAEITIDJGIWAwSE6qBomI6AFhcYMgHgAyNjbSLC+gywAVd3HUghCAEIYjFARSQgIMTbnjiDU+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABCwAAAAAAAAAFRIAAAIAAAAPBTD1AgEBAAo=',\n};\n","/* global BookReader */\n/**\n * Plugin for Text to Speech in BookReader\n */\nimport FestivalTTSEngine from './FestivalTTSEngine.js';\nimport WebTTSEngine from './WebTTSEngine.js';\nimport { toISO6391, approximateWordCount } from './utils.js';\nimport { en as tooltips } from './tooltip_dict.js';\n/** @typedef {import('./PageChunk.js')} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\")} AbstractTTSEngine */\n\n// Default options for TTS\njQuery.extend(BookReader.defaultOptions, {\n server: 'ia600609.us.archive.org',\n bookPath: '',\n enableTtsPlugin: true,\n});\n\n// Extend the constructor to add TTS properties\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n if (this.options.enableTtsPlugin) {\n this.ttsHilites = [];\n let TTSEngine = WebTTSEngine.isSupported() ? WebTTSEngine :\n FestivalTTSEngine.isSupported() ? FestivalTTSEngine :\n null;\n\n if (/_forceTTSEngine=(festival|web)/.test(location.toString())) {\n const engineName = location.toString().match(/_forceTTSEngine=(festival|web)/)[1];\n TTSEngine = { festival: FestivalTTSEngine, web: WebTTSEngine }[engineName];\n }\n\n if (TTSEngine) {\n /** @type {AbstractTTSEngine} */\n this.ttsEngine = new TTSEngine({\n server: options.server,\n bookPath: options.bookPath,\n bookLanguage: toISO6391(options.bookLanguage),\n onLoadingStart: this.showProgressPopup.bind(this, 'Loading audio...'),\n onLoadingComplete: this.removeProgressPopup.bind(this),\n onDone: this.ttsStop.bind(this),\n beforeChunkPlay: this.ttsBeforeChunkPlay.bind(this),\n afterChunkPlay: this.ttsSendChunkFinishedAnalyticsEvent.bind(this),\n });\n }\n }\n };\n})(BookReader.prototype.setup);\n\nBookReader.prototype.init = (function(super_) {\n return function() {\n if (this.options.enableTtsPlugin) {\n // Bind to events\n\n // TODO move this to BookReader.js or something\n this.bind(BookReader.eventNames.fragmentChange, () => {\n if (this.mode == this.constMode2up) {\n // clear highlights if they're no longer valid for this page\n const visibleIndices = [this.twoPage.currentIndexL, this.twoPage.currentIndexR];\n const visibleSelector = visibleIndices.map(i => `.BRReadAloudHilite.Leaf-${i}`).join(', ');\n $(this.ttsHilites).filter(visibleSelector).show();\n $(this.ttsHilites).not(visibleSelector).hide();\n }\n });\n\n this.bind(BookReader.eventNames.PostInit, () => {\n this.$('.BRicon.read').click(() => {\n this.ttsToggle();\n return false;\n });\n if (this.ttsEngine) {\n this.ttsEngine.init();\n if (/[?&]_autoReadAloud=show/.test(location.toString())) {\n this.ttsStart(false); // false flag is to initiate read aloud controls\n }\n }\n });\n\n // This is fired when the hash changes by one of the other plugins!\n // i.e. it will fire every time the page changes -_-\n // this.bind(BookReader.eventNames.stop, function(e, br) {\n // this.ttsStop();\n // }.bind(this));\n }\n super_.call(this);\n };\n})(BookReader.prototype.init);\n\n\n// Extend buildMobileDrawerElement\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li>\n <span>\n <span class=\"DrawerIconWrapper\"><img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_speaker_open.svg\" alt=\"info-speaker\"/></span>\n Read Aloud\n </span>\n <div>\n <span class=\"larger\">Press to toggle read aloud</span>\n <br/>\n <button class=\"BRicon read\"></button>\n </div>\n </li>`));\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n// Extend initNavbar\nBookReader.prototype.initNavbar = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n this.refs.$BRReadAloudToolbar = $(`\n <ul class=\"read-aloud\">\n <li>\n <select class=\"playback-speed\" name=\"playback-speed\" title=\"${tooltips.playbackSpeed}\">\n <option value=\"0.25\">0.25x</option>\n <option value=\"0.5\">0.5x</option>\n <option value=\"0.75\">0.75x</option>\n <option value=\"1.0\" selected>1.0x</option>\n <option value=\"1.25\">1.25x</option>\n <option value=\"1.5\">1.5x</option>\n <option value=\"1.75\">1.75x</option>\n <option value=\"2\">2x</option>\n </select>\n </li>\n <li>\n <button type=\"button\" name=\"review\" title=\"${tooltips.review}\">\n <div class=\"icon icon-review\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"play\" title=\"${tooltips.play}\">\n <div class=\"icon icon-play\"></div>\n <div class=\"icon icon-pause\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"advance\" title=\"${tooltips.advance}\">\n <div class=\"icon icon-advance\"></div>\n </button>\n </li>\n </ul>\n `);\n $el.find('.BRcontrols').prepend(this.refs.$BRReadAloudToolbar);\n this.ttsEngine.events.on('pause resume start', () => this.ttsUpdateState());\n this.refs.$BRReadAloudToolbar.find('[name=play]').click(this.ttsPlayPause.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=advance]').click(this.ttsJumpForward.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=review]').click(this.ttsJumpBackward.bind(this));\n const $rateSelector = this.refs.$BRReadAloudToolbar.find('select[name=\"playback-speed\"]');\n $rateSelector.change(ev => this.ttsEngine.setPlaybackRate(parseFloat($rateSelector.val())));\n $(`<li>\n <button class=\"BRicon read js-tooltip\" title=\"${tooltips.readAloud}\">\n <div class=\"icon icon-read-aloud\"></div>\n <span class=\"tooltip\">${tooltips.readAloud}</span>\n </button>\n </li>`).insertBefore($el.find('.BRcontrols .BRicon.zoom_out').closest('li'));\n }\n return $el;\n };\n})(BookReader.prototype.initNavbar);\n\n// ttsToggle()\n//______________________________________________________________________________\nBookReader.prototype.ttsToggle = function () {\n if (this.autoStop) this.autoStop();\n if (this.ttsEngine.playing) {\n this.ttsStop();\n } else {\n this.ttsStart();\n }\n};\n\n// ttsStart(\n//______________________________________________________________________________\nBookReader.prototype.ttsStart = function (startTTSEngine = true) {\n if (this.constModeThumb == this.mode)\n this.switchMode(this.constMode1up);\n\n this.refs.$BRReadAloudToolbar.addClass('visible');\n this.$('.BRicon.read').addClass('unread active');\n this.ttsSendAnalyticsEvent('Start');\n if (startTTSEngine)\n this.ttsEngine.start(this.currentIndex(), this.getNumLeafs());\n};\n\nBookReader.prototype.ttsJumpForward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpForward();\n};\n\nBookReader.prototype.ttsJumpBackward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpBackward();\n};\n\nBookReader.prototype.ttsUpdateState = function() {\n const isPlaying = !(this.ttsEngine.paused || !this.ttsEngine.playing);\n this.$('.read-aloud [name=play]').toggleClass('playing', isPlaying);\n};\n\nBookReader.prototype.ttsPlayPause = function() {\n if (!this.ttsEngine.playing) {\n this.ttsToggle();\n } else {\n this.ttsEngine.togglePlayPause();\n this.ttsUpdateState(this.ttsEngine.paused);\n }\n};\n\n// ttsStop()\n//______________________________________________________________________________\nBookReader.prototype.ttsStop = function () {\n this.refs.$BRReadAloudToolbar.removeClass('visible');\n this.$('.BRicon.read').removeClass('unread active');\n this.ttsSendAnalyticsEvent('Stop');\n this.ttsEngine.stop();\n this.ttsRemoveHilites();\n this.removeProgressPopup();\n};\n\n/**\n * @param {PageChunk} chunk\n * @return {PromiseLike<void>} returns once the flip is done\n */\nBookReader.prototype.ttsBeforeChunkPlay = function(chunk) {\n return this.ttsMaybeFlipToIndex(chunk.leafIndex)\n .then(() => {\n this.ttsHighlightChunk(chunk);\n this.ttsScrollToChunk(chunk);\n });\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsSendChunkFinishedAnalyticsEvent = function(chunk) {\n this.ttsSendAnalyticsEvent('ChunkFinished-Words', approximateWordCount(chunk.text));\n};\n\n/**\n * Flip the page if the provided leaf index is not visible\n * @param {Number} leafIndex\n * @return {PromiseLike<void>} resolves once the flip animation has completed\n */\nBookReader.prototype.ttsMaybeFlipToIndex = function (leafIndex) {\n const in2PageMode = this.constMode2up == this.mode;\n let resolve = null;\n const promise = new Promise(res => resolve = res);\n\n if (!in2PageMode) {\n this.jumpToIndex(leafIndex);\n resolve();\n } else {\n const leafVisible = leafIndex == this.twoPage.currentIndexR || leafIndex == this.twoPage.currentIndexL;\n if (leafVisible) {\n resolve();\n } else {\n this.animationFinishedCallback = resolve;\n const mustGoNext = leafIndex > Math.max(this.twoPage.currentIndexR, this.twoPage.currentIndexL);\n if (mustGoNext) this.next();\n else this.prev();\n promise.then(this.ttsMaybeFlipToIndex.bind(this, leafIndex));\n }\n }\n\n return promise;\n}\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsHighlightChunk = function(chunk) {\n this.ttsRemoveHilites();\n\n if (this.constMode2up == this.mode) {\n this.ttsHilite2UP(chunk);\n } else {\n this.ttsHilite1UP(chunk);\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsScrollToChunk = function(chunk) {\n if (this.constMode1up != this.mode) return;\n\n let leafTop = 0;\n let h;\n let i;\n for (i = 0; i < chunk.leafIndex; i++) {\n h = parseInt(this._getPageHeight(i) / this.reduce);\n leafTop += h + this.padding;\n }\n\n const chunkTop = chunk.lineRects[0][3]; //coords are in l,b,r,t order\n const chunkBot = chunk.lineRects[chunk.lineRects.length - 1][1];\n\n const topOfFirstChunk = leafTop + chunkTop / this.reduce;\n const botOfLastChunk = leafTop + chunkBot / this.reduce;\n\n if (window?.soundManager?.debugMode) console.log('leafTop = ' + leafTop + ' topOfFirstChunk = ' + topOfFirstChunk + ' botOfLastChunk = ' + botOfLastChunk);\n\n const containerTop = this.refs.$brContainer.prop('scrollTop');\n const containerBot = containerTop + this.refs.$brContainer.height();\n if (window?.soundManager?.debugMode) console.log('containerTop = ' + containerTop + ' containerBot = ' + containerBot);\n\n if ((topOfFirstChunk < containerTop) || (botOfLastChunk > containerBot)) {\n this.refs.$brContainer.stop(true).animate({scrollTop: topOfFirstChunk},'fast');\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsHilite1UP = function(chunk) {\n for (let i = 0; i < chunk.lineRects.length; i++) {\n //each rect is an array of l,b,r,t coords (djvu.xml ordering...)\n const l = chunk.lineRects[i][0];\n const b = chunk.lineRects[i][1];\n const r = chunk.lineRects[i][2];\n const t = chunk.lineRects[i][3];\n\n const div = document.createElement('div');\n this.ttsHilites.push(div);\n $(div).prop('className', 'BookReaderSearchHilite').appendTo(\n this.$('.pagediv' + chunk.leafIndex)\n );\n\n $(div).css({\n width: (r - l) / this.reduce + 'px',\n height: (b - t) / this.reduce + 'px',\n left: l / this.reduce + 'px',\n top: t / this.reduce + 'px'\n });\n }\n\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsHilite2UP = function (chunk) {\n for (let i = 0; i < chunk.lineRects.length; i++) {\n //each rect is an array of l,b,r,t coords (djvu.xml ordering...)\n const l = chunk.lineRects[i][0];\n const b = chunk.lineRects[i][1];\n const r = chunk.lineRects[i][2];\n const t = chunk.lineRects[i][3];\n\n const div = document.createElement('div');\n this.ttsHilites.push(div);\n $(div)\n .prop('className', 'BookReaderSearchHilite BRReadAloudHilite Leaf-' + chunk.leafIndex)\n .css('zIndex', 3)\n .appendTo(this.refs.$brTwoPageView);\n this.setHilightCss2UP(div, chunk.leafIndex, l, r, t, b);\n }\n};\n\n// ttsRemoveHilites()\n//______________________________________________________________________________\nBookReader.prototype.ttsRemoveHilites = function () {\n $(this.ttsHilites).remove();\n this.ttsHilites = [];\n};\n\n/**\n * @private\n * Send an analytics event with an optional value. Also attaches the book's language.\n * @param {string} action\n * @param {number} [value]\n */\nBookReader.prototype.ttsSendAnalyticsEvent = function(action, value) {\n if (this.archiveAnalyticsSendEvent) {\n const extraValues = {};\n const mediaLanguage = this.ttsEngine.opts.bookLanguage;\n if (mediaLanguage) extraValues.mediaLanguage = mediaLanguage;\n this.archiveAnalyticsSendEvent('BRReadAloud', action, value, extraValues);\n }\n};\n","/* global br */\nimport { isChrome, isFirefox } from '../../util/browserSniffing.js';\nimport { sleep, promisifyEvent, isAndroid } from './utils.js';\nimport AbstractTTSEngine from './AbstractTTSEngine.js';\n/** @typedef {import(\"./AbstractTTSEngine.js\").PageChunk} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Web Speech APIs\n **/\nexport default class WebTTSEngine extends AbstractTTSEngine {\n static isSupported() {\n return typeof(window.speechSynthesis) !== 'undefined' && !/samsungbrowser/i.test(navigator.userAgent);\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n\n // SAFARI doesn't have addEventListener on speechSynthesis\n if (speechSynthesis.addEventListener) {\n speechSynthesis.addEventListener('voiceschanged', () => this.events.trigger('voiceschanged'));\n }\n }\n\n /** @override */\n start(leafIndex, numLeafs) {\n // Need to run in this function to capture user intent to start playing audio\n if ('mediaSession' in navigator) {\n const audio = new Audio(SILENCE_6S_MP3);\n audio.loop = true;\n\n this.events.on('pause', () => audio.pause());\n this.events.on('resume', () => audio.play());\n // apparently this is what you need to do to make the media session notification go away\n // See https://developers.google.com/web/updates/2017/02/media-session#implementation_notes\n this.events.on('stop', () => audio.src = '');\n audio.play().then(() => {\n navigator.mediaSession.metadata = new MediaMetadata({\n title: br.bookTitle,\n artist: br.options.metadata.filter(m => m.label == 'Author').map(m => m.value)[0],\n // album: 'The Ultimate Collection (Remastered)',\n artwork: [\n { src: br.options.thumbnail, type: 'image/jpg' },\n ]\n });\n\n navigator.mediaSession.setActionHandler('play', () => {\n audio.play();\n this.resume();\n });\n navigator.mediaSession.setActionHandler('pause', () => {\n audio.pause();\n this.pause();\n });\n\n // navigator.mediaSession.setActionHandler('seekbackward', () => this.jumpBackward());\n // navigator.mediaSession.setActionHandler('seekforward', () => this.jumpForward());\n // Some devices only support the previoustrack/nexttrack (e.g. Win10), so show those.\n // Android devices do support the seek actions, but we don't want to show both buttons\n // and have them do the same thing.\n navigator.mediaSession.setActionHandler('previoustrack', () => this.jumpBackward());\n navigator.mediaSession.setActionHandler('nexttrack', () => this.jumpForward());\n });\n }\n\n return super.start(leafIndex, numLeafs);\n }\n\n /** @override */\n getVoices() { return speechSynthesis.getVoices(); }\n\n /** @override */\n createSound(chunk) {\n return new WebTTSSound(chunk.text);\n }\n}\n\n/** @extends AbstractTTSSound */\nexport class WebTTSSound {\n /** @param {string} text **/\n constructor(text) {\n this.text = text;\n this.loaded = false;\n this.paused = false;\n this.started = false;\n /** Whether the audio was stopped with a .stop() call */\n this.stopped = false;\n this.rate = 1;\n\n /** @type {SpeechSynthesisUtterance} */\n this.utterance = null;\n\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n\n this._lastEvents = {\n /** @type {SpeechSynthesisEvent} */\n pause: null,\n /** @type {SpeechSynthesisEvent} */\n boundary: null,\n /** @type {SpeechSynthesisEvent} */\n start: null,\n };\n\n /** Store where we are in the text. Only works on some browsers. */\n this._charIndex = 0;\n\n /** @type {Function} resolve function called when playback finished */\n this._finishResolver = null;\n\n /** @type {Promise} promise resolved by _finishResolver */\n this._finishPromise = null;\n }\n\n /** @override **/\n load(onload) {\n this.loaded = false;\n this.started = false;\n\n this.utterance = new SpeechSynthesisUtterance(this.text.slice(this._charIndex));\n this.utterance.voice = this.voice;\n // Need to also set lang (for some reason); won't set voice on Chrome@Android otherwise\n if (this.voice) this.utterance.lang = this.voice.lang;\n this.utterance.rate = this.rate;\n\n // Useful for debugging things\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n this.utterance.addEventListener('pause', () => console.log('pause'));\n this.utterance.addEventListener('resume', () => console.log('resume'));\n this.utterance.addEventListener('start', () => console.log('start'));\n this.utterance.addEventListener('end', () => console.log('end'));\n this.utterance.addEventListener('error', () => console.log('error'));\n this.utterance.addEventListener('boundary', () => console.log('boundary'));\n this.utterance.addEventListener('mark', () => console.log('mark'));\n this.utterance.addEventListener('finish', () => console.log('finish'));\n }\n\n // Keep track of the speech synthesis events that come in; they have useful info\n // about progress (like charIndex)\n this.utterance.addEventListener('start', ev => this._lastEvents.start = ev);\n this.utterance.addEventListener('boundary', ev => this._lastEvents.boundary = ev);\n this.utterance.addEventListener('pause', ev => this._lastEvents.pause = ev);\n\n // Update our state\n this.utterance.addEventListener('start', () => {\n this.started = true;\n this.stopped = false;\n this.paused = false;\n });\n this.utterance.addEventListener('pause', () => this.paused = true);\n this.utterance.addEventListener('resume', () => this.paused = false);\n this.utterance.addEventListener('end', ev => {\n if (!this.paused && !this.stopped) {\n // Trigger a new event, finish, which only fires when audio fully completed\n this.utterance.dispatchEvent(new CustomEvent('finish', ev));\n }\n });\n this.loaded = true;\n onload && onload();\n }\n\n /**\n * Run whenever properties have changed. Tries to restart in the same spot it\n * left off.\n * @return {Promise<void>}\n */\n reload() {\n // We'll restore the pause state, so copy it here\n const wasPaused = this.paused;\n // Use recent event to determine where we'll restart from\n // Browser support for this is mixed, but it degrades to restarting the chunk\n // and that's ok\n const recentEvent = this._lastEvents.boundary || this._lastEvents.pause;\n if (recentEvent) {\n this._charIndex = this.text.indexOf(recentEvent.target.text) + recentEvent.charIndex;\n }\n\n // We can't modify the utterance object, so we have to make a new one\n return this.stop()\n .then(() => {\n this.load();\n // Instead of playing and immediately pausing, we don't start playing. Note\n // this is a requirement because pause doesn't work consistently across\n // browsers.\n if (!wasPaused) this.play();\n });\n }\n\n play() {\n this._finishPromise = this._finishPromise || new Promise(res => this._finishResolver = res);\n this.utterance.addEventListener('finish', this._finishResolver);\n\n // clear the queue\n speechSynthesis.cancel();\n // reset pause state\n speechSynthesis.resume();\n // Speak\n speechSynthesis.speak(this.utterance);\n\n const isLocalVoice = this.utterance.voice && this.utterance.voice.localService;\n if (isChrome() && !isLocalVoice) this._chromePausingBugFix();\n\n return this._finishPromise;\n }\n\n /** @return {Promise} */\n stop() {\n // 'end' won't fire if already stopped\n let endPromise = Promise.resolve();\n if (!this.stopped) {\n endPromise = Promise.race([\n promisifyEvent(this.utterance, 'end'),\n // Safari triggers an error when you call cancel mid-sound\n promisifyEvent(this.utterance, 'error'),\n ]);\n }\n this.stopped = true;\n speechSynthesis.cancel();\n return endPromise;\n }\n\n finish() {\n this.stop().then(() => this.utterance.dispatchEvent(new Event('finish')));\n }\n\n /**\n * @override\n * Will fire a pause event unless already paused\n **/\n pause() {\n if (this.paused) return;\n\n const pausePromise = promisifyEvent(this.utterance, 'pause');\n speechSynthesis.pause();\n\n // There are a few awful browser cases:\n // 1. Pause works and fires\n // 2. Pause doesn't work and doesn't fire\n // 3. Pause works but doesn't fire\n const pauseMightNotWork = (isFirefox() && isAndroid());\n const pauseMightNotFire = isChrome() || pauseMightNotWork;\n\n if (pauseMightNotFire) {\n // wait for it just in case\n const timeoutPromise = sleep(100).then(() => 'timeout');\n Promise.race([pausePromise, timeoutPromise])\n .then(result => {\n // We got our pause event; nothing to do!\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('pause', this._lastEvents.start));\n // if pause might not work, then we'll stop entirely and restart later\n if (pauseMightNotWork) this.stop();\n });\n }\n }\n\n resume() {\n if (!this.started) {\n this.play();\n return;\n }\n\n if (!this.paused) return;\n\n // Browser cases:\n // 1. Resume works + fires\n // 2. Resume works + doesn't fire (Chrome Desktop)\n // 3. Resume doesn't work + doesn't fire (Chrome/FF Android)\n const resumeMightNotWork = (isChrome() && isAndroid()) || (isFirefox() && isAndroid());\n const resumeMightNotFire = isChrome() || resumeMightNotWork;\n\n // Try resume\n const resumePromise = promisifyEvent(this.utterance, 'resume');\n speechSynthesis.resume();\n\n if (resumeMightNotFire) {\n Promise.race([resumePromise, sleep(100).then(() => 'timeout')])\n .then(result => {\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('resume', {}));\n if (resumeMightNotWork) {\n const reloadPromise = this.reload();\n reloadPromise.then(() => this.play());\n }\n });\n }\n }\n\n setPlaybackRate(rate) {\n this.rate = rate;\n this.reload();\n }\n\n /**\n * @private\n * Chrome has a bug where it only plays 15 seconds of TTS and then\n * suddenly stops (see https://bugs.chromium.org/p/chromium/issues/detail?id=679437 )\n * We avoid this (as described here: https://bugs.chromium.org/p/chromium/issues/detail?id=679437#c15 )\n * by pausing after 14 seconds and ~instantly resuming.\n */\n _chromePausingBugFix() {\n const timeoutPromise = sleep(14000).then(() => 'timeout');\n const pausePromise = promisifyEvent(this.utterance, 'pause').then(() => 'paused');\n const endPromise = promisifyEvent(this.utterance, 'end').then(() => 'ended');\n return Promise.race([timeoutPromise, pausePromise, endPromise])\n .then(result => {\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n console.log(`CHROME-PAUSE-HACK: ${result}`);\n }\n switch (result) {\n case 'ended':\n // audio was stopped/finished; nothing to do\n break;\n case 'paused':\n // audio was paused; wait for resume\n // Chrome won't let you resume the audio if 14s have passed 🤷\n // We could do the same as before (but resume+pause instead of pause+resume),\n // but that means we'd _constantly_ be running in the background. So in that\n // case, let's just restart the chunk\n Promise.race([\n promisifyEvent(this.utterance, 'resume'),\n sleep(14000).then(() => 'timeout'),\n ])\n .then(result => {\n result == 'timeout' ? this.reload() : this._chromePausingBugFix();\n });\n break;\n case 'timeout':\n // We hit Chrome's secret cut off time. Pause/resume\n // to be able to keep TTS-ing\n speechSynthesis.pause();\n sleep(25)\n .then(() => {\n speechSynthesis.resume();\n this._chromePausingBugFix();\n });\n break;\n }\n });\n }\n}\n\n/**\n * According to https://developers.google.com/web/updates/2017/02/media-session#implementation_notes , it needs to be at least 5 seconds\n * long to allow usage of the media sessions api\n */\nconst SILENCE_6S_MP3 = 'data:audio/mp3;base64,/+MYxAAMEAISSAhElhIpJYzz1vz9mUdlHvJwTP/n3FJesPxB9/8mp0oGaz9+7+T//8oCDhJqOMqLh4o4uhUAUUDaf//3r+///+MYxAoKy2ImKAgEqbfr/t///27/+n3s32/////+b5qMsq7vnXCKh2By3ZcIqyrUYbbRH0fp+ljtf+n2Uo72PHX/03f0df///+MYxBkKUAYmQAhEAL+2l44oKFjZMwJAOJnhguMqokFAqBKl/5f1/+f+3/v////9GT//r+//v+//////b1VvucaRChqnMqsY/+MYxCoLo2IiSAgEpRrgIRVq//p////25nlpVFbQ9kuXtrpt+n//3ZUZNKHVTHdJk3Q6h961DAU8loFlsfTnTZYLLQ1xiIYC/+MYxDYLa2YYAACNFAKKv5swEnqSccBoi//xVP9R/q/370r02////7VpaiWWLrDaF//X8+Rf/6ys2irmURCrI/Lr7///+m1t/+MYxEMKqAI2SAhElh7vNPmHrKdmMPFMimBI5xYQEiIRxh1gk0pKvfo7nezMyH6P67uKW+z/7NusoS/4//STUtCUiwASccAQ/+MYxFMKs2IcIABFEFRhEOUCgACs//l3/6df///+qZf6V9X2t69f/p////+v97UOY7UyyIxZWPa1inCgyCDq//pXpSia2v23/+MYxGMK6AYqSABEAl70RfX2+nu6///v+rfdWCLKMhUBmZhIDqt23LQGBjyNGEjBCnI5JGjRWkU2a8b29z/+n6/9SnN7LUfo/+MYxHILg2IiQAgEUPpX9//96jShqxUCtNiIeCAcmxc3/tn18pTBRmaNzgUvIqropQvPf/Fy99+z9/8/bx43Xn95kr6QHFQp/+MYxH8LG2IcAACNMTZjQ1mIlAyLi1r7PBeeff3WH/rB/r/2/7a/+6/0/0b19F5lfb/p////9qWyzOGqY5WlRoqAGuCOp1Dm/+MYxI0KuAIuSAhElhZ6kDcciBDa1gec/T1uqXsq/0Pf+z/9tf0fbV8Jf//xrqJs4BnZgPhibbcDkhvrmd9q9s+3XL+2X+9e/+MYxJ0MK14UAABNLG/7/dfT6f/1R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+pfVpWM5jBgJysYxQpTGMYUcygIwYU6qqq/+MYxOsPE14aQAiNoYAwNmLCuoX4szULsxZmoXZiwr/FhX//gIWFSJmtiVCwr3f7P/ioqLCwsLC4qK1MQU1FMy45OS4zVVVV/+MYxOkN614mSAhE31VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOwz4hqAiHo1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOG1oOIAgEqFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxO4L6AVtkAhEAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';\n","export const en = {\n advance: 'Advance 10 seconds',\n play: 'Play',\n playbackSpeed: 'Playback speed',\n readAloud: 'Read this book aloud',\n review: 'Review 10 seconds',\n};\n\nexport const es = {\n advance: 'Avance 10 segundos',\n play: 'Jugar',\n playbackSpeed: 'Velocidad de reproducción',\n readAloud: 'Lee este libro en voz alta',\n review: 'Revisar 10 segundos',\n};\n","\n/**\n * Checks whether the current browser is a Chrome/Chromium browser\n * Code from https://stackoverflow.com/a/4565120/2317712\n * @param {string} [userAgent]\n * @param {string} [vendor]\n * @return {boolean}\n */\nexport function isChrome(userAgent = navigator.userAgent, vendor = navigator.vendor) {\n return /chrome/i.test(userAgent) && /google inc/i.test(vendor);\n}\n\n/**\n * Checks whether the current browser is firefox\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isFirefox(userAgent = navigator.userAgent) {\n return /firefox/i.test(userAgent);\n}\n\n/**\n * Checks whether the current browser is safari\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#Browser_Name\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isSafari(userAgent = navigator.userAgent) {\n return /safari/i.test(userAgent) && !/chrome|chromium/i.test(userAgent);\n}\n","'use strict';\nvar aFunction = require('../internals/a-function');\nvar isObject = require('../internals/is-object');\n\nvar slice = [].slice;\nvar factories = {};\n\nvar construct = function (C, argsLength, args) {\n if (!(argsLength in factories)) {\n for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only\n factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');\n } return factories[argsLength](C, args);\n};\n\n// `Function.prototype.bind` method implementation\n// https://tc39.es/ecma262/#sec-function.prototype.bind\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = slice.call(arguments, 1);\n var boundFunction = function bound(/* args... */) {\n var args = partArgs.concat(slice.call(arguments));\n return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args);\n };\n if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype;\n return boundFunction;\n};\n","var $ = require('../internals/export');\nvar assign = require('../internals/object-assign');\n\n// `Object.assign` method\n// https://tc39.es/ecma262/#sec-object.assign\n// eslint-disable-next-line es/no-object-assign -- required for testing\n$({ target: 'Object', stat: true, forced: Object.assign !== assign }, {\n assign: assign\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toObject = require('../internals/to-object');\nvar nativeGetPrototypeOf = require('../internals/object-get-prototype-of');\nvar CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetPrototypeOf(1); });\n\n// `Object.getPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.getprototypeof\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {\n getPrototypeOf: function getPrototypeOf(it) {\n return nativeGetPrototypeOf(toObject(it));\n }\n});\n\n","var $ = require('../internals/export');\nvar getBuiltIn = require('../internals/get-built-in');\nvar aFunction = require('../internals/a-function');\nvar anObject = require('../internals/an-object');\nvar isObject = require('../internals/is-object');\nvar create = require('../internals/object-create');\nvar bind = require('../internals/function-bind');\nvar fails = require('../internals/fails');\n\nvar nativeConstruct = getBuiltIn('Reflect', 'construct');\n\n// `Reflect.construct` method\n// https://tc39.es/ecma262/#sec-reflect.construct\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n nativeConstruct(function () { /* empty */ });\n});\nvar FORCED = NEW_TARGET_BUG || ARGS_BUG;\n\n$({ target: 'Reflect', stat: true, forced: FORCED, sham: FORCED }, {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","var $ = require('../internals/export');\nvar isObject = require('../internals/is-object');\nvar anObject = require('../internals/an-object');\nvar has = require('../internals/has');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar getPrototypeOf = require('../internals/object-get-prototype-of');\n\n// `Reflect.get` method\n// https://tc39.es/ecma262/#sec-reflect.get\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var descriptor, prototype;\n if (anObject(target) === receiver) return target[propertyKey];\n if (descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey)) return has(descriptor, 'value')\n ? descriptor.value\n : descriptor.get === undefined\n ? undefined\n : descriptor.get.call(receiver);\n if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);\n}\n\n$({ target: 'Reflect', stat: true }, {\n get: get\n});\n","'use strict';\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar toLength = require('../internals/to-length');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', 1, function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = regexp == undefined ? undefined : regexp[MATCH];\n return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (regexp) {\n var res = maybeCallNative(nativeMatch, regexp, this);\n if (res.done) return res.value;\n\n var rx = anObject(regexp);\n var S = String(this);\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = String(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\nvar $ = require('../internals/export');\nvar getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar toLength = require('../internals/to-length');\nvar notARegExp = require('../internals/not-a-regexp');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar correctIsRegExpLogic = require('../internals/correct-is-regexp-logic');\nvar IS_PURE = require('../internals/is-pure');\n\n// eslint-disable-next-line es/no-string-prototype-startswith -- safe\nvar $startsWith = ''.startsWith;\nvar min = Math.min;\n\nvar CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');\n// https://github.com/zloirock/core-js/pull/702\nvar MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {\n var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');\n return descriptor && !descriptor.writable;\n}();\n\n// `String.prototype.startsWith` method\n// https://tc39.es/ecma262/#sec-string.prototype.startswith\n$({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = String(requireObjectCoercible(this));\n notARegExp(searchString);\n var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _default = [['Serbian', 'српски језик', 'sr', 'srp', 'srp'], ['Romanian, Moldavian, Moldovan', 'Română', 'ro', 'ron', 'rum'], ['Sichuan Yi, Nuosu', 'ꆈꌠ꒿ Nuosuhxop', 'ii', 'iii', 'iii'], ['Tahitian', 'Reo Tahiti', 'ty', 'tah', 'tah'], ['Tagalog', 'Wikang Tagalog', 'tl', 'tgl', 'tgl'], ['Yiddish', 'ייִדיש', 'yi', 'yid', 'yid'], ['Akan', 'Akan', 'ak', 'aka', 'aka'], ['Malay', 'Bahasa Melayu, بهاس ملايو', 'ms', 'msa', 'may'], ['Arabic', 'العربية', 'ar', 'ara', 'ara'], ['Norwegian', 'Norsk', 'no', 'nor', 'nor'], ['Ojibwa', 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'oj', 'oji', 'oji'], ['Fulah', 'Fulfulde, Pulaar, Pular', 'ff', 'ful', 'ful'], ['Persian', 'فارسی', 'fa', 'fas', 'per'], ['Albanian', 'Shqip', 'sq', 'sqi', 'alb'], ['Aymara', 'aymar aru', 'ay', 'aym', 'aym'], ['Azerbaijani', 'azərbaycan dili', 'az', 'aze', 'aze'], ['Chinese', '中文 (Zhōngwén), 汉语, 漢語', 'zh', 'zho', 'chi'], ['Cree', 'ᓀᐦᐃᔭᐍᐏᐣ', 'cr', 'cre', 'cre'], ['Estonian', 'eesti, eesti keel', 'et', 'est', 'est'], ['Guaraní', 'Avañe\\'ẽ', 'gn', 'grn', 'grn'], ['Inupiaq', 'Iñupiaq, Iñupiatun', 'ik', 'ipk', 'ipk'], ['Inuktitut', 'ᐃᓄᒃᑎᑐᑦ', 'iu', 'iku', 'iku'], ['Kanuri', 'Kanuri', 'kr', 'kau', 'kau'], ['Komi', 'коми кыв', 'kv', 'kom', 'kom'], ['Kongo', 'Kikongo', 'kg', 'kon', 'kon'], ['Kurdish', 'Kurdî, کوردی', 'ku', 'kur', 'kur'], ['Latvian', 'latviešu valoda', 'lv', 'lav', 'lav'], ['Malagasy', 'fiteny malagasy', 'mg', 'mlg', 'mlg'], ['Mongolian', 'Монгол хэл', 'mn', 'mon', 'mon'], ['Oromo', 'Afaan Oromoo', 'om', 'orm', 'orm'], ['Pashto, Pushto', 'پښتو', 'ps', 'pus', 'pus'], ['Quechua', 'Runa Simi, Kichwa', 'qu', 'que', 'que'], ['Sardinian', 'sardu', 'sc', 'srd', 'srd'], ['Swahili', 'Kiswahili', 'sw', 'swa', 'swa'], ['Uzbek', 'Oʻzbek, Ўзбек, أۇزبېك', 'uz', 'uzb', 'uzb'], ['Zhuang, Chuang', 'Saɯ cueŋƅ, Saw cuengh', 'za', 'zha', 'zha'], ['Bislama', 'Bislama', 'bi', 'bis', 'bis'], ['Norwegian Bokmål', 'Norsk Bokmål', 'nb', 'nob', 'nob'], ['Norwegian Nynorsk', 'Norsk Nynorsk', 'nn', 'nno', 'nno'], ['Indonesian', 'Bahasa Indonesia', 'id', 'ind', 'ind'], ['Twi', 'Twi', 'tw', 'twi', 'twi'], ['Esperanto', 'Esperanto', 'eo', 'epo', 'epo'], ['Interlingua', 'Interlingua', 'ia', 'ina', 'ina'], ['Interlingue', 'Originally called Occidental; then Interlingue after WWII', 'ie', 'ile', 'ile'], ['Ido', 'Ido', 'io', 'ido', 'ido'], ['Volapük', 'Volapük', 'vo', 'vol', 'vol'], ['Bihari languages', 'भोजपुरी', 'bh', 'bih', 'bih'], ['Hebrew (modern)', 'עברית', 'he', 'heb', 'heb'], ['Sanskrit', 'संस्कृतम्', 'sa', 'san', 'san'], ['Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian', 'ѩзыкъ словѣньскъ', 'cu', 'chu', 'chu'], ['Pali', 'पाऴि', 'pi', 'pli', 'pli'], ['Avestan', 'avesta', 'ae', 'ave', 'ave'], ['Latin', 'latine, lingua latina', 'la', 'lat', 'lat'], ['Armenian', 'Հայերեն', 'hy', 'hye', 'arm'], ['Swati', 'SiSwati', 'ss', 'ssw', 'ssw'], ['Tibetan', 'བོད་ཡིག', 'bo', 'bod', 'tib'], ['South Ndebele', 'isiNdebele', 'nr', 'nbl', 'nbl'], ['Slovene', 'Slovenski Jezik, Slovenščina', 'sl', 'slv', 'slv'], ['Oriya', 'ଓଡ଼ିଆ', 'or', 'ori', 'ori'], ['North Ndebele', 'isiNdebele', 'nd', 'nde', 'nde'], ['Nauru', 'Dorerin Naoero', 'na', 'nau', 'nau'], ['Maori', 'te reo Māori', 'mi', 'mri', 'mao'], ['Marathi', 'मराठी', 'mr', 'mar', 'mar'], ['Luba-Katanga', 'Kiluba', 'lu', 'lub', 'lub'], ['Rundi', 'Ikirundi', 'rn', 'run', 'run'], ['Central Khmer', 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ', 'km', 'khm', 'khm'], ['Western Frisian', 'Frysk', 'fy', 'fry', 'fry'], ['Bengali', 'বাংলা', 'bn', 'ben', 'ben'], ['Avaric', 'авар мацӀ, магӀарул мацӀ', 'av', 'ava', 'ava'], ['Abkhazian', 'аҧсуа бызшәа, аҧсшәа', 'ab', 'abk', 'abk'], ['Afar', 'Afaraf', 'aa', 'aar', 'aar'], ['Afrikaans', 'Afrikaans', 'af', 'afr', 'afr'], ['Amharic', 'አማርኛ', 'am', 'amh', 'amh'], ['Aragonese', 'aragonés', 'an', 'arg', 'arg'], ['Assamese', 'অসমীয়া', 'as', 'asm', 'asm'], ['Bambara', 'bamanankan', 'bm', 'bam', 'bam'], ['Bashkir', 'башҡорт теле', 'ba', 'bak', 'bak'], ['Basque', 'euskara, euskera', 'eu', 'eus', 'baq'], ['Belarusian', 'беларуская мова', 'be', 'bel', 'bel'], ['Bosnian', 'bosanski jezik', 'bs', 'bos', 'bos'], ['Breton', 'brezhoneg', 'br', 'bre', 'bre'], ['Bulgarian', 'български език', 'bg', 'bul', 'bul'], ['Burmese', 'ဗမာစာ', 'my', 'mya', 'bur'], ['Catalan, Valencian', 'català, valencià', 'ca', 'cat', 'cat'], ['Chamorro', 'Chamoru', 'ch', 'cha', 'cha'], ['Chechen', 'нохчийн мотт', 'ce', 'che', 'che'], ['Chichewa, Chewa, Nyanja', 'chiCheŵa, chinyanja', 'ny', 'nya', 'nya'], ['Chuvash', 'чӑваш чӗлхи', 'cv', 'chv', 'chv'], ['Cornish', 'Kernewek', 'kw', 'cor', 'cor'], ['Corsican', 'corsu, lingua corsa', 'co', 'cos', 'cos'], ['Croatian', 'hrvatski jezik', 'hr', 'hrv', 'hrv'], ['Czech', 'čeština, český jazyk', 'cs', 'ces', 'cze'], ['Danish', 'dansk', 'da', 'dan', 'dan'], ['Divehi, Dhivehi, Maldivian', 'ދިވެހި', 'dv', 'div', 'div'], ['Dutch, Flemish', 'Nederlands, Vlaams', 'nl', 'nld', 'dut'], ['Dzongkha', 'རྫོང་ཁ', 'dz', 'dzo', 'dzo'], ['English', 'English', 'en', 'eng', 'eng'], ['Ewe', 'Eʋegbe', 'ee', 'ewe', 'ewe'], ['Faroese', 'føroyskt', 'fo', 'fao', 'fao'], ['Fijian', 'vosa Vakaviti', 'fj', 'fij', 'fij'], ['Finnish', 'suomi, suomen kieli', 'fi', 'fin', 'fin'], ['French', 'français, langue française', 'fr', 'fra', 'fre'], ['Galician', 'Galego', 'gl', 'glg', 'glg'], ['Georgian', 'ქართული', 'ka', 'kat', 'geo'], ['German', 'Deutsch', 'de', 'deu', 'ger'], ['Greek (modern)', 'ελληνικά', 'el', 'ell', 'gre'], ['Gujarati', 'ગુજરાતી', 'gu', 'guj', 'guj'], ['Haitian, Haitian Creole', 'Kreyòl ayisyen', 'ht', 'hat', 'hat'], ['Hausa', '(Hausa) هَوُسَ', 'ha', 'hau', 'hau'], ['Herero', 'Otjiherero', 'hz', 'her', 'her'], ['Hindi', 'हिन्दी, हिंदी', 'hi', 'hin', 'hin'], ['Hiri Motu', 'Hiri Motu', 'ho', 'hmo', 'hmo'], ['Hungarian', 'magyar', 'hu', 'hun', 'hun'], ['Irish', 'Gaeilge', 'ga', 'gle', 'gle'], ['Igbo', 'Asụsụ Igbo', 'ig', 'ibo', 'ibo'], ['Icelandic', 'Íslenska', 'is', 'isl', 'ice'], ['Italian', 'Italiano', 'it', 'ita', 'ita'], ['Japanese', '日本語 (にほんご)', 'ja', 'jpn', 'jpn'], ['Javanese', 'ꦧꦱꦗꦮ, Basa Jawa', 'jv', 'jav', 'jav'], ['Kalaallisut, Greenlandic', 'kalaallisut, kalaallit oqaasii', 'kl', 'kal', 'kal'], ['Kannada', 'ಕನ್ನಡ', 'kn', 'kan', 'kan'], ['Kashmiri', 'कश्मीरी, كشميري', 'ks', 'kas', 'kas'], ['Kazakh', 'қазақ тілі', 'kk', 'kaz', 'kaz'], ['Kikuyu, Gikuyu', 'Gĩkũyũ', 'ki', 'kik', 'kik'], ['Kinyarwanda', 'Ikinyarwanda', 'rw', 'kin', 'kin'], ['Kirghiz, Kyrgyz', 'Кыргызча, Кыргыз тили', 'ky', 'kir', 'kir'], ['Korean', '한국어', 'ko', 'kor', 'kor'], ['Kuanyama, Kwanyama', 'Kuanyama', 'kj', 'kua', 'kua'], ['Luxembourgish, Letzeburgesch', 'Lëtzebuergesch', 'lb', 'ltz', 'ltz'], ['Ganda', 'Luganda', 'lg', 'lug', 'lug'], ['Limburgan, Limburger, Limburgish', 'Limburgs', 'li', 'lim', 'lim'], ['Lingala', 'Lingála', 'ln', 'lin', 'lin'], ['Lao', 'ພາສາລາວ', 'lo', 'lao', 'lao'], ['Lithuanian', 'lietuvių kalba', 'lt', 'lit', 'lit'], ['Manx', 'Gaelg, Gailck', 'gv', 'glv', 'glv'], ['Macedonian', 'македонски јазик', 'mk', 'mkd', 'mac'], ['Malayalam', 'മലയാളം', 'ml', 'mal', 'mal'], ['Maltese', 'Malti', 'mt', 'mlt', 'mlt'], ['Marshallese', 'Kajin M̧ajeļ', 'mh', 'mah', 'mah'], ['Navajo, Navaho', 'Diné bizaad', 'nv', 'nav', 'nav'], ['Nepali', 'नेपाली', 'ne', 'nep', 'nep'], ['Ndonga', 'Owambo', 'ng', 'ndo', 'ndo'], ['Occitan', 'occitan, lenga d\\'òc', 'oc', 'oci', 'oci'], ['Ossetian, Ossetic', 'ирон æвзаг', 'os', 'oss', 'oss'], ['Panjabi, Punjabi', 'ਪੰਜਾਬੀ', 'pa', 'pan', 'pan'], ['Polish', 'język polski, polszczyzna', 'pl', 'pol', 'pol'], ['Portuguese', 'Português', 'pt', 'por', 'por'], ['Romansh', 'Rumantsch Grischun', 'rm', 'roh', 'roh'], ['Russian', 'русский', 'ru', 'rus', 'rus'], ['Sindhi', 'सिन्धी, سنڌي، سندھی', 'sd', 'snd', 'snd'], ['Northern Sami', 'Davvisámegiella', 'se', 'sme', 'sme'], ['Samoan', 'gagana fa\\'a Samoa', 'sm', 'smo', 'smo'], ['Sango', 'yângâ tî sängö', 'sg', 'sag', 'sag'], ['Gaelic, Scottish Gaelic', 'Gàidhlig', 'gd', 'gla', 'gla'], ['Shona', 'chiShona', 'sn', 'sna', 'sna'], ['Sinhala, Sinhalese', 'සිංහල', 'si', 'sin', 'sin'], ['Slovak', 'Slovenčina, Slovenský Jazyk', 'sk', 'slk', 'slo'], ['Somali', 'Soomaaliga, af Soomaali', 'so', 'som', 'som'], ['Southern Sotho', 'Sesotho', 'st', 'sot', 'sot'], ['Spanish, Castilian', 'Español', 'es', 'spa', 'spa'], ['Sundanese', 'Basa Sunda', 'su', 'sun', 'sun'], ['Swedish', 'Svenska', 'sv', 'swe', 'swe'], ['Tamil', 'தமிழ்', 'ta', 'tam', 'tam'], ['Telugu', 'తెలుగు', 'te', 'tel', 'tel'], ['Tajik', 'тоҷикӣ, toçikī, تاجیکی', 'tg', 'tgk', 'tgk'], ['Thai', 'ไทย', 'th', 'tha', 'tha'], ['Tigrinya', 'ትግርኛ', 'ti', 'tir', 'tir'], ['Turkmen', 'Türkmen, Түркмен', 'tk', 'tuk', 'tuk'], ['Tswana', 'Setswana', 'tn', 'tsn', 'tsn'], ['Tongan (Tonga Islands)', 'Faka Tonga', 'to', 'ton', 'ton'], ['Turkish', 'Türkçe', 'tr', 'tur', 'tur'], ['Tsonga', 'Xitsonga', 'ts', 'tso', 'tso'], ['Tatar', 'татар теле, tatar tele', 'tt', 'tat', 'tat'], ['Uighur, Uyghur', 'ئۇيغۇرچە, Uyghurche', 'ug', 'uig', 'uig'], ['Ukrainian', 'Українська', 'uk', 'ukr', 'ukr'], ['Urdu', 'اردو', 'ur', 'urd', 'urd'], ['Venda', 'Tshivenḓa', 've', 'ven', 'ven'], ['Vietnamese', 'Tiếng Việt', 'vi', 'vie', 'vie'], ['Walloon', 'Walon', 'wa', 'wln', 'wln'], ['Welsh', 'Cymraeg', 'cy', 'cym', 'wel'], ['Wolof', 'Wollof', 'wo', 'wol', 'wol'], ['Xhosa', 'isiXhosa', 'xh', 'xho', 'xho'], ['Yoruba', 'Yorùbá', 'yo', 'yor', 'yor'], ['Zulu', 'isiZulu', 'zu', 'zul', 'zul']];\nexports[\"default\"] = _default;","/*!\n * jQuery Browser Plugin 0.1.0\n * https://github.com/gabceb/jquery-browser-plugin\n *\n * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors\n * http://jquery.org/license\n *\n * Modifications Copyright 2015 Gabriel Cebrian\n * https://github.com/gabceb\n *\n * Released under the MIT license\n *\n * Date: 05-07-2015\n */\n/*global window: false */\n\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], function ($) {\n return factory($);\n });\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\n // Node-like environment\n module.exports = factory(require('jquery'));\n } else {\n // Browser globals\n factory(window.jQuery);\n }\n}(function(jQuery) {\n \"use strict\";\n\n function uaMatch( ua ) {\n // If an UA is not provided, default to the current browser UA.\n if ( ua === undefined ) {\n ua = window.navigator.userAgent;\n }\n ua = ua.toLowerCase();\n\n var match = /(edge)\\/([\\w.]+)/.exec( ua ) ||\n /(opr)[\\/]([\\w.]+)/.exec( ua ) ||\n /(chrome)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(iemobile)[\\/]([\\w.]+)/.exec( ua ) ||\n /(version)(applewebkit)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+).*(version)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(msie) ([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"trident\") >= 0 && /(rv)(?::| )([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec( ua ) ||\n [];\n\n var platform_match = /(ipad)/.exec( ua ) ||\n /(ipod)/.exec( ua ) ||\n /(windows phone)/.exec( ua ) ||\n /(iphone)/.exec( ua ) ||\n /(kindle)/.exec( ua ) ||\n /(silk)/.exec( ua ) ||\n /(android)/.exec( ua ) ||\n /(win)/.exec( ua ) ||\n /(mac)/.exec( ua ) ||\n /(linux)/.exec( ua ) ||\n /(cros)/.exec( ua ) ||\n /(playbook)/.exec( ua ) ||\n /(bb)/.exec( ua ) ||\n /(blackberry)/.exec( ua ) ||\n [];\n\n var browser = {},\n matched = {\n browser: match[ 5 ] || match[ 3 ] || match[ 1 ] || \"\",\n version: match[ 2 ] || match[ 4 ] || \"0\",\n versionNumber: match[ 4 ] || match[ 2 ] || \"0\",\n platform: platform_match[ 0 ] || \"\"\n };\n\n if ( matched.browser ) {\n browser[ matched.browser ] = true;\n browser.version = matched.version;\n browser.versionNumber = parseInt(matched.versionNumber, 10);\n }\n\n if ( matched.platform ) {\n browser[ matched.platform ] = true;\n }\n\n // These are all considered mobile platforms, meaning they run a mobile browser\n if ( browser.android || browser.bb || browser.blackberry || browser.ipad || browser.iphone ||\n browser.ipod || browser.kindle || browser.playbook || browser.silk || browser[ \"windows phone\" ]) {\n browser.mobile = true;\n }\n\n // These are all considered desktop platforms, meaning they run a desktop browser\n if ( browser.cros || browser.mac || browser.linux || browser.win ) {\n browser.desktop = true;\n }\n\n // Chrome, Opera 15+ and Safari are webkit based browsers\n if ( browser.chrome || browser.opr || browser.safari ) {\n browser.webkit = true;\n }\n\n // IE11 has a new token so we will assign it msie to avoid breaking changes\n if ( browser.rv || browser.iemobile) {\n var ie = \"msie\";\n\n matched.browser = ie;\n browser[ie] = true;\n }\n\n // Edge is officially known as Microsoft Edge, so rewrite the key to match\n if ( browser.edge ) {\n delete browser.edge;\n var msedge = \"msedge\";\n\n matched.browser = msedge;\n browser[msedge] = true;\n }\n\n // Blackberry browsers are marked as Safari on BlackBerry\n if ( browser.safari && browser.blackberry ) {\n var blackberry = \"blackberry\";\n\n matched.browser = blackberry;\n browser[blackberry] = true;\n }\n\n // Playbook browsers are marked as Safari on Playbook\n if ( browser.safari && browser.playbook ) {\n var playbook = \"playbook\";\n\n matched.browser = playbook;\n browser[playbook] = true;\n }\n\n // BB10 is a newer OS version of BlackBerry\n if ( browser.bb ) {\n var bb = \"blackberry\";\n\n matched.browser = bb;\n browser[bb] = true;\n }\n\n // Opera 15+ are identified as opr\n if ( browser.opr ) {\n var opera = \"opera\";\n\n matched.browser = opera;\n browser[opera] = true;\n }\n\n // Stock Android browsers are marked as Safari on Android.\n if ( browser.safari && browser.android ) {\n var android = \"android\";\n\n matched.browser = android;\n browser[android] = true;\n }\n\n // Kindle browsers are marked as Safari on Kindle\n if ( browser.safari && browser.kindle ) {\n var kindle = \"kindle\";\n\n matched.browser = kindle;\n browser[kindle] = true;\n }\n\n // Kindle Silk browsers are marked as Safari on Kindle\n if ( browser.safari && browser.silk ) {\n var silk = \"silk\";\n\n matched.browser = silk;\n browser[silk] = true;\n }\n\n // Assign the name and platform variable\n browser.name = matched.browser;\n browser.platform = matched.platform;\n return browser;\n }\n\n // Run the matching process, also assign the function to the returned object\n // for manual, jQuery-free use if desired\n window.jQBrowser = uaMatch( window.navigator.userAgent );\n window.jQBrowser.uaMatch = uaMatch;\n\n // Only assign to jQuery.browser if jQuery is loaded\n if ( jQuery ) {\n jQuery.browser = window.jQBrowser;\n }\n\n return window.jQBrowser;\n}));\n","/** @license\r\n *\r\n * SoundManager 2: JavaScript Sound for the Web\r\n * ----------------------------------------------\r\n * http://schillmania.com/projects/soundmanager2/\r\n *\r\n * Copyright (c) 2007, Scott Schiller. All rights reserved.\r\n * Code provided under the BSD License:\r\n * http://schillmania.com/projects/soundmanager2/license.txt\r\n *\r\n * V2.97a.20170601\r\n */\r\n\r\n/**\r\n * About this file\r\n * -------------------------------------------------------------------------------------\r\n * This is the fully-commented source version of the SoundManager 2 API,\r\n * recommended for use during development and testing.\r\n *\r\n * See soundmanager2-nodebug-jsmin.js for an optimized build (~11KB with gzip.)\r\n * http://schillmania.com/projects/soundmanager2/doc/getstarted/#basic-inclusion\r\n * Alternately, serve this file with gzip for 75% compression savings (~30KB over HTTP.)\r\n *\r\n * You may notice <d> and </d> comments in this source; these are delimiters for\r\n * debug blocks which are removed in the -nodebug builds, further optimizing code size.\r\n *\r\n * Also, as you may note: Whoa, reliable cross-platform/device audio support is hard! ;)\r\n */\r\n\r\n(function SM2(window, _undefined) {\r\n\r\n/* global Audio, document, window, navigator, define, module, SM2_DEFER, opera, setTimeout, setInterval, clearTimeout, sm2Debugger */\r\n\r\n'use strict';\r\n\r\nif (!window || !window.document) {\r\n\r\n // Don't cross the [environment] streams. SM2 expects to be running in a browser, not under node.js etc.\r\n // Additionally, if a browser somehow manages to fail this test, as Egon said: \"It would be bad.\"\r\n\r\n throw new Error('SoundManager requires a browser with window and document objects.');\r\n\r\n}\r\n\r\nvar soundManager = null;\r\n\r\n/**\r\n * The SoundManager constructor.\r\n *\r\n * @constructor\r\n * @param {string} smURL Optional: Path to SWF files\r\n * @param {string} smID Optional: The ID to use for the SWF container element\r\n * @this {SoundManager}\r\n * @return {SoundManager} The new SoundManager instance\r\n */\r\n\r\nfunction SoundManager(smURL, smID) {\r\n\r\n /**\r\n * soundManager configuration options list\r\n * defines top-level configuration properties to be applied to the soundManager instance (eg. soundManager.flashVersion)\r\n * to set these properties, use the setup() method - eg., soundManager.setup({url: '/swf/', flashVersion: 9})\r\n */\r\n\r\n this.setupOptions = {\r\n\r\n url: (smURL || null), // path (directory) where SoundManager 2 SWFs exist, eg., /path/to/swfs/\r\n flashVersion: 8, // flash build to use (8 or 9.) Some API features require 9.\r\n debugMode: true, // enable debugging output (console.log() with HTML fallback)\r\n debugFlash: false, // enable debugging output inside SWF, troubleshoot Flash/browser issues\r\n useConsole: true, // use console.log() if available (otherwise, writes to #soundmanager-debug element)\r\n consoleOnly: true, // if console is being used, do not create/write to #soundmanager-debug\r\n waitForWindowLoad: false, // force SM2 to wait for window.onload() before trying to call soundManager.onload()\r\n bgColor: '#ffffff', // SWF background color. N/A when wmode = 'transparent'\r\n useHighPerformance: false, // position:fixed flash movie can help increase js/flash speed, minimize lag\r\n flashPollingInterval: null, // msec affecting whileplaying/loading callback frequency. If null, default of 50 msec is used.\r\n html5PollingInterval: null, // msec affecting whileplaying() for HTML5 audio, excluding mobile devices. If null, native HTML5 update events are used.\r\n flashLoadTimeout: 1000, // msec to wait for flash movie to load before failing (0 = infinity)\r\n wmode: null, // flash rendering mode - null, 'transparent', or 'opaque' (last two allow z-index to work)\r\n allowScriptAccess: 'always', // for scripting the SWF (object/embed property), 'always' or 'sameDomain'\r\n useFlashBlock: false, // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable.\r\n useHTML5Audio: true, // use HTML5 Audio() where API is supported (most Safari, Chrome versions), Firefox (MP3/MP4 support varies.) Ideally, transparent vs. Flash API where possible.\r\n forceUseGlobalHTML5Audio: false, // if true, a single Audio() object is used for all sounds - and only one can play at a time.\r\n ignoreMobileRestrictions: false, // if true, SM2 will not apply global HTML5 audio rules to mobile UAs. iOS > 7 and WebViews may allow multiple Audio() instances.\r\n html5Test: /^(probably|maybe)$/i, // HTML5 Audio() format support test. Use /^probably$/i; if you want to be more conservative.\r\n preferFlash: false, // overrides useHTML5audio, will use Flash for MP3/MP4/AAC if present. Potential option if HTML5 playback with these formats is quirky.\r\n noSWFCache: false, // if true, appends ?ts={date} to break aggressive SWF caching.\r\n idPrefix: 'sound' // if an id is not provided to createSound(), this prefix is used for generated IDs - 'sound0', 'sound1' etc.\r\n\r\n };\r\n\r\n this.defaultOptions = {\r\n\r\n /**\r\n * the default configuration for sound objects made with createSound() and related methods\r\n * eg., volume, auto-load behaviour and so forth\r\n */\r\n\r\n autoLoad: false, // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can)\r\n autoPlay: false, // enable playing of file as soon as possible (much faster if \"stream\" is true)\r\n from: null, // position to start playback within a sound (msec), default = beginning\r\n loops: 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0)\r\n onid3: null, // callback function for \"ID3 data is added/available\"\r\n onerror: null, // callback function for \"load failed\" (or, playback/network/decode error under HTML5.)\r\n onload: null, // callback function for \"load finished\"\r\n whileloading: null, // callback function for \"download progress update\" (X of Y bytes received)\r\n onplay: null, // callback for \"play\" start\r\n onpause: null, // callback for \"pause\"\r\n onresume: null, // callback for \"resume\" (pause toggle)\r\n whileplaying: null, // callback during play (position update)\r\n onposition: null, // object containing times and function callbacks for positions of interest\r\n onstop: null, // callback for \"user stop\"\r\n onfinish: null, // callback function for \"sound finished playing\"\r\n multiShot: true, // let sounds \"restart\" or layer on top of each other when played multiple times, rather than one-shot/one at a time\r\n multiShotEvents: false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled\r\n position: null, // offset (milliseconds) to seek to within loaded sound data.\r\n pan: 0, // \"pan\" settings, left-to-right, -100 to 100\r\n playbackRate: 1, // rate at which to play the sound (HTML5-only)\r\n stream: true, // allows playing before entire file has loaded (recommended)\r\n to: null, // position to end playback within a sound (msec), default = end\r\n type: null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3\r\n usePolicyFile: false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access)\r\n volume: 100 // self-explanatory. 0-100, the latter being the max.\r\n\r\n };\r\n\r\n this.flash9Options = {\r\n\r\n /**\r\n * flash 9-only options,\r\n * merged into defaultOptions if flash 9 is being used\r\n */\r\n\r\n onfailure: null, // callback function for when playing fails (Flash 9, MovieStar + RTMP-only)\r\n isMovieStar: null, // \"MovieStar\" MPEG4 audio mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL\r\n usePeakData: false, // enable left/right channel peak (level) data\r\n useWaveformData: false, // enable sound spectrum (raw waveform data) - NOTE: May increase CPU load.\r\n useEQData: false, // enable sound EQ (frequency spectrum data) - NOTE: May increase CPU load.\r\n onbufferchange: null, // callback for \"isBuffering\" property change\r\n ondataerror: null // callback for waveform/eq data access error (flash playing audio in other tabs/domains)\r\n\r\n };\r\n\r\n this.movieStarOptions = {\r\n\r\n /**\r\n * flash 9.0r115+ MPEG4 audio options,\r\n * merged into defaultOptions if flash 9+movieStar mode is enabled\r\n */\r\n\r\n bufferTime: 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.)\r\n serverURL: null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants\r\n onconnect: null, // rtmp: callback for connection to flash media server\r\n duration: null // rtmp: song duration (msec)\r\n\r\n };\r\n\r\n this.audioFormats = {\r\n\r\n /**\r\n * determines HTML5 support + flash requirements.\r\n * if no support (via flash and/or HTML5) for a \"required\" format, SM2 will fail to start.\r\n * flash fallback is used for MP3 or MP4 if HTML5 can't play it (or if preferFlash = true)\r\n */\r\n\r\n mp3: {\r\n type: ['audio/mpeg; codecs=\"mp3\"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],\r\n required: true\r\n },\r\n\r\n mp4: {\r\n related: ['aac', 'm4a', 'm4b'], // additional formats under the MP4 container\r\n type: ['audio/mp4; codecs=\"mp4a.40.2\"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],\r\n required: false\r\n },\r\n\r\n ogg: {\r\n type: ['audio/ogg; codecs=vorbis'],\r\n required: false\r\n },\r\n\r\n opus: {\r\n type: ['audio/ogg; codecs=opus', 'audio/opus'],\r\n required: false\r\n },\r\n\r\n wav: {\r\n type: ['audio/wav; codecs=\"1\"', 'audio/wav', 'audio/wave', 'audio/x-wav'],\r\n required: false\r\n },\r\n\r\n flac: {\r\n type: ['audio/flac'],\r\n required: false\r\n }\r\n\r\n };\r\n\r\n // HTML attributes (id + class names) for the SWF container\r\n\r\n this.movieID = 'sm2-container';\r\n this.id = (smID || 'sm2movie');\r\n\r\n this.debugID = 'soundmanager-debug';\r\n this.debugURLParam = /([#?&])debug=1/i;\r\n\r\n // dynamic attributes\r\n\r\n this.versionNumber = 'V2.97a.20170601';\r\n this.version = null;\r\n this.movieURL = null;\r\n this.altURL = null;\r\n this.swfLoaded = false;\r\n this.enabled = false;\r\n this.oMC = null;\r\n this.sounds = {};\r\n this.soundIDs = [];\r\n this.muted = false;\r\n this.didFlashBlock = false;\r\n this.filePattern = null;\r\n\r\n this.filePatterns = {\r\n flash8: /\\.mp3(\\?.*)?$/i,\r\n flash9: /\\.mp3(\\?.*)?$/i\r\n };\r\n\r\n // support indicators, set at init\r\n\r\n this.features = {\r\n buffering: false,\r\n peakData: false,\r\n waveformData: false,\r\n eqData: false,\r\n movieStar: false\r\n };\r\n\r\n // flash sandbox info, used primarily in troubleshooting\r\n\r\n this.sandbox = {\r\n // <d>\r\n type: null,\r\n types: {\r\n remote: 'remote (domain-based) rules',\r\n localWithFile: 'local with file access (no internet access)',\r\n localWithNetwork: 'local with network (internet access only, no local access)',\r\n localTrusted: 'local, trusted (local+internet access)'\r\n },\r\n description: null,\r\n noRemote: null,\r\n noLocal: null\r\n // </d>\r\n };\r\n\r\n /**\r\n * format support (html5/flash)\r\n * stores canPlayType() results based on audioFormats.\r\n * eg. { mp3: boolean, mp4: boolean }\r\n * treat as read-only.\r\n */\r\n\r\n this.html5 = {\r\n usingFlash: null // set if/when flash fallback is needed\r\n };\r\n\r\n // file type support hash\r\n this.flash = {};\r\n\r\n // determined at init time\r\n this.html5Only = false;\r\n\r\n // used for special cases (eg. iPad/iPhone/palm OS?)\r\n this.ignoreFlash = false;\r\n\r\n /**\r\n * a few private internals (OK, a lot. :D)\r\n */\r\n\r\n var SMSound,\r\n sm2 = this, globalHTML5Audio = null, flash = null, sm = 'soundManager', smc = sm + ': ', h5 = 'HTML5::', id, ua = navigator.userAgent, wl = window.location.href.toString(), doc = document, doNothing, setProperties, init, fV, on_queue = [], debugOpen = true, debugTS, didAppend = false, appendSuccess = false, didInit = false, disabled = false, windowLoaded = false, _wDS, wdCount = 0, initComplete, mixin, assign, extraOptions, addOnEvent, processOnEvents, initUserOnload, delayWaitForEI, waitForEI, rebootIntoHTML5, setVersionInfo, handleFocus, strings, initMovie, domContentLoaded, winOnLoad, didDCLoaded, getDocument, createMovie, catchError, setPolling, initDebug, debugLevels = ['log', 'info', 'warn', 'error'], defaultFlashVersion = 8, disableObject, failSafely, normalizeMovieURL, oRemoved = null, oRemovedHTML = null, str, flashBlockHandler, getSWFCSS, swfCSS, toggleDebug, loopFix, policyFix, complain, idCheck, waitingForEI = false, initPending = false, startTimer, stopTimer, timerExecute, h5TimerCount = 0, h5IntervalTimer = null, parseURL, messages = [],\r\n canIgnoreFlash, needsFlash = null, featureCheck, html5OK, html5CanPlay, html5ErrorCodes, html5Ext, html5Unload, domContentLoadedIE, testHTML5, event, slice = Array.prototype.slice, useGlobalHTML5Audio = false, lastGlobalHTML5URL, hasFlash, detectFlash, badSafariFix, html5_events, showSupport, flushMessages, wrapCallback, idCounter = 0, didSetup, msecScale = 1000,\r\n is_iDevice = ua.match(/(ipad|iphone|ipod)/i), isAndroid = ua.match(/android/i), isIE = ua.match(/msie|trident/i),\r\n isWebkit = ua.match(/webkit/i),\r\n isSafari = (ua.match(/safari/i) && !ua.match(/chrome/i)),\r\n isOpera = (ua.match(/opera/i)),\r\n mobileHTML5 = (ua.match(/(mobile|pre\\/|xoom)/i) || is_iDevice || isAndroid),\r\n isBadSafari = (!wl.match(/usehtml5audio/i) && !wl.match(/sm2-ignorebadua/i) && isSafari && !ua.match(/silk/i) && ua.match(/OS\\sX\\s10_6_([3-7])/i)), // Safari 4 and 5 (excluding Kindle Fire, \"Silk\") occasionally fail to load/play HTML5 audio on Snow Leopard 10.6.3 through 10.6.7 due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Confirmed bug. https://bugs.webkit.org/show_bug.cgi?id=32159\r\n hasConsole = (window.console !== _undefined && console.log !== _undefined),\r\n isFocused = (doc.hasFocus !== _undefined ? doc.hasFocus() : null),\r\n tryInitOnFocus = (isSafari && (doc.hasFocus === _undefined || !doc.hasFocus())),\r\n okToDisable = !tryInitOnFocus,\r\n flashMIME = /(mp3|mp4|mpa|m4a|m4b)/i,\r\n emptyURL = 'about:blank', // safe URL to unload, or load nothing from (flash 8 + most HTML5 UAs)\r\n emptyWAV = 'data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==', // tiny WAV for HTML5 unloading\r\n overHTTP = (doc.location ? doc.location.protocol.match(/http/i) : null),\r\n http = (!overHTTP ? '//' : ''),\r\n // mp3, mp4, aac etc.\r\n netStreamMimeTypes = /^\\s*audio\\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\\s*(?:$|;)/i,\r\n // Flash v9.0r115+ \"moviestar\" formats\r\n netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'm4b', 'mp4v', '3gp', '3g2'],\r\n netStreamPattern = new RegExp('\\\\.(' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n this.mimePattern = /^\\s*audio\\/(?:x-)?(?:mp(?:eg|3))\\s*(?:$|;)/i; // default mp3 set\r\n\r\n // use altURL if not \"online\"\r\n this.useAltURL = !overHTTP;\r\n\r\n swfCSS = {\r\n swfBox: 'sm2-object-box',\r\n swfDefault: 'movieContainer',\r\n swfError: 'swf_error', // SWF loaded, but SM2 couldn't start (other error)\r\n swfTimedout: 'swf_timedout',\r\n swfLoaded: 'swf_loaded',\r\n swfUnblocked: 'swf_unblocked', // or loaded OK\r\n sm2Debug: 'sm2_debug',\r\n highPerf: 'high_performance',\r\n flashDebug: 'flash_debug'\r\n };\r\n\r\n /**\r\n * HTML5 error codes, per W3C\r\n * Error code 1, MEDIA_ERR_ABORTED: Client aborted download at user's request.\r\n * Error code 2, MEDIA_ERR_NETWORK: A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.\r\n * Error code 3, MEDIA_ERR_DECODE: An error of some description occurred while decoding the media resource, after the resource was established to be usable.\r\n * Error code 4, MEDIA_ERR_SRC_NOT_SUPPORTED: Media (audio file) not supported (\"not usable.\")\r\n * Reference: https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n */\r\n html5ErrorCodes = [\r\n null,\r\n 'MEDIA_ERR_ABORTED',\r\n 'MEDIA_ERR_NETWORK',\r\n 'MEDIA_ERR_DECODE',\r\n 'MEDIA_ERR_SRC_NOT_SUPPORTED'\r\n ];\r\n\r\n /**\r\n * basic HTML5 Audio() support test\r\n * try...catch because of IE 9 \"not implemented\" nonsense\r\n * https://github.com/Modernizr/Modernizr/issues/224\r\n */\r\n\r\n this.hasHTML5 = (function() {\r\n try {\r\n // new Audio(null) for stupid Opera 9.64 case, which throws not_enough_arguments exception otherwise.\r\n return (Audio !== _undefined && (isOpera && opera !== _undefined && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== _undefined);\r\n } catch(e) {\r\n return false;\r\n }\r\n }());\r\n\r\n /**\r\n * Public SoundManager API\r\n * -----------------------\r\n */\r\n\r\n /**\r\n * Configures top-level soundManager properties.\r\n *\r\n * @param {object} options Option parameters, eg. { flashVersion: 9, url: '/path/to/swfs/' }\r\n * onready and ontimeout are also accepted parameters. call soundManager.setup() to see the full list.\r\n */\r\n\r\n this.setup = function(options) {\r\n\r\n var noURL = (!sm2.url);\r\n\r\n // warn if flash options have already been applied\r\n\r\n if (options !== _undefined && didInit && needsFlash && sm2.ok() && (options.flashVersion !== _undefined || options.url !== _undefined || options.html5Test !== _undefined)) {\r\n complain(str('setupLate'));\r\n }\r\n\r\n // TODO: defer: true?\r\n\r\n assign(options);\r\n\r\n if (!useGlobalHTML5Audio) {\r\n\r\n if (mobileHTML5) {\r\n\r\n // force the singleton HTML5 pattern on mobile, by default.\r\n if (!sm2.setupOptions.ignoreMobileRestrictions || sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n }\r\n\r\n } else if (sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n\r\n // only apply singleton HTML5 on desktop if forced.\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!didSetup && mobileHTML5) {\r\n\r\n if (sm2.setupOptions.ignoreMobileRestrictions) {\r\n\r\n messages.push(strings.ignoreMobile);\r\n\r\n } else {\r\n\r\n // prefer HTML5 for mobile + tablet-like devices, probably more reliable vs. flash at this point.\r\n\r\n // <d>\r\n if (!sm2.setupOptions.useHTML5Audio || sm2.setupOptions.preferFlash) {\r\n // notify that defaults are being changed.\r\n sm2._wD(strings.mobileUA);\r\n }\r\n // </d>\r\n\r\n sm2.setupOptions.useHTML5Audio = true;\r\n sm2.setupOptions.preferFlash = false;\r\n\r\n if (is_iDevice) {\r\n\r\n // no flash here.\r\n sm2.ignoreFlash = true;\r\n\r\n } else if ((isAndroid && !ua.match(/android\\s2\\.3/i)) || !isAndroid) {\r\n\r\n /**\r\n * Android devices tend to work better with a single audio instance, specifically for chained playback of sounds in sequence.\r\n * Common use case: exiting sound onfinish() -> createSound() -> play()\r\n * Presuming similar restrictions for other mobile, non-Android, non-iOS devices.\r\n */\r\n\r\n // <d>\r\n sm2._wD(strings.globalHTML5);\r\n // </d>\r\n\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // special case 1: \"Late setup\". SM2 loaded normally, but user didn't assign flash URL eg., setup({url:...}) before SM2 init. Treat as delayed init.\r\n\r\n if (options) {\r\n\r\n if (noURL && didDCLoaded && options.url !== _undefined) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n // special case 2: If lazy-loading SM2 (DOMContentLoaded has already happened) and user calls setup() with url: parameter, try to init ASAP.\r\n\r\n if (!didDCLoaded && options.url !== _undefined && doc.readyState === 'complete') {\r\n setTimeout(domContentLoaded, 1);\r\n }\r\n\r\n }\r\n\r\n didSetup = true;\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.ok = function() {\r\n\r\n return (needsFlash ? (didInit && !disabled) : (sm2.useHTML5Audio && sm2.hasHTML5));\r\n\r\n };\r\n\r\n this.supported = this.ok; // legacy\r\n\r\n this.getMovie = function(movie_id) {\r\n\r\n // safety net: some old browsers differ on SWF references, possibly related to ExternalInterface / flash version\r\n return id(movie_id) || doc[movie_id] || window[movie_id];\r\n\r\n };\r\n\r\n /**\r\n * Creates a SMSound sound object instance. Can also be overloaded, e.g., createSound('mySound', '/some.mp3');\r\n *\r\n * @param {object} oOptions Sound options (at minimum, url parameter is required.)\r\n * @return {object} SMSound The new SMSound object.\r\n */\r\n\r\n this.createSound = function(oOptions, _url) {\r\n\r\n var cs, cs_string, options, oSound = null;\r\n\r\n // <d>\r\n cs = sm + '.createSound(): ';\r\n cs_string = cs + str(!didInit ? 'notReady' : 'notOK');\r\n // </d>\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(cs_string);\r\n return false;\r\n }\r\n\r\n if (_url !== _undefined) {\r\n // function overloading in JS! :) ... assume simple createSound(id, url) use case.\r\n oOptions = {\r\n id: oOptions,\r\n url: _url\r\n };\r\n }\r\n\r\n // inherit from defaultOptions\r\n options = mixin(oOptions);\r\n\r\n options.url = parseURL(options.url);\r\n\r\n // generate an id, if needed.\r\n if (options.id === _undefined) {\r\n options.id = sm2.setupOptions.idPrefix + (idCounter++);\r\n }\r\n\r\n // <d>\r\n if (options.id.toString().charAt(0).match(/^[0-9]$/)) {\r\n sm2._wD(cs + str('badID', options.id), 2);\r\n }\r\n\r\n sm2._wD(cs + options.id + (options.url ? ' (' + options.url + ')' : ''), 1);\r\n // </d>\r\n\r\n if (idCheck(options.id, true)) {\r\n sm2._wD(cs + options.id + ' exists', 1);\r\n return sm2.sounds[options.id];\r\n }\r\n\r\n function make() {\r\n\r\n options = loopFix(options);\r\n sm2.sounds[options.id] = new SMSound(options);\r\n sm2.soundIDs.push(options.id);\r\n return sm2.sounds[options.id];\r\n\r\n }\r\n\r\n if (html5OK(options)) {\r\n\r\n oSound = make();\r\n // <d>\r\n if (!sm2.html5Only) {\r\n sm2._wD(options.id + ': Using HTML5');\r\n }\r\n // </d>\r\n oSound._setup_html5(options);\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(options.id + ': No HTML5 support for this sound, and no Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n // TODO: Move HTML5/flash checks into generic URL parsing/handling function.\r\n\r\n if (sm2.html5.usingFlash && options.url && options.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(options.id + ': data: URIs not supported via Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n if (fV > 8) {\r\n if (options.isMovieStar === null) {\r\n // attempt to detect MPEG-4 formats\r\n options.isMovieStar = !!(options.serverURL || (options.type ? options.type.match(netStreamMimeTypes) : false) || (options.url && options.url.match(netStreamPattern)));\r\n }\r\n // <d>\r\n if (options.isMovieStar) {\r\n sm2._wD(cs + 'using MovieStar handling');\r\n if (options.loops > 1) {\r\n _wDS('noNSLoop');\r\n }\r\n }\r\n // </d>\r\n }\r\n\r\n options = policyFix(options, cs);\r\n oSound = make();\r\n\r\n if (fV === 8) {\r\n flash._createSound(options.id, options.loops || 1, options.usePolicyFile);\r\n } else {\r\n flash._createSound(options.id, options.url, options.usePeakData, options.useWaveformData, options.useEQData, options.isMovieStar, (options.isMovieStar ? options.bufferTime : false), options.loops || 1, options.serverURL, options.duration || null, options.autoPlay, true, options.autoLoad, options.usePolicyFile);\r\n if (!options.serverURL) {\r\n // We are connected immediately\r\n oSound.connected = true;\r\n if (options.onconnect) {\r\n options.onconnect.apply(oSound);\r\n }\r\n }\r\n }\r\n\r\n if (!options.serverURL && (options.autoLoad || options.autoPlay)) {\r\n // call load for non-rtmp streams\r\n oSound.load(options);\r\n }\r\n\r\n }\r\n\r\n // rtmp will play in onconnect\r\n if (!options.serverURL && options.autoPlay) {\r\n oSound.play();\r\n }\r\n\r\n return oSound;\r\n\r\n };\r\n\r\n /**\r\n * Destroys a SMSound sound object instance.\r\n *\r\n * @param {string} sID The ID of the sound to destroy\r\n */\r\n\r\n this.destroySound = function(sID, _bFromSound) {\r\n\r\n // explicitly destroy a sound before normal page unload, etc.\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n var oS = sm2.sounds[sID], i;\r\n\r\n oS.stop();\r\n\r\n // Disable all callbacks after stop(), when the sound is being destroyed\r\n oS._iO = {};\r\n\r\n oS.unload();\r\n\r\n for (i = 0; i < sm2.soundIDs.length; i++) {\r\n if (sm2.soundIDs[i] === sID) {\r\n sm2.soundIDs.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n if (!_bFromSound) {\r\n // ignore if being called from SMSound instance\r\n oS.destruct(true);\r\n }\r\n\r\n oS = null;\r\n delete sm2.sounds[sID];\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Calls the load() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n */\r\n\r\n this.load = function(sID, oOptions) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].load(oOptions);\r\n\r\n };\r\n\r\n /**\r\n * Calls the unload() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n */\r\n\r\n this.unload = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].unload();\r\n\r\n };\r\n\r\n /**\r\n * Calls the onPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(sID, nPosition, oMethod, oScope) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].onposition(nPosition, oMethod, oScope);\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Calls the clearOnPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod Optional: The relevant callback to fire\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(sID, nPosition, oMethod) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].clearOnPosition(nPosition, oMethod);\r\n\r\n };\r\n\r\n /**\r\n * Calls the play() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(sID, oOptions) {\r\n\r\n var result = null,\r\n // legacy function-overloading use case: play('mySound', '/path/to/some.mp3');\r\n overloaded = (oOptions && !(oOptions instanceof Object));\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(sm + '.play(): ' + str(!didInit ? 'notReady' : 'notOK'));\r\n return false;\r\n }\r\n\r\n if (!idCheck(sID, overloaded)) {\r\n\r\n // no sound found for the given ID. Bail.\r\n if (!overloaded) return false;\r\n\r\n if (overloaded) {\r\n oOptions = {\r\n url: oOptions\r\n };\r\n }\r\n\r\n if (oOptions && oOptions.url) {\r\n // overloading use case, create+play: .play('someID', {url:'/path/to.mp3'});\r\n sm2._wD(sm + '.play(): Attempting to create \"' + sID + '\"', 1);\r\n oOptions.id = sID;\r\n result = sm2.createSound(oOptions).play();\r\n }\r\n\r\n } else if (overloaded) {\r\n\r\n // existing sound object case\r\n oOptions = {\r\n url: oOptions\r\n };\r\n\r\n }\r\n\r\n if (result === null) {\r\n // default case\r\n result = sm2.sounds[sID].play(oOptions);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Calls the setPlaybackRate() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(sID, rate, allowOverride) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPlaybackRate(rate, allowOverride);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(sID, nMsecOffset) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPosition(nMsecOffset);\r\n\r\n };\r\n\r\n /**\r\n * Calls the stop() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.stop(' + sID + ')', 1);\r\n\r\n return sm2.sounds[sID].stop();\r\n\r\n };\r\n\r\n /**\r\n * Stops all currently-playing sounds.\r\n */\r\n\r\n this.stopAll = function() {\r\n\r\n var oSound;\r\n sm2._wD(sm + '.stopAll()', 1);\r\n\r\n for (oSound in sm2.sounds) {\r\n if (sm2.sounds.hasOwnProperty(oSound)) {\r\n // apply only to sound objects\r\n sm2.sounds[oSound].stop();\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the pause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].pause();\r\n\r\n };\r\n\r\n /**\r\n * Pauses all currently-playing sounds.\r\n */\r\n\r\n this.pauseAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].pause();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the resume() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.resume = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].resume();\r\n\r\n };\r\n\r\n /**\r\n * Resumes all currently-paused sounds.\r\n */\r\n\r\n this.resumeAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].resume();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the togglePause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].togglePause();\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPan() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(sID, nPan) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPan(nPan);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setVolume() method of a SMSound object by ID\r\n * Overloaded case: pass only volume argument eg., setVolume(50) to apply to all sounds.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(sID, nVol) {\r\n\r\n // setVolume(50) function overloading case - apply to all sounds\r\n\r\n var i, j;\r\n\r\n if (sID !== _undefined && !isNaN(sID) && nVol === _undefined) {\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]].setVolume(sID);\r\n }\r\n return false;\r\n }\r\n\r\n // setVolume('mySound', 50) case\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setVolume(nVol);\r\n\r\n };\r\n\r\n /**\r\n * Calls the mute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.mute = function(sID) {\r\n\r\n var i = 0;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.mute(): Muting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].mute();\r\n }\r\n sm2.muted = true;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.mute(): Muting \"' + sID + '\"');\r\n return sm2.sounds[sID].mute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Mutes all sounds.\r\n */\r\n\r\n this.muteAll = function() {\r\n\r\n sm2.mute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the unmute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.unmute = function(sID) {\r\n\r\n var i;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].unmute();\r\n }\r\n sm2.muted = false;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting \"' + sID + '\"');\r\n\r\n return sm2.sounds[sID].unmute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes all sounds.\r\n */\r\n\r\n this.unmuteAll = function() {\r\n\r\n sm2.unmute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the toggleMute() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].toggleMute();\r\n\r\n };\r\n\r\n /**\r\n * Retrieves the memory used by the flash plugin.\r\n *\r\n * @return {number} The amount of memory in use\r\n */\r\n\r\n this.getMemoryUse = function() {\r\n\r\n // flash-only\r\n var ram = 0;\r\n\r\n if (flash && fV !== 8) {\r\n ram = parseInt(flash._getMemoryUse(), 10);\r\n }\r\n\r\n return ram;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: NOPs soundManager and all SMSound objects.\r\n */\r\n\r\n this.disable = function(bNoDisable) {\r\n\r\n // destroy all functions\r\n var i;\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n // already disabled?\r\n if (disabled) return false;\r\n\r\n disabled = true;\r\n\r\n _wDS('shutdown', 1);\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n disableObject(sm2.sounds[sm2.soundIDs[i]]);\r\n }\r\n\r\n disableObject(sm2);\r\n\r\n // fire \"complete\", despite fail\r\n initComplete(bNoDisable);\r\n\r\n event.remove(window, 'load', initUserOnload);\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a MIME type, eg. 'audio/mp3'.\r\n */\r\n\r\n this.canPlayMIME = function(sMIME) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n type: sMIME\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n // if flash 9, test netStream (movieStar) types as well.\r\n result = (sMIME && sm2.ok() ? !!((fV > 8 ? sMIME.match(netStreamMimeTypes) : null) || sMIME.match(sm2.mimePattern)) : null); // TODO: make less \"weird\" (per JSLint)\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a URL based on audio support.\r\n *\r\n * @param {string} sURL The URL to test\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayURL = function(sURL) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n url: sURL\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n result = (sURL && sm2.ok() ? !!(sURL.match(sm2.filePattern)) : null);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of an HTML DOM <a> object (or similar object literal) based on audio support.\r\n *\r\n * @param {object} oLink an HTML DOM <a> object or object literal including href and/or type attributes\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayLink = function(oLink) {\r\n\r\n if (oLink.type !== _undefined && oLink.type && sm2.canPlayMIME(oLink.type)) return true;\r\n\r\n return sm2.canPlayURL(oLink.href);\r\n\r\n };\r\n\r\n /**\r\n * Retrieves a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.getSoundById = function(sID, _suppressDebug) {\r\n\r\n if (!sID) return null;\r\n\r\n var result = sm2.sounds[sID];\r\n\r\n // <d>\r\n if (!result && !_suppressDebug) {\r\n sm2._wD(sm + '.getSoundById(): Sound \"' + sID + '\" not found.', 2);\r\n }\r\n // </d>\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has successfully initialized.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.onready = function(oMethod, oScope) {\r\n\r\n var sType = 'onready',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents();\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has failed to initialize.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.ontimeout = function(oMethod, oScope) {\r\n\r\n var sType = 'ontimeout',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents({ type: sType });\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Writes console.log()-style debug output to a console or in-browser element.\r\n * Applies when debugMode = true\r\n *\r\n * @param {string} sText The console message\r\n * @param {object} nType Optional log level (number), or object. Number case: Log type/style where 0 = 'info', 1 = 'warn', 2 = 'error'. Object case: Object to be dumped.\r\n */\r\n\r\n this._writeDebug = function(sText, sTypeOrObject) {\r\n\r\n // pseudo-private console.log()-style output\r\n // <d>\r\n\r\n var sDID = 'soundmanager-debug', o, oItem;\r\n\r\n if (!sm2.setupOptions.debugMode) return false;\r\n\r\n if (hasConsole && sm2.useConsole) {\r\n if (sTypeOrObject && typeof sTypeOrObject === 'object') {\r\n // object passed; dump to console.\r\n console.log(sText, sTypeOrObject);\r\n } else if (debugLevels[sTypeOrObject] !== _undefined) {\r\n console[debugLevels[sTypeOrObject]](sText);\r\n } else {\r\n console.log(sText);\r\n }\r\n if (sm2.consoleOnly) return true;\r\n }\r\n\r\n o = id(sDID);\r\n\r\n if (!o) return false;\r\n\r\n oItem = doc.createElement('div');\r\n\r\n if (++wdCount % 2 === 0) {\r\n oItem.className = 'sm2-alt';\r\n }\r\n\r\n if (sTypeOrObject === _undefined) {\r\n sTypeOrObject = 0;\r\n } else {\r\n sTypeOrObject = parseInt(sTypeOrObject, 10);\r\n }\r\n\r\n oItem.appendChild(doc.createTextNode(sText));\r\n\r\n if (sTypeOrObject) {\r\n if (sTypeOrObject >= 2) {\r\n oItem.style.fontWeight = 'bold';\r\n }\r\n if (sTypeOrObject === 3) {\r\n oItem.style.color = '#ff3333';\r\n }\r\n }\r\n\r\n // top-to-bottom\r\n // o.appendChild(oItem);\r\n\r\n // bottom-to-top\r\n o.insertBefore(oItem, o.firstChild);\r\n\r\n o = null;\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n // <d>\r\n // last-resort debugging option\r\n if (wl.indexOf('sm2-debug=alert') !== -1) {\r\n this._writeDebug = function(sText) {\r\n window.alert(sText);\r\n };\r\n }\r\n // </d>\r\n\r\n // alias\r\n this._wD = this._writeDebug;\r\n\r\n /**\r\n * Provides debug / state information on all SMSound objects.\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n var i, j;\r\n _wDS('currentObj', 1);\r\n\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]]._debug();\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Restarts and re-initializes the SoundManager instance.\r\n *\r\n * @param {boolean} resetEvents Optional: When true, removes all registered onready and ontimeout event callbacks.\r\n * @param {boolean} excludeInit Options: When true, does not call beginDelayedInit() (which would restart SM2).\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n this.reboot = function(resetEvents, excludeInit) {\r\n\r\n // reset some (or all) state, and re-init unless otherwise specified.\r\n\r\n // <d>\r\n if (sm2.soundIDs.length) {\r\n sm2._wD('Destroying ' + sm2.soundIDs.length + ' SMSound object' + (sm2.soundIDs.length !== 1 ? 's' : '') + '...');\r\n }\r\n // </d>\r\n\r\n var i, j, k;\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].destruct();\r\n }\r\n\r\n // trash ze flash (remove from the DOM)\r\n\r\n if (flash) {\r\n\r\n try {\r\n\r\n if (isIE) {\r\n oRemovedHTML = flash.innerHTML;\r\n }\r\n\r\n oRemoved = flash.parentNode.removeChild(flash);\r\n\r\n } catch(e) {\r\n\r\n // Remove failed? May be due to flash blockers silently removing the SWF object/embed node from the DOM. Warn and continue.\r\n\r\n _wDS('badRemove', 2);\r\n\r\n }\r\n\r\n }\r\n\r\n // actually, force recreate of movie.\r\n\r\n oRemovedHTML = oRemoved = needsFlash = flash = null;\r\n\r\n sm2.enabled = didDCLoaded = didInit = waitingForEI = initPending = didAppend = appendSuccess = disabled = useGlobalHTML5Audio = sm2.swfLoaded = false;\r\n\r\n sm2.soundIDs = [];\r\n sm2.sounds = {};\r\n\r\n idCounter = 0;\r\n didSetup = false;\r\n\r\n if (!resetEvents) {\r\n // reset callbacks for onready, ontimeout etc. so that they will fire again on re-init\r\n for (i in on_queue) {\r\n if (on_queue.hasOwnProperty(i)) {\r\n for (j = 0, k = on_queue[i].length; j < k; j++) {\r\n on_queue[i][j].fired = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // remove all callbacks entirely\r\n on_queue = [];\r\n }\r\n\r\n // <d>\r\n if (!excludeInit) {\r\n sm2._wD(sm + ': Rebooting...');\r\n }\r\n // </d>\r\n\r\n // reset HTML5 and flash canPlay test results\r\n\r\n sm2.html5 = {\r\n usingFlash: null\r\n };\r\n\r\n sm2.flash = {};\r\n\r\n // reset device-specific HTML/flash mode switches\r\n\r\n sm2.html5Only = false;\r\n sm2.ignoreFlash = false;\r\n\r\n window.setTimeout(function() {\r\n\r\n // by default, re-init\r\n\r\n if (!excludeInit) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n }, 20);\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.reset = function() {\r\n\r\n /**\r\n * Shuts down and restores the SoundManager instance to its original loaded state, without an explicit reboot. All onready/ontimeout handlers are removed.\r\n * After this call, SM2 may be re-initialized via soundManager.beginDelayedInit().\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n _wDS('reset');\r\n\r\n return sm2.reboot(true, true);\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: Determines the SM2 flash movie's load progress.\r\n *\r\n * @return {number or null} Percent loaded, or if invalid/unsupported, null.\r\n */\r\n\r\n this.getMoviePercent = function() {\r\n\r\n /**\r\n * Interesting syntax notes...\r\n * Flash/ExternalInterface (ActiveX/NPAPI) bridge methods are not typeof \"function\" nor instanceof Function, but are still valid.\r\n * Furthermore, using (flash && flash.PercentLoaded) causes IE to throw \"object doesn't support this property or method\".\r\n * Thus, 'in' syntax must be used.\r\n */\r\n\r\n return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);\r\n\r\n };\r\n\r\n /**\r\n * Additional helper for manually invoking SM2's init process after DOM Ready / window.onload().\r\n */\r\n\r\n this.beginDelayedInit = function() {\r\n\r\n windowLoaded = true;\r\n domContentLoaded();\r\n\r\n setTimeout(function() {\r\n\r\n if (initPending) return false;\r\n\r\n createMovie();\r\n initMovie();\r\n initPending = true;\r\n\r\n return true;\r\n\r\n }, 20);\r\n\r\n delayWaitForEI();\r\n\r\n };\r\n\r\n /**\r\n * Destroys the SoundManager instance and all SMSound instances.\r\n */\r\n\r\n this.destruct = function() {\r\n\r\n sm2._wD(sm + '.destruct()');\r\n sm2.disable(true);\r\n\r\n };\r\n\r\n /**\r\n * SMSound() (sound object) constructor\r\n * ------------------------------------\r\n *\r\n * @param {object} oOptions Sound options (id and url are required attributes)\r\n * @return {SMSound} The new SMSound object\r\n */\r\n\r\n SMSound = function(oOptions) {\r\n\r\n var s = this, resetProperties, add_html5_events, remove_html5_events, stop_html5_timer, start_html5_timer, attachOnPosition, onplay_called = false, onPositionItems = [], onPositionFired = 0, detachOnPosition, applyFromTo, lastURL = null, lastHTML5State, urlOmitted;\r\n\r\n lastHTML5State = {\r\n // tracks duration + position (time)\r\n duration: null,\r\n time: null\r\n };\r\n\r\n this.id = oOptions.id;\r\n\r\n // legacy\r\n this.sID = this.id;\r\n\r\n this.url = oOptions.url;\r\n this.options = mixin(oOptions);\r\n\r\n // per-play-instance-specific options\r\n this.instanceOptions = this.options;\r\n\r\n // short alias\r\n this._iO = this.instanceOptions;\r\n\r\n // assign property defaults\r\n this.pan = this.options.pan;\r\n this.volume = this.options.volume;\r\n\r\n // whether or not this object is using HTML5\r\n this.isHTML5 = false;\r\n\r\n // internal HTML5 Audio() object reference\r\n this._a = null;\r\n\r\n // for flash 8 special-case createSound() without url, followed by load/play with url case\r\n urlOmitted = (!this.url);\r\n\r\n /**\r\n * SMSound() public methods\r\n * ------------------------\r\n */\r\n\r\n this.id3 = {};\r\n\r\n /**\r\n * Writes SMSound object parameters to debug console\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n sm2._wD(s.id + ': Merged options:', s.options);\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Begins loading a sound per its *url*.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.load = function(options) {\r\n\r\n var oSound = null, instanceOptions;\r\n\r\n if (options !== _undefined) {\r\n s._iO = mixin(options, s.options);\r\n } else {\r\n options = s.options;\r\n s._iO = options;\r\n if (lastURL && lastURL !== s.url) {\r\n _wDS('manURL');\r\n s._iO.url = s.url;\r\n s.url = null;\r\n }\r\n }\r\n\r\n if (!s._iO.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n // ensure we're in sync\r\n s.instanceOptions = s._iO;\r\n\r\n // local shortcut\r\n instanceOptions = s._iO;\r\n\r\n sm2._wD(s.id + ': load (' + instanceOptions.url + ')');\r\n\r\n if (!instanceOptions.url && !s.url) {\r\n sm2._wD(s.id + ': load(): url is unassigned. Exiting.', 2);\r\n return s;\r\n }\r\n\r\n // <d>\r\n if (!s.isHTML5 && fV === 8 && !s.url && !instanceOptions.autoPlay) {\r\n // flash 8 load() -> play() won't work before onload has fired.\r\n sm2._wD(s.id + ': Flash 8 load() limitation: Wait for onload() before calling play().', 1);\r\n }\r\n // </d>\r\n\r\n if (instanceOptions.url === s.url && s.readyState !== 0 && s.readyState !== 2) {\r\n _wDS('onURL', 1);\r\n // if loaded and an onload() exists, fire immediately.\r\n if (s.readyState === 3 && instanceOptions.onload) {\r\n // assume success based on truthy duration.\r\n wrapCallback(s, function() {\r\n instanceOptions.onload.apply(s, [(!!s.duration)]);\r\n });\r\n }\r\n return s;\r\n }\r\n\r\n // reset a few state properties\r\n\r\n s.loaded = false;\r\n s.readyState = 1;\r\n s.playState = 0;\r\n s.id3 = {};\r\n\r\n // TODO: If switching from HTML5 -> flash (or vice versa), stop currently-playing audio.\r\n\r\n if (html5OK(instanceOptions)) {\r\n\r\n oSound = s._setup_html5(instanceOptions);\r\n\r\n if (!oSound._called_load) {\r\n\r\n s._html5_canplay = false;\r\n\r\n // TODO: review called_load / html5_canplay logic\r\n\r\n // if url provided directly to load(), assign it here.\r\n\r\n if (s.url !== instanceOptions.url) {\r\n\r\n sm2._wD(_wDS('manURL') + ': ' + instanceOptions.url);\r\n\r\n s._a.src = instanceOptions.url;\r\n\r\n // TODO: review / re-apply all relevant options (volume, loop, onposition etc.)\r\n\r\n // reset position for new URL\r\n s.setPosition(0);\r\n\r\n }\r\n\r\n // given explicit load call, try to preload.\r\n\r\n // early HTML5 implementation (non-standard)\r\n s._a.autobuffer = 'auto';\r\n\r\n // standard property, values: none / metadata / auto\r\n // reference: http://msdn.microsoft.com/en-us/library/ie/ff974759%28v=vs.85%29.aspx\r\n s._a.preload = 'auto';\r\n\r\n s._a._called_load = true;\r\n\r\n } else {\r\n\r\n sm2._wD(s.id + ': Ignoring request to load again');\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(s.id + ': No flash support. Exiting.');\r\n return s;\r\n }\r\n\r\n if (s._iO.url && s._iO.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(s.id + ': data: URIs not supported via Flash. Exiting.');\r\n return s;\r\n }\r\n\r\n try {\r\n s.isHTML5 = false;\r\n s._iO = policyFix(loopFix(instanceOptions));\r\n // if we have \"position\", disable auto-play as we'll be seeking to that position at onload().\r\n if (s._iO.autoPlay && (s._iO.position || s._iO.from)) {\r\n sm2._wD(s.id + ': Disabling autoPlay because of non-zero offset case');\r\n s._iO.autoPlay = false;\r\n }\r\n // re-assign local shortcut\r\n instanceOptions = s._iO;\r\n if (fV === 8) {\r\n flash._load(s.id, instanceOptions.url, instanceOptions.stream, instanceOptions.autoPlay, instanceOptions.usePolicyFile);\r\n } else {\r\n flash._load(s.id, instanceOptions.url, !!(instanceOptions.stream), !!(instanceOptions.autoPlay), instanceOptions.loops || 1, !!(instanceOptions.autoLoad), instanceOptions.usePolicyFile);\r\n }\r\n } catch(e) {\r\n _wDS('smError', 2);\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'SMSOUND_LOAD_JS_EXCEPTION',\r\n fatal: true\r\n });\r\n }\r\n\r\n }\r\n\r\n // after all of this, ensure sound url is up to date.\r\n s.url = instanceOptions.url;\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads a sound, canceling any open HTTP requests.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unload = function() {\r\n\r\n // Flash 8/AS2 can't \"close\" a stream - fake it by loading an empty URL\r\n // Flash 9/AS3: Close stream, preventing further load\r\n // HTML5: Most UAs will use empty URL\r\n\r\n if (s.readyState !== 0) {\r\n\r\n sm2._wD(s.id + ': unload()');\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (fV === 8) {\r\n flash._unload(s.id, emptyURL);\r\n } else {\r\n flash._unload(s.id);\r\n }\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n\r\n s._a.pause();\r\n\r\n // update empty URL, too\r\n lastURL = html5Unload(s._a);\r\n\r\n }\r\n\r\n }\r\n\r\n // reset load/status flags\r\n resetProperties();\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads and destroys a sound.\r\n */\r\n\r\n this.destruct = function(_bFromSM) {\r\n\r\n sm2._wD(s.id + ': Destruct');\r\n\r\n if (!s.isHTML5) {\r\n\r\n // kill sound within Flash\r\n // Disable the onfailure handler\r\n s._iO.onfailure = null;\r\n flash._destroySound(s.id);\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n s._a.pause();\r\n html5Unload(s._a);\r\n if (!useGlobalHTML5Audio) {\r\n remove_html5_events();\r\n }\r\n // break obvious circular reference\r\n s._a._s = null;\r\n s._a = null;\r\n }\r\n\r\n }\r\n\r\n if (!_bFromSM) {\r\n // ensure deletion from controller\r\n sm2.destroySound(s.id, true);\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Begins playing a sound.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(options, _updatePlayState) {\r\n\r\n var fN, allowMulti, a, onready,\r\n audioClone, onended, oncanplay,\r\n startOK = true;\r\n\r\n // <d>\r\n fN = s.id + ': play(): ';\r\n // </d>\r\n\r\n // default to true\r\n _updatePlayState = (_updatePlayState === _undefined ? true : _updatePlayState);\r\n\r\n if (!options) {\r\n options = {};\r\n }\r\n\r\n // first, use local URL (if specified)\r\n if (s.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n // mix in any options defined at createSound()\r\n s._iO = mixin(s._iO, s.options);\r\n\r\n // mix in any options specific to this method\r\n s._iO = mixin(options, s._iO);\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n s.instanceOptions = s._iO;\r\n\r\n // RTMP-only\r\n if (!s.isHTML5 && s._iO.serverURL && !s.connected) {\r\n if (!s.getAutoPlay()) {\r\n sm2._wD(fN + ' Netstream not connected yet - setting autoPlay');\r\n s.setAutoPlay(true);\r\n }\r\n // play will be called in onconnect()\r\n return s;\r\n }\r\n\r\n if (html5OK(s._iO)) {\r\n s._setup_html5(s._iO);\r\n start_html5_timer();\r\n }\r\n\r\n if (s.playState === 1 && !s.paused) {\r\n\r\n allowMulti = s._iO.multiShot;\r\n\r\n if (!allowMulti) {\r\n\r\n sm2._wD(fN + 'Already playing (one-shot)', 1);\r\n\r\n if (s.isHTML5) {\r\n // go back to original position.\r\n s.setPosition(s._iO.position);\r\n }\r\n\r\n return s;\r\n\r\n }\r\n\r\n sm2._wD(fN + 'Already playing (multi-shot)', 1);\r\n\r\n }\r\n\r\n // edge case: play() with explicit URL parameter\r\n if (options.url && options.url !== s.url) {\r\n\r\n // special case for createSound() followed by load() / play() with url; avoid double-load case.\r\n if (!s.readyState && !s.isHTML5 && fV === 8 && urlOmitted) {\r\n\r\n urlOmitted = false;\r\n\r\n } else {\r\n\r\n // load using merged options\r\n s.load(s._iO);\r\n\r\n }\r\n\r\n }\r\n\r\n if (!s.loaded) {\r\n\r\n if (s.readyState === 0) {\r\n\r\n sm2._wD(fN + 'Attempting to load');\r\n\r\n // try to get this sound playing ASAP\r\n if (!s.isHTML5 && !sm2.html5Only) {\r\n\r\n // flash: assign directly because setAutoPlay() increments the instanceCount\r\n s._iO.autoPlay = true;\r\n s.load(s._iO);\r\n\r\n } else if (s.isHTML5) {\r\n\r\n // iOS needs this when recycling sounds, loading a new URL on an existing object.\r\n s.load(s._iO);\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Unsupported type. Exiting.');\r\n\r\n return s;\r\n\r\n }\r\n\r\n // HTML5 hack - re-set instanceOptions?\r\n s.instanceOptions = s._iO;\r\n\r\n } else if (s.readyState === 2) {\r\n\r\n sm2._wD(fN + 'Could not load - exiting', 2);\r\n\r\n return s;\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Loading - attempting to play...');\r\n\r\n }\r\n\r\n } else {\r\n\r\n // \"play()\"\r\n sm2._wD(fN.substr(0, fN.lastIndexOf(':')));\r\n\r\n }\r\n\r\n if (!s.isHTML5 && fV === 9 && s.position > 0 && s.position === s.duration) {\r\n // flash 9 needs a position reset if play() is called while at the end of a sound.\r\n sm2._wD(fN + 'Sound at end, resetting to position: 0');\r\n options.position = 0;\r\n }\r\n\r\n /**\r\n * Streams will pause when their buffer is full if they are being loaded.\r\n * In this case paused is true, but the song hasn't started playing yet.\r\n * If we just call resume() the onplay() callback will never be called.\r\n * So only call resume() if the position is > 0.\r\n * Another reason is because options like volume won't have been applied yet.\r\n * For normal sounds, just resume.\r\n */\r\n\r\n if (s.paused && s.position >= 0 && (!s._iO.serverURL || s.position > 0)) {\r\n\r\n // https://gist.github.com/37b17df75cc4d7a90bf6\r\n sm2._wD(fN + 'Resuming from paused state', 1);\r\n s.resume();\r\n\r\n } else {\r\n\r\n s._iO = mixin(options, s._iO);\r\n\r\n /**\r\n * Preload in the event of play() with position under Flash,\r\n * or from/to parameters and non-RTMP case\r\n */\r\n if (((!s.isHTML5 && s._iO.position !== null && s._iO.position > 0) || (s._iO.from !== null && s._iO.from > 0) || s._iO.to !== null) && s.instanceCount === 0 && s.playState === 0 && !s._iO.serverURL) {\r\n\r\n onready = function() {\r\n // sound \"canplay\" or onload()\r\n // re-apply position/from/to to instance options, and start playback\r\n s._iO = mixin(options, s._iO);\r\n s.play(s._iO);\r\n };\r\n\r\n // HTML5 needs to at least have \"canplay\" fired before seeking.\r\n if (s.isHTML5 && !s._html5_canplay) {\r\n\r\n // this hasn't been loaded yet. load it first, and then do this again.\r\n sm2._wD(fN + 'Beginning load for non-zero offset case');\r\n\r\n s.load({\r\n // note: custom HTML5-only event added for from/to implementation.\r\n _oncanplay: onready\r\n });\r\n\r\n } else if (!s.isHTML5 && !s.loaded && (!s.readyState || s.readyState !== 2)) {\r\n\r\n // to be safe, preload the whole thing in Flash.\r\n\r\n sm2._wD(fN + 'Preloading for non-zero offset case');\r\n\r\n s.load({\r\n onload: onready\r\n });\r\n\r\n }\r\n\r\n // otherwise, we're ready to go. re-apply local options, and continue\r\n\r\n s._iO = applyFromTo();\r\n\r\n }\r\n\r\n // sm2._wD(fN + 'Starting to play');\r\n\r\n // increment instance counter, where enabled + supported\r\n if (!s.instanceCount || s._iO.multiShotEvents || (s.isHTML5 && s._iO.multiShot && !useGlobalHTML5Audio) || (!s.isHTML5 && fV > 8 && !s.getAutoPlay())) {\r\n s.instanceCount++;\r\n }\r\n\r\n // if first play and onposition parameters exist, apply them now\r\n if (s._iO.onposition && s.playState === 0) {\r\n attachOnPosition(s);\r\n }\r\n\r\n s.playState = 1;\r\n s.paused = false;\r\n\r\n s.position = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position : 0);\r\n\r\n if (!s.isHTML5) {\r\n s._iO = policyFix(loopFix(s._iO));\r\n }\r\n\r\n if (s._iO.onplay && _updatePlayState) {\r\n s._iO.onplay.apply(s);\r\n onplay_called = true;\r\n }\r\n\r\n s.setVolume(s._iO.volume, true);\r\n s.setPan(s._iO.pan, true);\r\n\r\n if (s._iO.playbackRate !== 1) {\r\n s.setPlaybackRate(s._iO.playbackRate);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n startOK = flash._start(s.id, s._iO.loops || 1, (fV === 9 ? s.position : s.position / msecScale), s._iO.multiShot || false);\r\n\r\n if (fV === 9 && !startOK) {\r\n // edge case: no sound hardware, or 32-channel flash ceiling hit.\r\n // applies only to Flash 9, non-NetStream/MovieStar sounds.\r\n // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play%28%29\r\n sm2._wD(fN + 'No sound hardware, or 32-sound ceiling hit', 2);\r\n if (s._iO.onplayerror) {\r\n s._iO.onplayerror.apply(s);\r\n }\r\n\r\n }\r\n\r\n } else if (s.instanceCount < 2) {\r\n\r\n // HTML5 single-instance case\r\n\r\n start_html5_timer();\r\n\r\n a = s._setup_html5();\r\n\r\n s.setPosition(s._iO.position);\r\n\r\n a.play();\r\n\r\n } else {\r\n\r\n // HTML5 multi-shot case\r\n\r\n sm2._wD(s.id + ': Cloning Audio() for instance #' + s.instanceCount + '...');\r\n\r\n audioClone = new Audio(s._iO.url);\r\n\r\n onended = function() {\r\n event.remove(audioClone, 'ended', onended);\r\n s._onfinish(s);\r\n // cleanup\r\n html5Unload(audioClone);\r\n audioClone = null;\r\n };\r\n\r\n oncanplay = function() {\r\n event.remove(audioClone, 'canplay', oncanplay);\r\n try {\r\n audioClone.currentTime = s._iO.position / msecScale;\r\n } catch(err) {\r\n complain(s.id + ': multiShot play() failed to apply position of ' + (s._iO.position / msecScale));\r\n }\r\n audioClone.play();\r\n };\r\n\r\n event.add(audioClone, 'ended', onended);\r\n\r\n // apply volume to clones, too\r\n if (s._iO.volume !== _undefined) {\r\n audioClone.volume = Math.max(0, Math.min(1, s._iO.volume / 100));\r\n }\r\n\r\n // playing multiple muted sounds? if you do this, you're weird ;) - but let's cover it.\r\n if (s.muted) {\r\n audioClone.muted = true;\r\n }\r\n\r\n if (s._iO.position) {\r\n // HTML5 audio can't seek before onplay() event has fired.\r\n // wait for canplay, then seek to position and start playback.\r\n event.add(audioClone, 'canplay', oncanplay);\r\n } else {\r\n // begin playback at currentTime: 0\r\n audioClone.play();\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Stops playing a sound (and optionally, all sounds)\r\n *\r\n * @param {boolean} bAll Optional: Whether to stop all sounds\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(bAll) {\r\n\r\n var instanceOptions = s._iO,\r\n originalPosition;\r\n\r\n if (s.playState === 1) {\r\n\r\n sm2._wD(s.id + ': stop()');\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n s.paused = false;\r\n\r\n if (!s.isHTML5) {\r\n s.playState = 0;\r\n }\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // and \"to\" position, if set\r\n if (instanceOptions.to) {\r\n s.clearOnPosition(instanceOptions.to);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._stop(s.id, bAll);\r\n\r\n // hack for netStream: just unload\r\n if (instanceOptions.serverURL) {\r\n s.unload();\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n originalPosition = s.position;\r\n\r\n // act like Flash, though\r\n s.setPosition(0);\r\n\r\n // hack: reflect old position for onstop() (also like Flash)\r\n s.position = originalPosition;\r\n\r\n // html5 has no stop()\r\n // NOTE: pausing means iOS requires interaction to resume.\r\n s._a.pause();\r\n\r\n s.playState = 0;\r\n\r\n // and update UI\r\n s._onTimer();\r\n\r\n stop_html5_timer();\r\n\r\n }\r\n\r\n s.instanceCount = 0;\r\n s._iO = {};\r\n\r\n if (instanceOptions.onstop) {\r\n instanceOptions.onstop.apply(s);\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Sets autoPlay for RTMP.\r\n *\r\n * @param {boolean} autoPlay state\r\n */\r\n\r\n this.setAutoPlay = function(autoPlay) {\r\n\r\n sm2._wD(s.id + ': Autoplay turned ' + (autoPlay ? 'on' : 'off'));\r\n s._iO.autoPlay = autoPlay;\r\n\r\n if (!s.isHTML5) {\r\n flash._setAutoPlay(s.id, autoPlay);\r\n if (autoPlay) {\r\n // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP)\r\n if (!s.instanceCount && s.readyState === 1) {\r\n s.instanceCount++;\r\n sm2._wD(s.id + ': Incremented instance count to ' + s.instanceCount);\r\n }\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Returns the autoPlay boolean.\r\n *\r\n * @return {boolean} The current autoPlay value\r\n */\r\n\r\n this.getAutoPlay = function() {\r\n\r\n return s._iO.autoPlay;\r\n\r\n };\r\n\r\n /**\r\n * Sets the playback rate of a sound (HTML5-only.)\r\n *\r\n * @param {number} playbackRate (+/-)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(playbackRate) {\r\n\r\n // Per Mozilla, limit acceptable values to prevent playback from stopping (unless allowOverride is truthy.)\r\n // https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery/WebAudio_playbackRate_explained\r\n var normalizedRate = Math.max(0.5, Math.min(4, playbackRate));\r\n\r\n // <d>\r\n if (normalizedRate !== playbackRate) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + playbackRate + '): limiting rate to ' + normalizedRate, 2);\r\n }\r\n // </d>\r\n\r\n if (s.isHTML5) {\r\n try {\r\n s._iO.playbackRate = normalizedRate;\r\n s._a.playbackRate = normalizedRate;\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + normalizedRate + ') failed: ' + e.message, 2);\r\n }\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the position of a sound.\r\n *\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(nMsecOffset) {\r\n\r\n if (nMsecOffset === _undefined) {\r\n nMsecOffset = 0;\r\n }\r\n\r\n var position, position1K,\r\n // Use the duration from the instance options, if we don't have a track duration yet.\r\n // position >= 0 and <= current available (loaded) duration\r\n offset = (s.isHTML5 ? Math.max(nMsecOffset, 0) : Math.min(s.duration || s._iO.duration, Math.max(nMsecOffset, 0)));\r\n\r\n s.position = offset;\r\n position1K = s.position / msecScale;\r\n s._resetOnPosition(s.position);\r\n s._iO.position = offset;\r\n\r\n if (!s.isHTML5) {\r\n\r\n position = (fV === 9 ? s.position : position1K);\r\n\r\n if (s.readyState && s.readyState !== 2) {\r\n // if paused or not playing, will not resume (by playing)\r\n flash._setPosition(s.id, position, (s.paused || !s.playState), s._iO.multiShot);\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n // Set the position in the canplay handler if the sound is not ready yet\r\n if (s._html5_canplay) {\r\n\r\n if (s._a.currentTime.toFixed(3) !== position1K.toFixed(3)) {\r\n\r\n /**\r\n * DOM/JS errors/exceptions to watch out for:\r\n * if seek is beyond (loaded?) position, \"DOM exception 11\"\r\n * \"INDEX_SIZE_ERR\": DOM exception 1\r\n */\r\n sm2._wD(s.id + ': setPosition(' + position1K + ')');\r\n\r\n try {\r\n s._a.currentTime = position1K;\r\n if (s.playState === 0 || s.paused) {\r\n // allow seek without auto-play/resume\r\n s._a.pause();\r\n }\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPosition(' + position1K + ') failed: ' + e.message, 2);\r\n }\r\n\r\n }\r\n\r\n } else if (position1K) {\r\n\r\n // warn on non-zero seek attempts\r\n sm2._wD(s.id + ': setPosition(' + position1K + '): Cannot seek yet, sound not ready', 2);\r\n return s;\r\n\r\n }\r\n\r\n if (s.paused) {\r\n\r\n // if paused, refresh UI right away by forcing update\r\n s._onTimer(true);\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Pauses sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(_bCallFlash) {\r\n\r\n if (s.paused || (s.playState === 0 && s.readyState !== 1)) return s;\r\n\r\n sm2._wD(s.id + ': pause()');\r\n s.paused = true;\r\n\r\n if (!s.isHTML5) {\r\n if (_bCallFlash || _bCallFlash === _undefined) {\r\n flash._pause(s.id, s._iO.multiShot);\r\n }\r\n } else {\r\n s._setup_html5().pause();\r\n stop_html5_timer();\r\n }\r\n\r\n if (s._iO.onpause) {\r\n s._iO.onpause.apply(s);\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Resumes sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n /**\r\n * When auto-loaded streams pause on buffer full they have a playState of 0.\r\n * We need to make sure that the playState is set to 1 when these streams \"resume\".\r\n * When a paused stream is resumed, we need to trigger the onplay() callback if it\r\n * hasn't been called already. In this case since the sound is being played for the\r\n * first time, I think it's more appropriate to call onplay() rather than onresume().\r\n */\r\n\r\n this.resume = function() {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n if (!s.paused) return s;\r\n\r\n sm2._wD(s.id + ': resume()');\r\n s.paused = false;\r\n s.playState = 1;\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (instanceOptions.isMovieStar && !instanceOptions.serverURL) {\r\n // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition.\r\n s.setPosition(s.position);\r\n }\r\n\r\n // flash method is toggle-based (pause/resume)\r\n flash._pause(s.id, instanceOptions.multiShot);\r\n\r\n } else {\r\n\r\n s._setup_html5().play();\r\n start_html5_timer();\r\n\r\n }\r\n\r\n if (!onplay_called && instanceOptions.onplay) {\r\n\r\n instanceOptions.onplay.apply(s);\r\n onplay_called = true;\r\n\r\n } else if (instanceOptions.onresume) {\r\n\r\n instanceOptions.onresume.apply(s);\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function() {\r\n\r\n sm2._wD(s.id + ': togglePause()');\r\n\r\n if (s.playState === 0) {\r\n s.play({\r\n position: (fV === 9 && !s.isHTML5 ? s.position : s.position / msecScale)\r\n });\r\n return s;\r\n }\r\n\r\n if (s.paused) {\r\n s.resume();\r\n } else {\r\n s.pause();\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the panning (L-R) effect.\r\n *\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(nPan, bInstanceOnly) {\r\n\r\n if (nPan === _undefined) {\r\n nPan = 0;\r\n }\r\n\r\n if (bInstanceOnly === _undefined) {\r\n bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n flash._setPan(s.id, nPan);\r\n } // else { no HTML5 pan? }\r\n\r\n s._iO.pan = nPan;\r\n\r\n if (!bInstanceOnly) {\r\n s.pan = nPan;\r\n s.options.pan = nPan;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the volume.\r\n *\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(nVol, _bInstanceOnly) {\r\n\r\n /**\r\n * Note: Setting volume has no effect on iOS \"special snowflake\" devices.\r\n * Hardware volume control overrides software, and volume\r\n * will always return 1 per Apple docs. (iOS 4 + 5.)\r\n * http://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/HTML-canvas-guide/AddingSoundtoCanvasAnimations/AddingSoundtoCanvasAnimations.html\r\n */\r\n\r\n if (nVol === _undefined) {\r\n nVol = 100;\r\n }\r\n\r\n if (_bInstanceOnly === _undefined) {\r\n _bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._setVolume(s.id, (sm2.muted && !s.muted) || s.muted ? 0 : nVol);\r\n\r\n } else if (s._a) {\r\n\r\n if (sm2.muted && !s.muted) {\r\n s.muted = true;\r\n s._a.muted = true;\r\n }\r\n\r\n // valid range for native HTML5 Audio(): 0-1\r\n s._a.volume = Math.max(0, Math.min(1, nVol / 100));\r\n\r\n }\r\n\r\n s._iO.volume = nVol;\r\n\r\n if (!_bInstanceOnly) {\r\n s.volume = nVol;\r\n s.options.volume = nVol;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Mutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.mute = function() {\r\n\r\n s.muted = true;\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, 0);\r\n } else if (s._a) {\r\n s._a.muted = true;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unmute = function() {\r\n\r\n s.muted = false;\r\n var hasIO = (s._iO.volume !== _undefined);\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, hasIO ? s._iO.volume : s.options.volume);\r\n } else if (s._a) {\r\n s._a.muted = false;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles the muted state of a sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function() {\r\n\r\n return (s.muted ? s.unmute() : s.mute());\r\n\r\n };\r\n\r\n /**\r\n * Registers a callback to be fired when a sound reaches a given position during playback.\r\n *\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(nPosition, oMethod, oScope) {\r\n\r\n // TODO: basic dupe checking?\r\n\r\n onPositionItems.push({\r\n position: parseInt(nPosition, 10),\r\n method: oMethod,\r\n scope: (oScope !== _undefined ? oScope : s),\r\n fired: false\r\n });\r\n\r\n return s;\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Removes registered callback(s) from a sound, by position and/or callback.\r\n *\r\n * @param {number} nPosition The position to clear callback(s) for\r\n * @param {function} oMethod Optional: Identify one callback to be removed when multiple listeners exist for one position\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(nPosition, oMethod) {\r\n\r\n var i;\r\n\r\n nPosition = parseInt(nPosition, 10);\r\n\r\n if (isNaN(nPosition)) {\r\n // safety check\r\n return;\r\n }\r\n\r\n for (i = 0; i < onPositionItems.length; i++) {\r\n\r\n if (nPosition === onPositionItems[i].position) {\r\n // remove this item if no method was specified, or, if the method matches\r\n\r\n if (!oMethod || (oMethod === onPositionItems[i].method)) {\r\n\r\n if (onPositionItems[i].fired) {\r\n // decrement \"fired\" counter, too\r\n onPositionFired--;\r\n }\r\n\r\n onPositionItems.splice(i, 1);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._processOnPosition = function() {\r\n\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j || !s.playState || onPositionFired >= j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (!item.fired && s.position >= item.position) {\r\n\r\n item.fired = true;\r\n onPositionFired++;\r\n item.method.apply(item.scope, [item.position]);\r\n\r\n // reset j -- onPositionItems.length can be changed in the item callback above... occasionally breaking the loop.\r\n j = onPositionItems.length;\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._resetOnPosition = function(nPosition) {\r\n\r\n // reset \"fired\" for items interested in this position\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (item.fired && nPosition <= item.position) {\r\n item.fired = false;\r\n onPositionFired--;\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * SMSound() private internals\r\n * --------------------------------\r\n */\r\n\r\n applyFromTo = function() {\r\n\r\n var instanceOptions = s._iO,\r\n f = instanceOptions.from,\r\n t = instanceOptions.to,\r\n start, end;\r\n\r\n end = function() {\r\n\r\n // end has been reached.\r\n sm2._wD(s.id + ': \"To\" time of ' + t + ' reached.');\r\n\r\n // detach listener\r\n s.clearOnPosition(t, end);\r\n\r\n // stop should clear this, too\r\n s.stop();\r\n\r\n };\r\n\r\n start = function() {\r\n\r\n sm2._wD(s.id + ': Playing \"from\" ' + f);\r\n\r\n // add listener for end\r\n if (t !== null && !isNaN(t)) {\r\n s.onPosition(t, end);\r\n }\r\n\r\n };\r\n\r\n if (f !== null && !isNaN(f)) {\r\n\r\n // apply to instance options, guaranteeing correct start position.\r\n instanceOptions.position = f;\r\n\r\n // multiShot timing can't be tracked, so prevent that.\r\n instanceOptions.multiShot = false;\r\n\r\n start();\r\n\r\n }\r\n\r\n // return updated instanceOptions including starting position\r\n return instanceOptions;\r\n\r\n };\r\n\r\n attachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // attach onposition things, if any, now.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.onPosition(parseInt(item, 10), op[item]);\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n detachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // detach any onposition()-style listeners.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.clearOnPosition(parseInt(item, 10));\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n start_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n startTimer(s);\r\n }\r\n\r\n };\r\n\r\n stop_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n stopTimer(s);\r\n }\r\n\r\n };\r\n\r\n resetProperties = function(retainPosition) {\r\n\r\n if (!retainPosition) {\r\n onPositionItems = [];\r\n onPositionFired = 0;\r\n }\r\n\r\n onplay_called = false;\r\n\r\n s._hasTimer = null;\r\n s._a = null;\r\n s._html5_canplay = false;\r\n s.bytesLoaded = null;\r\n s.bytesTotal = null;\r\n s.duration = (s._iO && s._iO.duration ? s._iO.duration : null);\r\n s.durationEstimate = null;\r\n s.buffered = [];\r\n\r\n // legacy: 1D array\r\n s.eqData = [];\r\n\r\n s.eqData.left = [];\r\n s.eqData.right = [];\r\n\r\n s.failures = 0;\r\n s.isBuffering = false;\r\n s.instanceOptions = {};\r\n s.instanceCount = 0;\r\n s.loaded = false;\r\n s.metadata = {};\r\n\r\n // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success\r\n s.readyState = 0;\r\n\r\n s.muted = false;\r\n s.paused = false;\r\n\r\n s.peakData = {\r\n left: 0,\r\n right: 0\r\n };\r\n\r\n s.waveformData = {\r\n left: [],\r\n right: []\r\n };\r\n\r\n s.playState = 0;\r\n s.position = null;\r\n\r\n s.id3 = {};\r\n\r\n };\r\n\r\n resetProperties();\r\n\r\n /**\r\n * Pseudo-private SMSound internals\r\n * --------------------------------\r\n */\r\n\r\n this._onTimer = function(bForce) {\r\n\r\n /**\r\n * HTML5-only _whileplaying() etc.\r\n * called from both HTML5 native events, and polling/interval-based timers\r\n * mimics flash and fires only when time/duration change, so as to be polling-friendly\r\n */\r\n\r\n var duration, isNew = false, time, x = {};\r\n\r\n if (s._hasTimer || bForce) {\r\n\r\n // TODO: May not need to track readyState (1 = loading)\r\n\r\n if (s._a && (bForce || ((s.playState > 0 || s.readyState === 1) && !s.paused))) {\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (duration !== lastHTML5State.duration) {\r\n\r\n lastHTML5State.duration = duration;\r\n s.duration = duration;\r\n isNew = true;\r\n\r\n }\r\n\r\n // TODO: investigate why this goes wack if not set/re-set each time.\r\n s.durationEstimate = s.duration;\r\n\r\n time = (s._a.currentTime * msecScale || 0);\r\n\r\n if (time !== lastHTML5State.time) {\r\n\r\n lastHTML5State.time = time;\r\n isNew = true;\r\n\r\n }\r\n\r\n if (isNew || bForce) {\r\n\r\n s._whileplaying(time, x, x, x, x);\r\n\r\n }\r\n\r\n }/* else {\r\n\r\n // sm2._wD('_onTimer: Warn for \"'+s.id+'\": '+(!s._a?'Could not find element. ':'')+(s.playState === 0?'playState bad, 0?':'playState = '+s.playState+', OK'));\r\n\r\n return false;\r\n\r\n }*/\r\n\r\n }\r\n\r\n return isNew;\r\n\r\n };\r\n\r\n this._get_html5_duration = function() {\r\n\r\n var instanceOptions = s._iO,\r\n // if audio object exists, use its duration - else, instance option duration (if provided - it's a hack, really, and should be retired) OR null\r\n d = (s._a && s._a.duration ? s._a.duration * msecScale : (instanceOptions && instanceOptions.duration ? instanceOptions.duration : null)),\r\n result = (d && !isNaN(d) && d !== Infinity ? d : null);\r\n\r\n return result;\r\n\r\n };\r\n\r\n this._apply_loop = function(a, nLoops) {\r\n\r\n /**\r\n * boolean instead of \"loop\", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop\r\n * note that loop is either off or infinite under HTML5, unlike Flash which allows arbitrary loop counts to be specified.\r\n */\r\n\r\n // <d>\r\n if (!a.loop && nLoops > 1) {\r\n sm2._wD('Note: Native HTML5 looping is infinite.', 1);\r\n }\r\n // </d>\r\n\r\n a.loop = (nLoops > 1 ? 'loop' : '');\r\n\r\n };\r\n\r\n this._setup_html5 = function(options) {\r\n\r\n var instanceOptions = mixin(s._iO, options),\r\n a = useGlobalHTML5Audio ? globalHTML5Audio : s._a,\r\n dURL = decodeURI(instanceOptions.url),\r\n sameURL;\r\n\r\n /**\r\n * \"First things first, I, Poppa...\" (reset the previous state of the old sound, if playing)\r\n * Fixes case with devices that can only play one sound at a time\r\n * Otherwise, other sounds in mid-play will be terminated without warning and in a stuck state\r\n */\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (dURL === decodeURI(lastGlobalHTML5URL)) {\r\n // global HTML5 audio: re-use of URL\r\n sameURL = true;\r\n }\r\n\r\n } else if (dURL === decodeURI(lastURL)) {\r\n\r\n // options URL is the same as the \"last\" URL, and we used (loaded) it\r\n sameURL = true;\r\n\r\n }\r\n\r\n if (a) {\r\n\r\n if (a._s) {\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (a._s && a._s.playState && !sameURL) {\r\n\r\n // global HTML5 audio case, and loading a new URL. stop the currently-playing one.\r\n a._s.stop();\r\n\r\n }\r\n\r\n } else if (!useGlobalHTML5Audio && dURL === decodeURI(lastURL)) {\r\n\r\n // non-global HTML5 reuse case: same url, ignore request\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n return a;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!sameURL) {\r\n\r\n // don't retain onPosition() stuff with new URLs.\r\n\r\n if (lastURL) {\r\n resetProperties(false);\r\n }\r\n\r\n // assign new HTML5 URL\r\n\r\n a.src = instanceOptions.url;\r\n\r\n s.url = instanceOptions.url;\r\n\r\n lastURL = instanceOptions.url;\r\n\r\n lastGlobalHTML5URL = instanceOptions.url;\r\n\r\n a._called_load = false;\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s._a = new Audio(instanceOptions.url);\r\n s._a.load();\r\n\r\n } else {\r\n\r\n // null for stupid Opera 9.64 case\r\n s._a = (isOpera && opera.version() < 10 ? new Audio(null) : new Audio());\r\n\r\n }\r\n\r\n // assign local reference\r\n a = s._a;\r\n\r\n a._called_load = false;\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n globalHTML5Audio = a;\r\n\r\n }\r\n\r\n }\r\n\r\n s.isHTML5 = true;\r\n\r\n // store a ref on the track\r\n s._a = a;\r\n\r\n // store a ref on the audio\r\n a._s = s;\r\n\r\n add_html5_events();\r\n\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s.load();\r\n\r\n } else {\r\n\r\n // early HTML5 implementation (non-standard)\r\n a.autobuffer = false;\r\n\r\n // standard ('none' is also an option.)\r\n a.preload = 'auto';\r\n\r\n }\r\n\r\n return a;\r\n\r\n };\r\n\r\n add_html5_events = function() {\r\n\r\n if (s._a._added_events) return false;\r\n\r\n var f;\r\n\r\n function add(oEvt, oFn, bCapture) {\r\n return s._a ? s._a.addEventListener(oEvt, oFn, bCapture || false) : null;\r\n }\r\n\r\n s._a._added_events = true;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n add(f, html5_events[f]);\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n remove_html5_events = function() {\r\n\r\n // Remove event listeners\r\n\r\n var f;\r\n\r\n function remove(oEvt, oFn, bCapture) {\r\n return (s._a ? s._a.removeEventListener(oEvt, oFn, bCapture || false) : null);\r\n }\r\n\r\n sm2._wD(s.id + ': Removing event listeners');\r\n s._a._added_events = false;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n remove(f, html5_events[f]);\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private event internals\r\n * ------------------------------\r\n */\r\n\r\n this._onload = function(nSuccess) {\r\n\r\n var fN,\r\n // check for duration to prevent false positives from flash 8 when loading from cache.\r\n loadOK = !!nSuccess || (!s.isHTML5 && fV === 8 && s.duration);\r\n\r\n // <d>\r\n fN = s.id + ': ';\r\n sm2._wD(fN + (loadOK ? 'onload()' : 'Failed to load / invalid sound?' + (!s.duration ? ' Zero-length duration reported.' : ' -') + ' (' + s.url + ')'), (loadOK ? 1 : 2));\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n if (sm2.sandbox.noRemote === true) {\r\n sm2._wD(fN + str('noNet'), 1);\r\n }\r\n if (sm2.sandbox.noLocal === true) {\r\n sm2._wD(fN + str('noLocal'), 1);\r\n }\r\n }\r\n // </d>\r\n\r\n s.loaded = loadOK;\r\n s.readyState = (loadOK ? 3 : 2);\r\n s._onbufferchange(0);\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n // note: no error code from Flash.\r\n s._onerror();\r\n }\r\n\r\n if (s._iO.onload) {\r\n wrapCallback(s, function() {\r\n s._iO.onload.apply(s, [loadOK]);\r\n });\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._onerror = function(errorCode, description) {\r\n\r\n // https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n if (s._iO.onerror) {\r\n wrapCallback(s, function() {\r\n s._iO.onerror.apply(s, [errorCode, description]);\r\n });\r\n }\r\n\r\n };\r\n\r\n this._onbufferchange = function(nIsBuffering) {\r\n\r\n // ignore if not playing\r\n if (s.playState === 0) return false;\r\n\r\n if ((nIsBuffering && s.isBuffering) || (!nIsBuffering && !s.isBuffering)) return false;\r\n\r\n s.isBuffering = (nIsBuffering === 1);\r\n\r\n if (s._iO.onbufferchange) {\r\n sm2._wD(s.id + ': Buffer state change: ' + nIsBuffering);\r\n s._iO.onbufferchange.apply(s, [nIsBuffering]);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Playback may have stopped due to buffering, or related reason.\r\n * This state can be encountered on iOS < 6 when auto-play is blocked.\r\n */\r\n\r\n this._onsuspend = function() {\r\n\r\n if (s._iO.onsuspend) {\r\n sm2._wD(s.id + ': Playback suspended');\r\n s._iO.onsuspend.apply(s);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method, should fire only once at most\r\n * at this point we just recreate failed sounds rather than trying to reconnect\r\n */\r\n\r\n this._onfailure = function(msg, level, code) {\r\n\r\n s.failures++;\r\n sm2._wD(s.id + ': Failure (' + s.failures + '): ' + msg);\r\n\r\n if (s._iO.onfailure && s.failures === 1) {\r\n s._iO.onfailure(msg, level, code);\r\n } else {\r\n sm2._wD(s.id + ': Ignoring failure');\r\n }\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method for unhandled warnings/exceptions from Flash\r\n * e.g., RTMP \"method missing\" warning (non-fatal) for getStreamLength on server\r\n */\r\n\r\n this._onwarning = function(msg, level, code) {\r\n\r\n if (s._iO.onwarning) {\r\n s._iO.onwarning(msg, level, code);\r\n }\r\n\r\n };\r\n\r\n this._onfinish = function() {\r\n\r\n // store local copy before it gets trashed...\r\n var io_onfinish = s._iO.onfinish;\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n\r\n // reset some state items\r\n if (s.instanceCount) {\r\n\r\n s.instanceCount--;\r\n\r\n if (!s.instanceCount) {\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // reset instance options\r\n s.playState = 0;\r\n s.paused = false;\r\n s.instanceCount = 0;\r\n s.instanceOptions = {};\r\n s._iO = {};\r\n stop_html5_timer();\r\n\r\n // reset position, too\r\n if (s.isHTML5) {\r\n s.position = 0;\r\n }\r\n\r\n }\r\n\r\n if (!s.instanceCount || s._iO.multiShotEvents) {\r\n // fire onfinish for last, or every instance\r\n if (io_onfinish) {\r\n sm2._wD(s.id + ': onfinish()');\r\n wrapCallback(s, function() {\r\n io_onfinish.apply(s);\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n s.bytesLoaded = nBytesLoaded;\r\n s.bytesTotal = nBytesTotal;\r\n s.duration = Math.floor(nDuration);\r\n s.bufferLength = nBufferLength;\r\n\r\n if (!s.isHTML5 && !instanceOptions.isMovieStar) {\r\n\r\n if (instanceOptions.duration) {\r\n // use duration from options, if specified and larger. nobody should be specifying duration in options, actually, and it should be retired.\r\n s.durationEstimate = (s.duration > instanceOptions.duration) ? s.duration : instanceOptions.duration;\r\n } else {\r\n s.durationEstimate = parseInt((s.bytesTotal / s.bytesLoaded) * s.duration, 10);\r\n }\r\n\r\n } else {\r\n\r\n s.durationEstimate = s.duration;\r\n\r\n }\r\n\r\n // for flash, reflect sequential-load-style buffering\r\n if (!s.isHTML5) {\r\n s.buffered = [{\r\n start: 0,\r\n end: s.duration\r\n }];\r\n }\r\n\r\n // allow whileloading to fire even if \"load\" fired under HTML5, due to HTTP range/partials\r\n if ((s.readyState !== 3 || s.isHTML5) && instanceOptions.whileloading) {\r\n instanceOptions.whileloading.apply(s);\r\n }\r\n\r\n };\r\n\r\n this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {\r\n\r\n var instanceOptions = s._iO,\r\n eqLeft;\r\n\r\n // flash safety net\r\n if (isNaN(nPosition) || nPosition === null) return false;\r\n\r\n // Safari HTML5 play() may return small -ve values when starting from position: 0, eg. -50.120396875. Unexpected/invalid per W3, I think. Normalize to 0.\r\n s.position = Math.max(0, nPosition);\r\n\r\n s._processOnPosition();\r\n\r\n if (!s.isHTML5 && fV > 8) {\r\n\r\n if (instanceOptions.usePeakData && oPeakData !== _undefined && oPeakData) {\r\n s.peakData = {\r\n left: oPeakData.leftPeak,\r\n right: oPeakData.rightPeak\r\n };\r\n }\r\n\r\n if (instanceOptions.useWaveformData && oWaveformDataLeft !== _undefined && oWaveformDataLeft) {\r\n s.waveformData = {\r\n left: oWaveformDataLeft.split(','),\r\n right: oWaveformDataRight.split(',')\r\n };\r\n }\r\n\r\n if (instanceOptions.useEQData) {\r\n if (oEQData !== _undefined && oEQData && oEQData.leftEQ) {\r\n eqLeft = oEQData.leftEQ.split(',');\r\n s.eqData = eqLeft;\r\n s.eqData.left = eqLeft;\r\n if (oEQData.rightEQ !== _undefined && oEQData.rightEQ) {\r\n s.eqData.right = oEQData.rightEQ.split(',');\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n if (s.playState === 1) {\r\n\r\n // special case/hack: ensure buffering is false if loading from cache (and not yet started)\r\n if (!s.isHTML5 && fV === 8 && !s.position && s.isBuffering) {\r\n s._onbufferchange(0);\r\n }\r\n\r\n if (instanceOptions.whileplaying) {\r\n // flash may call after actual finish\r\n instanceOptions.whileplaying.apply(s);\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._oncaptiondata = function(oData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n *\r\n * @param {object} oData\r\n */\r\n\r\n sm2._wD(s.id + ': Caption data received.');\r\n\r\n s.captiondata = oData;\r\n\r\n if (s._iO.oncaptiondata) {\r\n s._iO.oncaptiondata.apply(s, [oData]);\r\n }\r\n\r\n };\r\n\r\n this._onmetadata = function(oMDProps, oMDData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n * RTMP may include song title, MovieStar content may include encoding info\r\n *\r\n * @param {array} oMDProps (names)\r\n * @param {array} oMDData (values)\r\n */\r\n\r\n sm2._wD(s.id + ': Metadata received.');\r\n\r\n var oData = {}, i, j;\r\n\r\n for (i = 0, j = oMDProps.length; i < j; i++) {\r\n oData[oMDProps[i]] = oMDData[i];\r\n }\r\n\r\n s.metadata = oData;\r\n\r\n if (s._iO.onmetadata) {\r\n s._iO.onmetadata.call(s, s.metadata);\r\n }\r\n\r\n };\r\n\r\n this._onid3 = function(oID3Props, oID3Data) {\r\n\r\n /**\r\n * internal: flash 8 + flash 9 ID3 feature\r\n * may include artist, song title etc.\r\n *\r\n * @param {array} oID3Props (names)\r\n * @param {array} oID3Data (values)\r\n */\r\n\r\n sm2._wD(s.id + ': ID3 data received.');\r\n\r\n var oData = [], i, j;\r\n\r\n for (i = 0, j = oID3Props.length; i < j; i++) {\r\n oData[oID3Props[i]] = oID3Data[i];\r\n }\r\n\r\n s.id3 = mixin(s.id3, oData);\r\n\r\n if (s._iO.onid3) {\r\n s._iO.onid3.apply(s);\r\n }\r\n\r\n };\r\n\r\n // flash/RTMP-only\r\n\r\n this._onconnect = function(bSuccess) {\r\n\r\n bSuccess = (bSuccess === 1);\r\n sm2._wD(s.id + ': ' + (bSuccess ? 'Connected.' : 'Failed to connect? - ' + s.url), (bSuccess ? 1 : 2));\r\n s.connected = bSuccess;\r\n\r\n if (bSuccess) {\r\n\r\n s.failures = 0;\r\n\r\n if (idCheck(s.id)) {\r\n if (s.getAutoPlay()) {\r\n // only update the play state if auto playing\r\n s.play(_undefined, s.getAutoPlay());\r\n } else if (s._iO.autoLoad) {\r\n s.load();\r\n }\r\n }\r\n\r\n if (s._iO.onconnect) {\r\n s._iO.onconnect.apply(s, [bSuccess]);\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._ondataerror = function(sError) {\r\n\r\n // flash 9 wave/eq data handler\r\n // hack: called at start, and end from flash at/after onfinish()\r\n if (s.playState > 0) {\r\n sm2._wD(s.id + ': Data error: ' + sError);\r\n if (s._iO.ondataerror) {\r\n s._iO.ondataerror.apply(s);\r\n }\r\n }\r\n\r\n };\r\n\r\n // <d>\r\n this._debug();\r\n // </d>\r\n\r\n }; // SMSound()\r\n\r\n /**\r\n * Private SoundManager internals\r\n * ------------------------------\r\n */\r\n\r\n getDocument = function() {\r\n\r\n return (doc.body || doc.getElementsByTagName('div')[0]);\r\n\r\n };\r\n\r\n id = function(sID) {\r\n\r\n return doc.getElementById(sID);\r\n\r\n };\r\n\r\n mixin = function(oMain, oAdd) {\r\n\r\n // non-destructive merge\r\n var o1 = (oMain || {}), o2, o;\r\n\r\n // if unspecified, o2 is the default options object\r\n o2 = (oAdd === _undefined ? sm2.defaultOptions : oAdd);\r\n\r\n for (o in o2) {\r\n\r\n if (o2.hasOwnProperty(o) && o1[o] === _undefined) {\r\n\r\n if (typeof o2[o] !== 'object' || o2[o] === null) {\r\n\r\n // assign directly\r\n o1[o] = o2[o];\r\n\r\n } else {\r\n\r\n // recurse through o2\r\n o1[o] = mixin(o1[o], o2[o]);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return o1;\r\n\r\n };\r\n\r\n wrapCallback = function(oSound, callback) {\r\n\r\n /**\r\n * 03/03/2013: Fix for Flash Player 11.6.602.171 + Flash 8 (flashVersion = 8) SWF issue\r\n * setTimeout() fix for certain SMSound callbacks like onload() and onfinish(), where subsequent calls like play() and load() fail when Flash Player 11.6.602.171 is installed, and using soundManager with flashVersion = 8 (which is the default).\r\n * Not sure of exact cause. Suspect race condition and/or invalid (NaN-style) position argument trickling down to the next JS -> Flash _start() call, in the play() case.\r\n * Fix: setTimeout() to yield, plus safer null / NaN checking on position argument provided to Flash.\r\n * https://getsatisfaction.com/schillmania/topics/recent_chrome_update_seems_to_have_broken_my_sm2_audio_player\r\n */\r\n if (!oSound.isHTML5 && fV === 8) {\r\n window.setTimeout(callback, 0);\r\n } else {\r\n callback();\r\n }\r\n\r\n };\r\n\r\n // additional soundManager properties that soundManager.setup() will accept\r\n\r\n extraOptions = {\r\n onready: 1,\r\n ontimeout: 1,\r\n defaultOptions: 1,\r\n flash9Options: 1,\r\n movieStarOptions: 1\r\n };\r\n\r\n assign = function(o, oParent) {\r\n\r\n /**\r\n * recursive assignment of properties, soundManager.setup() helper\r\n * allows property assignment based on whitelist\r\n */\r\n\r\n var i,\r\n result = true,\r\n hasParent = (oParent !== _undefined),\r\n setupOptions = sm2.setupOptions,\r\n bonusOptions = extraOptions;\r\n\r\n // <d>\r\n\r\n // if soundManager.setup() called, show accepted parameters.\r\n\r\n if (o === _undefined) {\r\n\r\n result = [];\r\n\r\n for (i in setupOptions) {\r\n\r\n if (setupOptions.hasOwnProperty(i)) {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n for (i in bonusOptions) {\r\n\r\n if (bonusOptions.hasOwnProperty(i)) {\r\n\r\n if (typeof sm2[i] === 'object') {\r\n result.push(i + ': {...}');\r\n } else if (sm2[i] instanceof Function) {\r\n result.push(i + ': function() {...}');\r\n } else {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n sm2._wD(str('setup', result.join(', ')));\r\n\r\n return false;\r\n\r\n }\r\n\r\n // </d>\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // if not an {object} we want to recurse through...\r\n\r\n if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array || o[i] instanceof RegExp) {\r\n\r\n // check \"allowed\" options\r\n\r\n if (hasParent && bonusOptions[oParent] !== _undefined) {\r\n\r\n // valid recursive / nested object option, eg., { defaultOptions: { volume: 50 } }\r\n sm2[oParent][i] = o[i];\r\n\r\n } else if (setupOptions[i] !== _undefined) {\r\n\r\n // special case: assign to setupOptions object, which soundManager property references\r\n sm2.setupOptions[i] = o[i];\r\n\r\n // assign directly to soundManager, too\r\n sm2[i] = o[i];\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else if (sm2[i] instanceof Function) {\r\n\r\n /**\r\n * valid extraOptions (bonusOptions) parameter.\r\n * is it a method, like onready/ontimeout? call it.\r\n * multiple parameters should be in an array, eg. soundManager.setup({onready: [myHandler, myScope]});\r\n */\r\n sm2[i].apply(sm2, (o[i] instanceof Array ? o[i] : [o[i]]));\r\n\r\n } else {\r\n\r\n // good old-fashioned direct assignment\r\n sm2[i] = o[i];\r\n\r\n }\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // recursion case, eg., { defaultOptions: { ... } }\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // recurse through object\r\n return assign(o[i], i);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n function preferFlashCheck(kind) {\r\n\r\n // whether flash should play a given type\r\n return (sm2.preferFlash && hasFlash && !sm2.ignoreFlash && (sm2.flash[kind] !== _undefined && sm2.flash[kind]));\r\n\r\n }\r\n\r\n /**\r\n * Internal DOM2-level event helpers\r\n * ---------------------------------\r\n */\r\n\r\n event = (function() {\r\n\r\n // normalize event methods\r\n var old = (window.attachEvent),\r\n evt = {\r\n add: (old ? 'attachEvent' : 'addEventListener'),\r\n remove: (old ? 'detachEvent' : 'removeEventListener')\r\n };\r\n\r\n // normalize \"on\" event prefix, optional capture argument\r\n function getArgs(oArgs) {\r\n\r\n var args = slice.call(oArgs),\r\n len = args.length;\r\n\r\n if (old) {\r\n // prefix\r\n args[1] = 'on' + args[1];\r\n if (len > 3) {\r\n // no capture\r\n args.pop();\r\n }\r\n } else if (len === 3) {\r\n args.push(false);\r\n }\r\n\r\n return args;\r\n\r\n }\r\n\r\n function apply(args, sType) {\r\n\r\n // normalize and call the event method, with the proper arguments\r\n var element = args.shift(),\r\n method = [evt[sType]];\r\n\r\n if (old) {\r\n // old IE can't do apply().\r\n element[method](args[0], args[1]);\r\n } else {\r\n element[method].apply(element, args);\r\n }\r\n\r\n }\r\n\r\n function add() {\r\n apply(getArgs(arguments), 'add');\r\n }\r\n\r\n function remove() {\r\n apply(getArgs(arguments), 'remove');\r\n }\r\n\r\n return {\r\n add: add,\r\n remove: remove\r\n };\r\n\r\n }());\r\n\r\n /**\r\n * Internal HTML5 event handling\r\n * -----------------------------\r\n */\r\n\r\n function html5_event(oFn) {\r\n\r\n // wrap html5 event handlers so we don't call them on destroyed and/or unloaded sounds\r\n\r\n return function(e) {\r\n\r\n var s = this._s,\r\n result;\r\n\r\n if (!s || !s._a) {\r\n // <d>\r\n if (s && s.id) {\r\n sm2._wD(s.id + ': Ignoring ' + e.type);\r\n } else {\r\n sm2._wD(h5 + 'Ignoring ' + e.type);\r\n }\r\n // </d>\r\n result = null;\r\n } else {\r\n result = oFn.call(this, e);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n }\r\n\r\n html5_events = {\r\n\r\n // HTML5 event-name-to-handler map\r\n\r\n abort: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': abort');\r\n\r\n }),\r\n\r\n // enough has loaded to play\r\n\r\n canplay: html5_event(function() {\r\n\r\n var s = this._s,\r\n position1K;\r\n\r\n if (s._html5_canplay) {\r\n // this event has already fired. ignore.\r\n return;\r\n }\r\n\r\n s._html5_canplay = true;\r\n sm2._wD(s.id + ': canplay');\r\n s._onbufferchange(0);\r\n\r\n // position according to instance options\r\n position1K = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position / msecScale : null);\r\n\r\n // set the position if position was provided before the sound loaded\r\n if (this.currentTime !== position1K) {\r\n sm2._wD(s.id + ': canplay: Setting position to ' + position1K);\r\n try {\r\n this.currentTime = position1K;\r\n } catch(ee) {\r\n sm2._wD(s.id + ': canplay: Setting position of ' + position1K + ' failed: ' + ee.message, 2);\r\n }\r\n }\r\n\r\n // hack for HTML5 from/to case\r\n if (s._iO._oncanplay) {\r\n s._iO._oncanplay();\r\n }\r\n\r\n }),\r\n\r\n canplaythrough: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n if (!s.loaded) {\r\n s._onbufferchange(0);\r\n s._whileloading(s.bytesLoaded, s.bytesTotal, s._get_html5_duration());\r\n s._onload(true);\r\n }\r\n\r\n }),\r\n\r\n durationchange: html5_event(function() {\r\n\r\n // durationchange may fire at various times, probably the safest way to capture accurate/final duration.\r\n\r\n var s = this._s,\r\n duration;\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (!isNaN(duration) && duration !== s.duration) {\r\n\r\n sm2._wD(this._s.id + ': durationchange (' + duration + ')' + (s.duration ? ', previously ' + s.duration : ''));\r\n\r\n s.durationEstimate = s.duration = duration;\r\n\r\n }\r\n\r\n }),\r\n\r\n // TODO: Reserved for potential use\r\n /*\r\n emptied: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': emptied');\r\n\r\n }),\r\n */\r\n\r\n ended: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': ended');\r\n\r\n s._onfinish();\r\n\r\n }),\r\n\r\n error: html5_event(function() {\r\n\r\n var description = (html5ErrorCodes[this.error.code] || null);\r\n sm2._wD(this._s.id + ': HTML5 error, code ' + this.error.code + (description ? ' (' + description + ')' : ''));\r\n this._s._onload(false);\r\n this._s._onerror(this.error.code, description);\r\n\r\n }),\r\n\r\n loadeddata: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': loadeddata');\r\n\r\n // safari seems to nicely report progress events, eventually totalling 100%\r\n if (!s._loaded && !isSafari) {\r\n s.duration = s._get_html5_duration();\r\n }\r\n\r\n }),\r\n\r\n loadedmetadata: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadedmetadata');\r\n\r\n }),\r\n\r\n loadstart: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadstart');\r\n // assume buffering at first\r\n this._s._onbufferchange(1);\r\n\r\n }),\r\n\r\n play: html5_event(function() {\r\n\r\n // sm2._wD(this._s.id + ': play()');\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n playing: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': playing ' + String.fromCharCode(9835));\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n progress: html5_event(function(e) {\r\n\r\n // note: can fire repeatedly after \"loaded\" event, due to use of HTTP range/partials\r\n\r\n var s = this._s,\r\n i, j, progStr, buffered = 0,\r\n isProgress = (e.type === 'progress'),\r\n ranges = e.target.buffered,\r\n // firefox 3.6 implements e.loaded/total (bytes)\r\n loaded = (e.loaded || 0),\r\n total = (e.total || 1);\r\n\r\n // reset the \"buffered\" (loaded byte ranges) array\r\n s.buffered = [];\r\n\r\n if (ranges && ranges.length) {\r\n\r\n // if loaded is 0, try TimeRanges implementation as % of load\r\n // https://developer.mozilla.org/en/DOM/TimeRanges\r\n\r\n // re-build \"buffered\" array\r\n // HTML5 returns seconds. SM2 API uses msec for setPosition() etc., whether Flash or HTML5.\r\n for (i = 0, j = ranges.length; i < j; i++) {\r\n s.buffered.push({\r\n start: ranges.start(i) * msecScale,\r\n end: ranges.end(i) * msecScale\r\n });\r\n }\r\n\r\n // use the last value locally\r\n buffered = (ranges.end(0) - ranges.start(0)) * msecScale;\r\n\r\n // linear case, buffer sum; does not account for seeking and HTTP partials / byte ranges\r\n loaded = Math.min(1, buffered / (e.target.duration * msecScale));\r\n\r\n // <d>\r\n if (isProgress && ranges.length > 1) {\r\n progStr = [];\r\n j = ranges.length;\r\n for (i = 0; i < j; i++) {\r\n progStr.push((e.target.buffered.start(i) * msecScale) + '-' + (e.target.buffered.end(i) * msecScale));\r\n }\r\n sm2._wD(this._s.id + ': progress, timeRanges: ' + progStr.join(', '));\r\n }\r\n\r\n if (isProgress && !isNaN(loaded)) {\r\n sm2._wD(this._s.id + ': progress, ' + Math.floor(loaded * 100) + '% loaded');\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (!isNaN(loaded)) {\r\n\r\n // TODO: prevent calls with duplicate values.\r\n s._whileloading(loaded, total, s._get_html5_duration());\r\n if (loaded && total && loaded === total) {\r\n // in case \"onload\" doesn't fire (eg. gecko 1.9.2)\r\n html5_events.canplaythrough.call(this, e);\r\n }\r\n\r\n }\r\n\r\n }),\r\n\r\n ratechange: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': ratechange');\r\n\r\n }),\r\n\r\n suspend: html5_event(function(e) {\r\n\r\n // download paused/stopped, may have finished (eg. onload)\r\n var s = this._s;\r\n\r\n sm2._wD(this._s.id + ': suspend');\r\n html5_events.progress.call(this, e);\r\n s._onsuspend();\r\n\r\n }),\r\n\r\n stalled: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': stalled');\r\n\r\n }),\r\n\r\n timeupdate: html5_event(function() {\r\n\r\n this._s._onTimer();\r\n\r\n }),\r\n\r\n waiting: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n // see also: seeking\r\n sm2._wD(this._s.id + ': waiting');\r\n\r\n // playback faster than download rate, etc.\r\n s._onbufferchange(1);\r\n\r\n })\r\n\r\n };\r\n\r\n html5OK = function(iO) {\r\n\r\n // playability test based on URL or MIME type\r\n\r\n var result;\r\n\r\n if (!iO || (!iO.type && !iO.url && !iO.serverURL)) {\r\n\r\n // nothing to check\r\n result = false;\r\n\r\n } else if (iO.serverURL || (iO.type && preferFlashCheck(iO.type))) {\r\n\r\n // RTMP, or preferring flash\r\n result = false;\r\n\r\n } else {\r\n\r\n // Use type, if specified. Pass data: URIs to HTML5. If HTML5-only mode, no other options, so just give 'er\r\n result = ((iO.type ? html5CanPlay({ type: iO.type }) : html5CanPlay({ url: iO.url }) || sm2.html5Only || iO.url.match(/data:/i)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n html5Unload = function(oAudio) {\r\n\r\n /**\r\n * Internal method: Unload media, and cancel any current/pending network requests.\r\n * Firefox can load an empty URL, which allegedly destroys the decoder and stops the download.\r\n * https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Stopping_the_download_of_media\r\n * However, Firefox has been seen loading a relative URL from '' and thus requesting the hosting page on unload.\r\n * Other UA behaviour is unclear, so everyone else gets an about:blank-style URL.\r\n */\r\n\r\n var url;\r\n\r\n if (oAudio) {\r\n\r\n // Firefox and Chrome accept short WAVe data: URIs. Chome dislikes audio/wav, but accepts audio/wav for data: MIME.\r\n // Desktop Safari complains / fails on data: URI, so it gets about:blank.\r\n url = (isSafari ? emptyURL : (sm2.html5.canPlayType('audio/wav') ? emptyWAV : emptyURL));\r\n\r\n oAudio.src = url;\r\n\r\n // reset some state, too\r\n if (oAudio._called_unload !== _undefined) {\r\n oAudio._called_load = false;\r\n }\r\n\r\n }\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n // ensure URL state is trashed, also\r\n lastGlobalHTML5URL = null;\r\n\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n html5CanPlay = function(o) {\r\n\r\n /**\r\n * Try to find MIME, test and return truthiness\r\n * o = {\r\n * url: '/path/to/an.mp3',\r\n * type: 'audio/mp3'\r\n * }\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) return false;\r\n\r\n var url = (o.url || null),\r\n mime = (o.type || null),\r\n aF = sm2.audioFormats,\r\n result,\r\n offset,\r\n fileExt,\r\n item;\r\n\r\n // account for known cases like audio/mp3\r\n\r\n if (mime && sm2.html5[mime] !== _undefined) return (sm2.html5[mime] && !preferFlashCheck(mime));\r\n\r\n if (!html5Ext) {\r\n\r\n html5Ext = [];\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n html5Ext.push(item);\r\n\r\n if (aF[item].related) {\r\n html5Ext = html5Ext.concat(aF[item].related);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n html5Ext = new RegExp('\\\\.(' + html5Ext.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n }\r\n\r\n // TODO: Strip URL queries, etc.\r\n fileExt = (url ? url.toLowerCase().match(html5Ext) : null);\r\n\r\n if (!fileExt || !fileExt.length) {\r\n\r\n if (!mime) {\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // audio/mp3 -> mp3, result should be known\r\n offset = mime.indexOf(';');\r\n\r\n // strip \"audio/X; codecs...\"\r\n fileExt = (offset !== -1 ? mime.substr(0, offset) : mime).substr(6);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // match the raw extension name - \"mp3\", for example\r\n fileExt = fileExt[1];\r\n\r\n }\r\n\r\n if (fileExt && sm2.html5[fileExt] !== _undefined) {\r\n\r\n // result known\r\n result = (sm2.html5[fileExt] && !preferFlashCheck(fileExt));\r\n\r\n } else {\r\n\r\n mime = 'audio/' + fileExt;\r\n result = sm2.html5.canPlayType({ type: mime });\r\n\r\n sm2.html5[fileExt] = result;\r\n\r\n // sm2._wD('canPlayType, found result: ' + result);\r\n result = (result && sm2.html5[mime] && !preferFlashCheck(mime));\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n testHTML5 = function() {\r\n\r\n /**\r\n * Internal: Iterates over audioFormats, determining support eg. audio/mp3, audio/mpeg and so on\r\n * assigns results to html5[] and flash[].\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) {\r\n\r\n // without HTML5, we need Flash.\r\n sm2.html5.usingFlash = true;\r\n needsFlash = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // double-whammy: Opera 9.64 throws WRONG_ARGUMENTS_ERR if no parameter passed to Audio(), and Webkit + iOS happily tries to load \"null\" as a URL. :/\r\n var a = (Audio !== _undefined ? (isOpera && opera.version() < 10 ? new Audio(null) : new Audio()) : null),\r\n item, lookup, support = {}, aF, i;\r\n\r\n function cp(m) {\r\n\r\n var canPlay, j,\r\n result = false,\r\n isOK = false;\r\n\r\n if (!a || typeof a.canPlayType !== 'function') return result;\r\n\r\n if (m instanceof Array) {\r\n\r\n // iterate through all mime types, return any successes\r\n\r\n for (i = 0, j = m.length; i < j; i++) {\r\n\r\n if (sm2.html5[m[i]] || a.canPlayType(m[i]).match(sm2.html5Test)) {\r\n\r\n isOK = true;\r\n sm2.html5[m[i]] = true;\r\n\r\n // note flash support, too\r\n sm2.flash[m[i]] = !!(m[i].match(flashMIME));\r\n\r\n }\r\n\r\n }\r\n\r\n result = isOK;\r\n\r\n } else {\r\n\r\n canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);\r\n result = !!(canPlay && (canPlay.match(sm2.html5Test)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n }\r\n\r\n // test all registered formats + codecs\r\n\r\n aF = sm2.audioFormats;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n lookup = 'audio/' + item;\r\n\r\n support[item] = cp(aF[item].type);\r\n\r\n // write back generic type too, eg. audio/mp3\r\n support[lookup] = support[item];\r\n\r\n // assign flash\r\n if (item.match(flashMIME)) {\r\n\r\n sm2.flash[item] = true;\r\n sm2.flash[lookup] = true;\r\n\r\n } else {\r\n\r\n sm2.flash[item] = false;\r\n sm2.flash[lookup] = false;\r\n\r\n }\r\n\r\n // assign result to related formats, too\r\n\r\n if (aF[item] && aF[item].related) {\r\n\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n\r\n // eg. audio/m4a\r\n support['audio/' + aF[item].related[i]] = support[item];\r\n sm2.html5[aF[item].related[i]] = support[item];\r\n sm2.flash[aF[item].related[i]] = support[item];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n support.canPlayType = (a ? cp : null);\r\n sm2.html5 = mixin(sm2.html5, support);\r\n\r\n sm2.html5.usingFlash = featureCheck();\r\n needsFlash = sm2.html5.usingFlash;\r\n\r\n return true;\r\n\r\n };\r\n\r\n strings = {\r\n\r\n // <d>\r\n notReady: 'Unavailable - wait until onready() has fired.',\r\n notOK: 'Audio support is not available.',\r\n domError: sm + 'exception caught while appending SWF to DOM.',\r\n spcWmode: 'Removing wmode, preventing known SWF loading issue(s)',\r\n swf404: smc + 'Verify that %s is a valid path.',\r\n tryDebug: 'Try ' + sm + '.debugFlash = true for more security details (output goes to SWF.)',\r\n checkSWF: 'See SWF output for more debug info.',\r\n localFail: smc + 'Non-HTTP page (' + doc.location.protocol + ' URL?) Review Flash player security settings for this special case:\\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/',\r\n waitFocus: smc + 'Special case: Waiting for SWF to load with window focus...',\r\n waitForever: smc + 'Waiting indefinitely for Flash (will recover if unblocked)...',\r\n waitSWF: smc + 'Waiting for 100% SWF load...',\r\n needFunction: smc + 'Function object expected for %s',\r\n badID: 'Sound ID \"%s\" should be a string, starting with a non-numeric character',\r\n currentObj: smc + '_debug(): Current sound objects',\r\n waitOnload: smc + 'Waiting for window.onload()',\r\n docLoaded: smc + 'Document already loaded',\r\n onload: smc + 'initComplete(): calling soundManager.onload()',\r\n onloadOK: sm + '.onload() complete',\r\n didInit: smc + 'init(): Already called?',\r\n secNote: 'Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html',\r\n badRemove: smc + 'Failed to remove Flash node.',\r\n shutdown: sm + '.disable(): Shutting down',\r\n queue: smc + 'Queueing %s handler',\r\n smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.',\r\n fbTimeout: 'No flash response, applying .' + swfCSS.swfTimedout + ' CSS...',\r\n fbLoaded: 'Flash loaded',\r\n fbHandler: smc + 'flashBlockHandler()',\r\n manURL: 'SMSound.load(): Using manually-assigned URL',\r\n onURL: sm + '.load(): current URL already assigned.',\r\n badFV: sm + '.flashVersion must be 8 or 9. \"%s\" is invalid. Reverting to %s.',\r\n as2loop: 'Note: Setting stream:false so looping can work (flash 8 limitation)',\r\n noNSLoop: 'Note: Looping not implemented for MovieStar formats',\r\n needfl9: 'Note: Switching to flash 9, required for MP4 formats.',\r\n mfTimeout: 'Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case',\r\n needFlash: smc + 'Fatal error: Flash is needed to play some required formats, but is not available.',\r\n gotFocus: smc + 'Got window focus.',\r\n policy: 'Enabling usePolicyFile for data access',\r\n setup: sm + '.setup(): allowed parameters: %s',\r\n setupError: sm + '.setup(): \"%s\" cannot be assigned with this method.',\r\n setupUndef: sm + '.setup(): Could not find option \"%s\"',\r\n setupLate: sm + '.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().',\r\n noURL: smc + 'Flash URL required. Call soundManager.setup({url:...}) to get started.',\r\n sm2Loaded: 'SoundManager 2: Ready. ' + String.fromCharCode(10003),\r\n reset: sm + '.reset(): Removing event callbacks',\r\n mobileUA: 'Mobile UA detected, preferring HTML5 by default.',\r\n globalHTML5: 'Using singleton HTML5 Audio() pattern for this device.',\r\n ignoreMobile: 'Ignoring mobile restrictions for this device.'\r\n // </d>\r\n\r\n };\r\n\r\n str = function() {\r\n\r\n // internal string replace helper.\r\n // arguments: o [,items to replace]\r\n // <d>\r\n\r\n var args,\r\n i, j, o,\r\n sstr;\r\n\r\n // real array, please\r\n args = slice.call(arguments);\r\n\r\n // first argument\r\n o = args.shift();\r\n\r\n sstr = (strings && strings[o] ? strings[o] : '');\r\n\r\n if (sstr && args && args.length) {\r\n for (i = 0, j = args.length; i < j; i++) {\r\n sstr = sstr.replace('%s', args[i]);\r\n }\r\n }\r\n\r\n return sstr;\r\n // </d>\r\n\r\n };\r\n\r\n loopFix = function(sOpt) {\r\n\r\n // flash 8 requires stream = false for looping to work\r\n if (fV === 8 && sOpt.loops > 1 && sOpt.stream) {\r\n _wDS('as2loop');\r\n sOpt.stream = false;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n policyFix = function(sOpt, sPre) {\r\n\r\n if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) {\r\n sm2._wD((sPre || '') + str('policy'));\r\n sOpt.usePolicyFile = true;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n complain = function(sMsg) {\r\n\r\n // <d>\r\n if (hasConsole && console.warn !== _undefined) {\r\n console.warn(sMsg);\r\n } else {\r\n sm2._wD(sMsg);\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n doNothing = function() {\r\n\r\n return false;\r\n\r\n };\r\n\r\n disableObject = function(o) {\r\n\r\n var oProp;\r\n\r\n for (oProp in o) {\r\n if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') {\r\n o[oProp] = doNothing;\r\n }\r\n }\r\n\r\n oProp = null;\r\n\r\n };\r\n\r\n failSafely = function(bNoDisable) {\r\n\r\n // general failure exception handler\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n if (disabled || bNoDisable) {\r\n sm2.disable(bNoDisable);\r\n }\r\n\r\n };\r\n\r\n normalizeMovieURL = function(movieURL) {\r\n\r\n var urlParams = null, url;\r\n\r\n if (movieURL) {\r\n\r\n if (movieURL.match(/\\.swf(\\?.*)?$/i)) {\r\n\r\n urlParams = movieURL.substr(movieURL.toLowerCase().lastIndexOf('.swf?') + 4);\r\n\r\n // assume user knows what they're doing\r\n if (urlParams) return movieURL;\r\n\r\n } else if (movieURL.lastIndexOf('/') !== movieURL.length - 1) {\r\n\r\n // append trailing slash, if needed\r\n movieURL += '/';\r\n\r\n }\r\n\r\n }\r\n\r\n url = (movieURL && movieURL.lastIndexOf('/') !== -1 ? movieURL.substr(0, movieURL.lastIndexOf('/') + 1) : './') + sm2.movieURL;\r\n\r\n if (sm2.noSWFCache) {\r\n url += ('?ts=' + new Date().getTime());\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n setVersionInfo = function() {\r\n\r\n // short-hand for internal use\r\n\r\n fV = parseInt(sm2.flashVersion, 10);\r\n\r\n if (fV !== 8 && fV !== 9) {\r\n sm2._wD(str('badFV', fV, defaultFlashVersion));\r\n sm2.flashVersion = fV = defaultFlashVersion;\r\n }\r\n\r\n // debug flash movie, if applicable\r\n\r\n var isDebug = (sm2.debugMode || sm2.debugFlash ? '_debug.swf' : '.swf');\r\n\r\n if (sm2.useHTML5Audio && !sm2.html5Only && sm2.audioFormats.mp4.required && fV < 9) {\r\n sm2._wD(str('needfl9'));\r\n sm2.flashVersion = fV = 9;\r\n }\r\n\r\n sm2.version = sm2.versionNumber + (sm2.html5Only ? ' (HTML5-only mode)' : (fV === 9 ? ' (AS3/Flash 9)' : ' (AS2/Flash 8)'));\r\n\r\n // set up default options\r\n if (fV > 8) {\r\n\r\n // +flash 9 base options\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.flash9Options);\r\n sm2.features.buffering = true;\r\n\r\n // +moviestar support\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.movieStarOptions);\r\n sm2.filePatterns.flash9 = new RegExp('\\\\.(mp3|' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n sm2.features.movieStar = true;\r\n\r\n } else {\r\n\r\n sm2.features.movieStar = false;\r\n\r\n }\r\n\r\n // regExp for flash canPlay(), etc.\r\n sm2.filePattern = sm2.filePatterns[(fV !== 8 ? 'flash9' : 'flash8')];\r\n\r\n // if applicable, use _debug versions of SWFs\r\n sm2.movieURL = (fV === 8 ? 'soundmanager2.swf' : 'soundmanager2_flash9.swf').replace('.swf', isDebug);\r\n\r\n sm2.features.peakData = sm2.features.waveformData = sm2.features.eqData = (fV > 8);\r\n\r\n };\r\n\r\n setPolling = function(bPolling, bHighPerformance) {\r\n\r\n if (!flash) {\r\n return;\r\n }\r\n\r\n flash._setPolling(bPolling, bHighPerformance);\r\n\r\n };\r\n\r\n initDebug = function() {\r\n\r\n // starts debug mode, creating output <div> for UAs without console object\r\n\r\n // allow force of debug mode via URL\r\n // <d>\r\n if (sm2.debugURLParam.test(wl)) {\r\n sm2.setupOptions.debugMode = sm2.debugMode = true;\r\n }\r\n\r\n if (id(sm2.debugID)) {\r\n return;\r\n }\r\n\r\n var oD, oDebug, oTarget, oToggle, tmp;\r\n\r\n if (sm2.debugMode && !id(sm2.debugID) && (!hasConsole || !sm2.useConsole || !sm2.consoleOnly)) {\r\n\r\n oD = doc.createElement('div');\r\n oD.id = sm2.debugID + '-toggle';\r\n\r\n oToggle = {\r\n position: 'fixed',\r\n bottom: '0px',\r\n right: '0px',\r\n width: '1.2em',\r\n height: '1.2em',\r\n lineHeight: '1.2em',\r\n margin: '2px',\r\n textAlign: 'center',\r\n border: '1px solid #999',\r\n cursor: 'pointer',\r\n background: '#fff',\r\n color: '#333',\r\n zIndex: 10001\r\n };\r\n\r\n oD.appendChild(doc.createTextNode('-'));\r\n oD.onclick = toggleDebug;\r\n oD.title = 'Toggle SM2 debug console';\r\n\r\n if (ua.match(/msie 6/i)) {\r\n oD.style.position = 'absolute';\r\n oD.style.cursor = 'hand';\r\n }\r\n\r\n for (tmp in oToggle) {\r\n if (oToggle.hasOwnProperty(tmp)) {\r\n oD.style[tmp] = oToggle[tmp];\r\n }\r\n }\r\n\r\n oDebug = doc.createElement('div');\r\n oDebug.id = sm2.debugID;\r\n oDebug.style.display = (sm2.debugMode ? 'block' : 'none');\r\n\r\n if (sm2.debugMode && !id(oD.id)) {\r\n try {\r\n oTarget = getDocument();\r\n oTarget.appendChild(oD);\r\n } catch(e2) {\r\n throw new Error(str('domError') + ' \\n' + e2.toString());\r\n }\r\n oTarget.appendChild(oDebug);\r\n }\r\n\r\n }\r\n\r\n oTarget = null;\r\n // </d>\r\n\r\n };\r\n\r\n idCheck = this.getSoundById;\r\n\r\n // <d>\r\n _wDS = function(o, errorLevel) {\r\n\r\n return (!o ? '' : sm2._wD(str(o), errorLevel));\r\n\r\n };\r\n\r\n toggleDebug = function() {\r\n\r\n var o = id(sm2.debugID),\r\n oT = id(sm2.debugID + '-toggle');\r\n\r\n if (!o) {\r\n return;\r\n }\r\n\r\n if (debugOpen) {\r\n // minimize\r\n oT.innerHTML = '+';\r\n o.style.display = 'none';\r\n } else {\r\n oT.innerHTML = '-';\r\n o.style.display = 'block';\r\n }\r\n\r\n debugOpen = !debugOpen;\r\n\r\n };\r\n\r\n debugTS = function(sEventType, bSuccess, sMessage) {\r\n\r\n // troubleshooter debug hooks\r\n\r\n if (window.sm2Debugger !== _undefined) {\r\n try {\r\n sm2Debugger.handleEvent(sEventType, bSuccess, sMessage);\r\n } catch(e) {\r\n // oh well\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n // </d>\r\n\r\n getSWFCSS = function() {\r\n\r\n var css = [];\r\n\r\n if (sm2.debugMode) {\r\n css.push(swfCSS.sm2Debug);\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n css.push(swfCSS.flashDebug);\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n css.push(swfCSS.highPerf);\r\n }\r\n\r\n return css.join(' ');\r\n\r\n };\r\n\r\n flashBlockHandler = function() {\r\n\r\n // *possible* flash block situation.\r\n\r\n var name = str('fbHandler'),\r\n p = sm2.getMoviePercent(),\r\n css = swfCSS,\r\n error = {\r\n type: 'FLASHBLOCK'\r\n };\r\n\r\n if (sm2.html5Only) {\r\n // no flash, or unused\r\n return;\r\n }\r\n\r\n if (!sm2.ok()) {\r\n\r\n if (needsFlash) {\r\n // make the movie more visible, so user can fix\r\n sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null ? css.swfTimedout : css.swfError);\r\n sm2._wD(name + ': ' + str('fbTimeout') + (p ? ' (' + str('fbLoaded') + ')' : ''));\r\n }\r\n\r\n sm2.didFlashBlock = true;\r\n\r\n // fire onready(), complain lightly\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: error\r\n });\r\n\r\n catchError(error);\r\n\r\n } else {\r\n\r\n // SM2 loaded OK (or recovered)\r\n\r\n // <d>\r\n if (sm2.didFlashBlock) {\r\n sm2._wD(name + ': Unblocked');\r\n }\r\n // </d>\r\n\r\n if (sm2.oMC) {\r\n sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock ? ' ' + css.swfUnblocked : '')].join(' ');\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n addOnEvent = function(sType, oMethod, oScope) {\r\n\r\n if (on_queue[sType] === _undefined) {\r\n on_queue[sType] = [];\r\n }\r\n\r\n on_queue[sType].push({\r\n method: oMethod,\r\n scope: (oScope || null),\r\n fired: false\r\n });\r\n\r\n };\r\n\r\n processOnEvents = function(oOptions) {\r\n\r\n // if unspecified, assume OK/error\r\n\r\n if (!oOptions) {\r\n oOptions = {\r\n type: (sm2.ok() ? 'onready' : 'ontimeout')\r\n };\r\n }\r\n\r\n // not ready yet.\r\n if (!didInit && oOptions && !oOptions.ignoreInit) return false;\r\n\r\n // invalid case\r\n if (oOptions.type === 'ontimeout' && (sm2.ok() || (disabled && !oOptions.ignoreInit))) return false;\r\n\r\n var status = {\r\n success: (oOptions && oOptions.ignoreInit ? sm2.ok() : !disabled)\r\n },\r\n\r\n // queue specified by type, or none\r\n srcQueue = (oOptions && oOptions.type ? on_queue[oOptions.type] || [] : []),\r\n\r\n queue = [], i, j,\r\n args = [status],\r\n canRetry = (needsFlash && !sm2.ok());\r\n\r\n if (oOptions.error) {\r\n args[0].error = oOptions.error;\r\n }\r\n\r\n for (i = 0, j = srcQueue.length; i < j; i++) {\r\n if (srcQueue[i].fired !== true) {\r\n queue.push(srcQueue[i]);\r\n }\r\n }\r\n\r\n if (queue.length) {\r\n\r\n // sm2._wD(sm + ': Firing ' + queue.length + ' ' + oOptions.type + '() item' + (queue.length === 1 ? '' : 's'));\r\n for (i = 0, j = queue.length; i < j; i++) {\r\n\r\n if (queue[i].scope) {\r\n queue[i].method.apply(queue[i].scope, args);\r\n } else {\r\n queue[i].method.apply(this, args);\r\n }\r\n\r\n if (!canRetry) {\r\n // useFlashBlock and SWF timeout case doesn't count here.\r\n queue[i].fired = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n initUserOnload = function() {\r\n\r\n window.setTimeout(function() {\r\n\r\n if (sm2.useFlashBlock) {\r\n flashBlockHandler();\r\n }\r\n\r\n processOnEvents();\r\n\r\n // call user-defined \"onload\", scoped to window\r\n\r\n if (typeof sm2.onload === 'function') {\r\n _wDS('onload', 1);\r\n sm2.onload.apply(window);\r\n _wDS('onloadOK', 1);\r\n }\r\n\r\n if (sm2.waitForWindowLoad) {\r\n event.add(window, 'load', initUserOnload);\r\n }\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n detectFlash = function() {\r\n\r\n /**\r\n * Hat tip: Flash Detect library (BSD, (C) 2007) by Carl \"DocYes\" S. Yestrau\r\n * http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt\r\n */\r\n\r\n // this work has already been done.\r\n if (hasFlash !== _undefined) return hasFlash;\r\n\r\n var hasPlugin = false, n = navigator, obj, type, types, AX = window.ActiveXObject;\r\n\r\n // MS Edge 14 throws an \"Unspecified Error\" because n.plugins is inaccessible due to permissions\r\n var nP;\r\n\r\n try {\r\n nP = n.plugins;\r\n } catch(e) {\r\n nP = undefined;\r\n }\r\n\r\n if (nP && nP.length) {\r\n\r\n type = 'application/x-shockwave-flash';\r\n types = n.mimeTypes;\r\n\r\n if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {\r\n hasPlugin = true;\r\n }\r\n\r\n } else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {\r\n\r\n // Windows 8 Store Apps (MSAppHost) are weird (compatibility?) and won't complain here, but will barf if Flash/ActiveX object is appended to the DOM.\r\n try {\r\n obj = new AX('ShockwaveFlash.ShockwaveFlash');\r\n } catch(e) {\r\n // oh well\r\n obj = null;\r\n }\r\n\r\n hasPlugin = (!!obj);\r\n\r\n // cleanup, because it is ActiveX after all\r\n obj = null;\r\n\r\n }\r\n\r\n hasFlash = hasPlugin;\r\n\r\n return hasPlugin;\r\n\r\n };\r\n\r\n featureCheck = function() {\r\n\r\n var flashNeeded,\r\n item,\r\n formats = sm2.audioFormats,\r\n // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (original iPad) + iOS4 works.\r\n isSpecial = (is_iDevice && !!(ua.match(/os (1|2|3_0|3_1)\\s/i)));\r\n\r\n if (isSpecial) {\r\n\r\n // has Audio(), but is broken; let it load links directly.\r\n sm2.hasHTML5 = false;\r\n\r\n // ignore flash case, however\r\n sm2.html5Only = true;\r\n\r\n // hide the SWF, if present\r\n if (sm2.oMC) {\r\n sm2.oMC.style.display = 'none';\r\n }\r\n\r\n } else if (sm2.useHTML5Audio) {\r\n\r\n if (!sm2.html5 || !sm2.html5.canPlayType) {\r\n sm2._wD('SoundManager: No HTML5 Audio() support detected.');\r\n sm2.hasHTML5 = false;\r\n }\r\n\r\n // <d>\r\n if (isBadSafari) {\r\n sm2._wD(smc + 'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - ' + (!hasFlash ? ' would use flash fallback for MP3/MP4, but none detected.' : 'will use flash fallback for MP3/MP4, if available'), 1);\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n\r\n // sort out whether flash is optional, required or can be ignored.\r\n\r\n // innocent until proven guilty.\r\n canIgnoreFlash = true;\r\n\r\n for (item in formats) {\r\n\r\n if (formats.hasOwnProperty(item)) {\r\n\r\n if (formats[item].required) {\r\n\r\n if (!sm2.html5.canPlayType(formats[item].type)) {\r\n\r\n // 100% HTML5 mode is not possible.\r\n canIgnoreFlash = false;\r\n flashNeeded = true;\r\n\r\n } else if (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type])) {\r\n\r\n // flash may be required, or preferred for this format.\r\n flashNeeded = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // sanity check...\r\n if (sm2.ignoreFlash) {\r\n flashNeeded = false;\r\n canIgnoreFlash = true;\r\n }\r\n\r\n sm2.html5Only = (sm2.hasHTML5 && sm2.useHTML5Audio && !flashNeeded);\r\n\r\n return (!sm2.html5Only);\r\n\r\n };\r\n\r\n parseURL = function(url) {\r\n\r\n /**\r\n * Internal: Finds and returns the first playable URL (or failing that, the first URL.)\r\n * @param {string or array} url A single URL string, OR, an array of URL strings or {url:'/path/to/resource', type:'audio/mp3'} objects.\r\n */\r\n\r\n var i, j, urlResult = 0, result;\r\n\r\n if (url instanceof Array) {\r\n\r\n // find the first good one\r\n for (i = 0, j = url.length; i < j; i++) {\r\n\r\n if (url[i] instanceof Object) {\r\n\r\n // MIME check\r\n if (sm2.canPlayMIME(url[i].type)) {\r\n urlResult = i;\r\n break;\r\n }\r\n\r\n } else if (sm2.canPlayURL(url[i])) {\r\n\r\n // URL string check\r\n urlResult = i;\r\n break;\r\n\r\n }\r\n\r\n }\r\n\r\n // normalize to string\r\n if (url[urlResult].url) {\r\n url[urlResult] = url[urlResult].url;\r\n }\r\n\r\n result = url[urlResult];\r\n\r\n } else {\r\n\r\n // single URL case\r\n result = url;\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n\r\n startTimer = function(oSound) {\r\n\r\n /**\r\n * attach a timer to this sound, and start an interval if needed\r\n */\r\n\r\n if (!oSound._hasTimer) {\r\n\r\n oSound._hasTimer = true;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n if (h5IntervalTimer === null && h5TimerCount === 0) {\r\n\r\n h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);\r\n\r\n }\r\n\r\n h5TimerCount++;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n stopTimer = function(oSound) {\r\n\r\n /**\r\n * detach a timer\r\n */\r\n\r\n if (oSound._hasTimer) {\r\n\r\n oSound._hasTimer = false;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n // interval will stop itself at next execution.\r\n\r\n h5TimerCount--;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n timerExecute = function() {\r\n\r\n /**\r\n * manual polling for HTML5 progress events, ie., whileplaying()\r\n * (can achieve greater precision than conservative default HTML5 interval)\r\n */\r\n\r\n var i;\r\n\r\n if (h5IntervalTimer !== null && !h5TimerCount) {\r\n\r\n // no active timers, stop polling interval.\r\n\r\n clearInterval(h5IntervalTimer);\r\n\r\n h5IntervalTimer = null;\r\n\r\n return;\r\n\r\n }\r\n\r\n // check all HTML5 sounds with timers\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n\r\n if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {\r\n sm2.sounds[sm2.soundIDs[i]]._onTimer();\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n catchError = function(options) {\r\n\r\n options = (options !== _undefined ? options : {});\r\n\r\n if (typeof sm2.onerror === 'function') {\r\n sm2.onerror.apply(window, [{\r\n type: (options.type !== _undefined ? options.type : null)\r\n }]);\r\n }\r\n\r\n if (options.fatal !== _undefined && options.fatal) {\r\n sm2.disable();\r\n }\r\n\r\n };\r\n\r\n badSafariFix = function() {\r\n\r\n // special case: \"bad\" Safari (OS X 10.3 - 10.7) must fall back to flash for MP3/MP4\r\n if (!isBadSafari || !detectFlash()) {\r\n // doesn't apply\r\n return;\r\n }\r\n\r\n var aF = sm2.audioFormats, i, item;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n if (item === 'mp3' || item === 'mp4') {\r\n\r\n sm2._wD(sm + ': Using flash fallback for ' + item + ' format');\r\n sm2.html5[item] = false;\r\n\r\n // assign result to related formats, too\r\n if (aF[item] && aF[item].related) {\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n sm2.html5[aF[item].related[i]] = false;\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private flash/ExternalInterface methods\r\n * ----------------------------------------------\r\n */\r\n\r\n this._setSandboxType = function(sandboxType) {\r\n\r\n // <d>\r\n // Security sandbox according to Flash plugin\r\n var sb = sm2.sandbox;\r\n\r\n sb.type = sandboxType;\r\n sb.description = sb.types[(sb.types[sandboxType] !== _undefined ? sandboxType : 'unknown')];\r\n\r\n if (sb.type === 'localWithFile') {\r\n\r\n sb.noRemote = true;\r\n sb.noLocal = false;\r\n _wDS('secNote', 2);\r\n\r\n } else if (sb.type === 'localWithNetwork') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = true;\r\n\r\n } else if (sb.type === 'localTrusted') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = false;\r\n\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n this._externalInterfaceOK = function(swfVersion) {\r\n\r\n // flash callback confirming flash loaded, EI working etc.\r\n // swfVersion: SWF build string\r\n\r\n if (sm2.swfLoaded) {\r\n return;\r\n }\r\n\r\n var e;\r\n\r\n debugTS('swf', true);\r\n debugTS('flashtojs', true);\r\n sm2.swfLoaded = true;\r\n tryInitOnFocus = false;\r\n\r\n if (isBadSafari) {\r\n badSafariFix();\r\n }\r\n\r\n // complain if JS + SWF build/version strings don't match, excluding +DEV builds\r\n // <d>\r\n if (!swfVersion || swfVersion.replace(/\\+dev/i, '') !== sm2.versionNumber.replace(/\\+dev/i, '')) {\r\n\r\n e = sm + ': Fatal: JavaScript file build \"' + sm2.versionNumber + '\" does not match Flash SWF build \"' + swfVersion + '\" at ' + sm2.url + '. Ensure both are up-to-date.';\r\n\r\n // escape flash -> JS stack so this error fires in window.\r\n setTimeout(function() {\r\n throw new Error(e);\r\n }, 0);\r\n\r\n // exit, init will fail with timeout\r\n return;\r\n\r\n }\r\n // </d>\r\n\r\n // IE needs a larger timeout\r\n setTimeout(init, isIE ? 100 : 1);\r\n\r\n };\r\n\r\n /**\r\n * Private initialization helpers\r\n * ------------------------------\r\n */\r\n\r\n createMovie = function(movieID, movieURL) {\r\n\r\n // ignore if already connected\r\n if (didAppend && appendSuccess) return false;\r\n\r\n function initMsg() {\r\n\r\n // <d>\r\n\r\n var options = [],\r\n title,\r\n msg = [],\r\n delimiter = ' + ';\r\n\r\n title = 'SoundManager ' + sm2.version + (!sm2.html5Only && sm2.useHTML5Audio ? (sm2.hasHTML5 ? ' + HTML5 audio' : ', no HTML5 audio support') : '');\r\n\r\n if (!sm2.html5Only) {\r\n\r\n if (sm2.preferFlash) {\r\n options.push('preferFlash');\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n options.push('useHighPerformance');\r\n }\r\n\r\n if (sm2.flashPollingInterval) {\r\n options.push('flashPollingInterval (' + sm2.flashPollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.wmode) {\r\n options.push('wmode (' + sm2.wmode + ')');\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n options.push('debugFlash');\r\n }\r\n\r\n if (sm2.useFlashBlock) {\r\n options.push('flashBlock');\r\n }\r\n\r\n } else if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (options.length) {\r\n msg = msg.concat([options.join(delimiter)]);\r\n }\r\n\r\n sm2._wD(title + (msg.length ? delimiter + msg.join(', ') : ''), 1);\r\n\r\n showSupport();\r\n\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n // 100% HTML5 mode\r\n setVersionInfo();\r\n\r\n initMsg();\r\n sm2.oMC = id(sm2.movieID);\r\n init();\r\n\r\n // prevent multiple init attempts\r\n didAppend = true;\r\n\r\n appendSuccess = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // flash path\r\n var remoteURL = (movieURL || sm2.url),\r\n localURL = (sm2.altURL || remoteURL),\r\n swfTitle = 'JS/Flash audio component (SoundManager 2)',\r\n oTarget = getDocument(),\r\n extraClass = getSWFCSS(),\r\n isRTL = null,\r\n html = doc.getElementsByTagName('html')[0],\r\n oEmbed, oMovie, tmp, movieHTML, oEl, s, x, sClass;\r\n\r\n isRTL = (html && html.dir && html.dir.match(/rtl/i));\r\n movieID = (movieID === _undefined ? sm2.id : movieID);\r\n\r\n function param(name, value) {\r\n return '<param name=\"' + name + '\" value=\"' + value + '\" />';\r\n }\r\n\r\n // safety check for legacy (change to Flash 9 URL)\r\n setVersionInfo();\r\n sm2.url = normalizeMovieURL(overHTTP ? remoteURL : localURL);\r\n movieURL = sm2.url;\r\n\r\n sm2.wmode = (!sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode);\r\n\r\n if (sm2.wmode !== null && (ua.match(/msie 8/i) || (!isIE && !sm2.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {\r\n /**\r\n * extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here\r\n * does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout\r\n * wmode breaks IE 8 on Vista + Win7 too in some cases, as of January 2011 (?)\r\n */\r\n messages.push(strings.spcWmode);\r\n sm2.wmode = null;\r\n }\r\n\r\n oEmbed = {\r\n name: movieID,\r\n id: movieID,\r\n src: movieURL,\r\n quality: 'high',\r\n allowScriptAccess: sm2.allowScriptAccess,\r\n bgcolor: sm2.bgColor,\r\n pluginspage: http + 'www.macromedia.com/go/getflashplayer',\r\n title: swfTitle,\r\n type: 'application/x-shockwave-flash',\r\n wmode: sm2.wmode,\r\n // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html\r\n hasPriority: 'true'\r\n };\r\n\r\n if (sm2.debugFlash) {\r\n oEmbed.FlashVars = 'debug=1';\r\n }\r\n\r\n if (!sm2.wmode) {\r\n // don't write empty attribute\r\n delete oEmbed.wmode;\r\n }\r\n\r\n if (isIE) {\r\n\r\n // IE is \"special\".\r\n oMovie = doc.createElement('div');\r\n movieHTML = [\r\n '<object id=\"' + movieID + '\" data=\"' + movieURL + '\" type=\"' + oEmbed.type + '\" title=\"' + oEmbed.title + '\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\">',\r\n param('movie', movieURL),\r\n param('AllowScriptAccess', sm2.allowScriptAccess),\r\n param('quality', oEmbed.quality),\r\n (sm2.wmode ? param('wmode', sm2.wmode) : ''),\r\n param('bgcolor', sm2.bgColor),\r\n param('hasPriority', 'true'),\r\n (sm2.debugFlash ? param('FlashVars', oEmbed.FlashVars) : ''),\r\n '</object>'\r\n ].join('');\r\n\r\n } else {\r\n\r\n oMovie = doc.createElement('embed');\r\n for (tmp in oEmbed) {\r\n if (oEmbed.hasOwnProperty(tmp)) {\r\n oMovie.setAttribute(tmp, oEmbed[tmp]);\r\n }\r\n }\r\n\r\n }\r\n\r\n initDebug();\r\n extraClass = getSWFCSS();\r\n oTarget = getDocument();\r\n\r\n if (oTarget) {\r\n\r\n sm2.oMC = (id(sm2.movieID) || doc.createElement('div'));\r\n\r\n if (!sm2.oMC.id) {\r\n\r\n sm2.oMC.id = sm2.movieID;\r\n sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;\r\n s = null;\r\n oEl = null;\r\n\r\n if (!sm2.useFlashBlock) {\r\n if (sm2.useHighPerformance) {\r\n // on-screen at all times\r\n s = {\r\n position: 'fixed',\r\n width: '8px',\r\n height: '8px',\r\n // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes.\r\n bottom: '0px',\r\n left: '0px',\r\n overflow: 'hidden'\r\n };\r\n } else {\r\n // hide off-screen, lower priority\r\n s = {\r\n position: 'absolute',\r\n width: '6px',\r\n height: '6px',\r\n top: '-9999px',\r\n left: '-9999px'\r\n };\r\n if (isRTL) {\r\n s.left = Math.abs(parseInt(s.left, 10)) + 'px';\r\n }\r\n }\r\n }\r\n\r\n if (isWebkit) {\r\n // soundcloud-reported render/crash fix, safari 5\r\n sm2.oMC.style.zIndex = 10000;\r\n }\r\n\r\n if (!sm2.debugFlash) {\r\n for (x in s) {\r\n if (s.hasOwnProperty(x)) {\r\n sm2.oMC.style[x] = s[x];\r\n }\r\n }\r\n }\r\n\r\n try {\r\n\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oMovie);\r\n }\r\n\r\n oTarget.appendChild(sm2.oMC);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n } catch(e) {\r\n\r\n throw new Error(str('domError') + ' \\n' + e.toString());\r\n\r\n }\r\n\r\n } else {\r\n\r\n // SM2 container is already in the document (eg. flashblock use case)\r\n sClass = sm2.oMC.className;\r\n sm2.oMC.className = (sClass ? sClass + ' ' : swfCSS.swfDefault) + (extraClass ? ' ' + extraClass : '');\r\n sm2.oMC.appendChild(oMovie);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n }\r\n\r\n }\r\n\r\n didAppend = true;\r\n\r\n initMsg();\r\n\r\n // sm2._wD(sm + ': Trying to load ' + movieURL + (!overHTTP && sm2.altURL ? ' (alternate URL)' : ''), 1);\r\n\r\n return true;\r\n\r\n };\r\n\r\n initMovie = function() {\r\n\r\n if (sm2.html5Only) {\r\n createMovie();\r\n return false;\r\n }\r\n\r\n // attempt to get, or create, movie (may already exist)\r\n if (flash) return false;\r\n\r\n if (!sm2.url) {\r\n\r\n /**\r\n * Something isn't right - we've reached init, but the soundManager url property has not been set.\r\n * User has not called setup({url: ...}), or has not set soundManager.url (legacy use case) directly before init time.\r\n * Notify and exit. If user calls setup() with a url: property, init will be restarted as in the deferred loading case.\r\n */\r\n\r\n _wDS('noURL');\r\n return false;\r\n\r\n }\r\n\r\n // inline markup case\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n if (!flash) {\r\n\r\n if (!oRemoved) {\r\n\r\n // try to create\r\n createMovie(sm2.id, sm2.url);\r\n\r\n } else {\r\n\r\n // try to re-append removed movie after reboot()\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oRemoved);\r\n } else {\r\n sm2.oMC.innerHTML = oRemovedHTML;\r\n }\r\n\r\n oRemoved = null;\r\n didAppend = true;\r\n\r\n }\r\n\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n }\r\n\r\n if (typeof sm2.oninitmovie === 'function') {\r\n setTimeout(sm2.oninitmovie, 1);\r\n }\r\n\r\n // <d>\r\n flushMessages();\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n delayWaitForEI = function() {\r\n\r\n setTimeout(waitForEI, 1000);\r\n\r\n };\r\n\r\n rebootIntoHTML5 = function() {\r\n\r\n // special case: try for a reboot with preferFlash: false, if 100% HTML5 mode is possible and useFlashBlock is not enabled.\r\n\r\n window.setTimeout(function() {\r\n\r\n complain(smc + 'useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...');\r\n\r\n sm2.setup({\r\n preferFlash: false\r\n }).reboot();\r\n\r\n // if for some reason you want to detect this case, use an ontimeout() callback and look for html5Only and didFlashBlock == true.\r\n sm2.didFlashBlock = true;\r\n\r\n sm2.beginDelayedInit();\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n waitForEI = function() {\r\n\r\n var p,\r\n loadIncomplete = false;\r\n\r\n if (!sm2.url) {\r\n // No SWF url to load (noURL case) - exit for now. Will be retried when url is set.\r\n return;\r\n }\r\n\r\n if (waitingForEI) {\r\n return;\r\n }\r\n\r\n waitingForEI = true;\r\n event.remove(window, 'load', delayWaitForEI);\r\n\r\n if (hasFlash && tryInitOnFocus && !isFocused) {\r\n // Safari won't load flash in background tabs, only when focused.\r\n _wDS('waitFocus');\r\n return;\r\n }\r\n\r\n if (!didInit) {\r\n p = sm2.getMoviePercent();\r\n if (p > 0 && p < 100) {\r\n loadIncomplete = true;\r\n }\r\n }\r\n\r\n setTimeout(function() {\r\n\r\n p = sm2.getMoviePercent();\r\n\r\n if (loadIncomplete) {\r\n // special case: if movie *partially* loaded, retry until it's 100% before assuming failure.\r\n waitingForEI = false;\r\n sm2._wD(str('waitSWF'));\r\n window.setTimeout(delayWaitForEI, 1);\r\n return;\r\n }\r\n\r\n // <d>\r\n if (!didInit) {\r\n\r\n sm2._wD(sm + ': No Flash response within expected time. Likely causes: ' + (p === 0 ? 'SWF load failed, ' : '') + 'Flash blocked or JS-Flash security error.' + (sm2.debugFlash ? ' ' + str('checkSWF') : ''), 2);\r\n\r\n if (!overHTTP && p) {\r\n\r\n _wDS('localFail', 2);\r\n\r\n if (!sm2.debugFlash) {\r\n _wDS('tryDebug', 2);\r\n }\r\n\r\n }\r\n\r\n if (p === 0) {\r\n\r\n // if 0 (not null), probably a 404.\r\n sm2._wD(str('swf404', sm2.url), 1);\r\n\r\n }\r\n\r\n debugTS('flashtojs', false, ': Timed out' + (overHTTP ? ' (Check flash security or flash blockers)' : ' (No plugin/missing SWF?)'));\r\n\r\n }\r\n // </d>\r\n\r\n // give up / time-out, depending\r\n\r\n if (!didInit && okToDisable) {\r\n\r\n if (p === null) {\r\n\r\n // SWF failed to report load progress. Possibly blocked.\r\n\r\n if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {\r\n\r\n if (sm2.useFlashBlock) {\r\n\r\n flashBlockHandler();\r\n\r\n }\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n // no custom flash block handling, but SWF has timed out. Will recover if user unblocks / allows SWF load.\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n _wDS('waitForever');\r\n\r\n // fire any regular registered ontimeout() listeners.\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: {\r\n type: 'INIT_FLASHBLOCK'\r\n }\r\n });\r\n\r\n }\r\n\r\n } else if (sm2.flashLoadTimeout === 0) {\r\n\r\n // SWF loaded? Shouldn't be a blocking issue, then.\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n failSafely(true);\r\n\r\n }\r\n\r\n }\r\n\r\n }, sm2.flashLoadTimeout);\r\n\r\n };\r\n\r\n handleFocus = function() {\r\n\r\n function cleanup() {\r\n event.remove(window, 'focus', handleFocus);\r\n }\r\n\r\n if (isFocused || !tryInitOnFocus) {\r\n // already focused, or not special Safari background tab case\r\n cleanup();\r\n return true;\r\n }\r\n\r\n okToDisable = true;\r\n isFocused = true;\r\n _wDS('gotFocus');\r\n\r\n // allow init to restart\r\n waitingForEI = false;\r\n\r\n // kick off ExternalInterface timeout, now that the SWF has started\r\n delayWaitForEI();\r\n\r\n cleanup();\r\n return true;\r\n\r\n };\r\n\r\n flushMessages = function() {\r\n\r\n // <d>\r\n\r\n // SM2 pre-init debug messages\r\n if (messages.length) {\r\n sm2._wD('SoundManager 2: ' + messages.join(' '), 1);\r\n messages = [];\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n showSupport = function() {\r\n\r\n // <d>\r\n\r\n flushMessages();\r\n\r\n var item, tests = [];\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n for (item in sm2.audioFormats) {\r\n if (sm2.audioFormats.hasOwnProperty(item)) {\r\n tests.push(item + ' = ' + sm2.html5[item] + (!sm2.html5[item] && needsFlash && sm2.flash[item] ? ' (using flash)' : (sm2.preferFlash && sm2.flash[item] && needsFlash ? ' (preferring flash)' : (!sm2.html5[item] ? ' (' + (sm2.audioFormats[item].required ? 'required, ' : '') + 'and no flash support)' : ''))));\r\n }\r\n }\r\n sm2._wD('SoundManager 2 HTML5 support: ' + tests.join(', '), 1);\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n initComplete = function(bNoDisable) {\r\n\r\n if (didInit) return false;\r\n\r\n if (sm2.html5Only) {\r\n // all good.\r\n _wDS('sm2Loaded', 1);\r\n didInit = true;\r\n initUserOnload();\r\n debugTS('onload', true);\r\n return true;\r\n }\r\n\r\n var wasTimeout = (sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent()),\r\n result = true,\r\n error;\r\n\r\n if (!wasTimeout) {\r\n didInit = true;\r\n }\r\n\r\n error = {\r\n type: (!hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT')\r\n };\r\n\r\n sm2._wD('SoundManager 2 ' + (disabled ? 'failed to load' : 'loaded') + ' (' + (disabled ? 'Flash security/load error' : 'OK') + ') ' + String.fromCharCode(disabled ? 10006 : 10003), disabled ? 2 : 1);\r\n\r\n if (disabled || bNoDisable) {\r\n\r\n if (sm2.useFlashBlock && sm2.oMC) {\r\n sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null ? swfCSS.swfTimedout : swfCSS.swfError);\r\n }\r\n\r\n processOnEvents({\r\n type: 'ontimeout',\r\n error: error,\r\n ignoreInit: true\r\n });\r\n\r\n debugTS('onload', false);\r\n catchError(error);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n debugTS('onload', true);\r\n\r\n }\r\n\r\n if (!disabled) {\r\n\r\n if (sm2.waitForWindowLoad && !windowLoaded) {\r\n\r\n _wDS('waitOnload');\r\n event.add(window, 'load', initUserOnload);\r\n\r\n } else {\r\n\r\n // <d>\r\n if (sm2.waitForWindowLoad && windowLoaded) {\r\n _wDS('docLoaded');\r\n }\r\n // </d>\r\n\r\n initUserOnload();\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * apply top-level setupOptions object as local properties, eg., this.setupOptions.flashVersion -> this.flashVersion (soundManager.flashVersion)\r\n * this maintains backward compatibility, and allows properties to be defined separately for use by soundManager.setup().\r\n */\r\n\r\n setProperties = function() {\r\n\r\n var i,\r\n o = sm2.setupOptions;\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // assign local property if not already defined\r\n\r\n if (sm2[i] === _undefined) {\r\n\r\n sm2[i] = o[i];\r\n\r\n } else if (sm2[i] !== o[i]) {\r\n\r\n // legacy support: write manually-assigned property (eg., soundManager.url) back to setupOptions to keep things in sync\r\n sm2.setupOptions[i] = sm2[i];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n\r\n init = function() {\r\n\r\n // called after onload()\r\n\r\n if (didInit) {\r\n _wDS('didInit');\r\n return false;\r\n }\r\n\r\n function cleanup() {\r\n event.remove(window, 'load', sm2.beginDelayedInit);\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n if (!didInit) {\r\n // we don't need no steenking flash!\r\n cleanup();\r\n sm2.enabled = true;\r\n initComplete();\r\n }\r\n\r\n return true;\r\n\r\n }\r\n\r\n // flash path\r\n initMovie();\r\n\r\n try {\r\n\r\n // attempt to talk to Flash\r\n flash._externalInterfaceTest(false);\r\n\r\n /**\r\n * Apply user-specified polling interval, OR, if \"high performance\" set, faster vs. default polling\r\n * (determines frequency of whileloading/whileplaying callbacks, effectively driving UI framerates)\r\n */\r\n setPolling(true, (sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50)));\r\n\r\n if (!sm2.debugMode) {\r\n // stop the SWF from making debug output calls to JS\r\n flash._disableDebug();\r\n }\r\n\r\n sm2.enabled = true;\r\n debugTS('jstoflash', true);\r\n\r\n if (!sm2.html5Only) {\r\n // prevent browser from showing cached page state (or rather, restoring \"suspended\" page state) via back button, because flash may be dead\r\n // http://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/\r\n event.add(window, 'unload', doNothing);\r\n }\r\n\r\n } catch(e) {\r\n\r\n sm2._wD('js/flash exception: ' + e.toString());\r\n\r\n debugTS('jstoflash', false);\r\n\r\n catchError({\r\n type: 'JS_TO_FLASH_EXCEPTION',\r\n fatal: true\r\n });\r\n\r\n // don't disable, for reboot()\r\n failSafely(true);\r\n\r\n initComplete();\r\n\r\n return false;\r\n\r\n }\r\n\r\n initComplete();\r\n\r\n // disconnect events\r\n cleanup();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoaded = function() {\r\n\r\n if (didDCLoaded) return false;\r\n\r\n didDCLoaded = true;\r\n\r\n // assign top-level soundManager properties eg. soundManager.url\r\n setProperties();\r\n\r\n initDebug();\r\n\r\n if (!hasFlash && sm2.hasHTML5) {\r\n\r\n sm2._wD('SoundManager 2: No Flash detected' + (!sm2.useHTML5Audio ? ', enabling HTML5.' : '. Trying HTML5-only mode.'), 1);\r\n\r\n sm2.setup({\r\n useHTML5Audio: true,\r\n // make sure we aren't preferring flash, either\r\n // TODO: preferFlash should not matter if flash is not installed. Currently, stuff breaks without the below tweak.\r\n preferFlash: false\r\n });\r\n\r\n }\r\n\r\n testHTML5();\r\n\r\n if (!hasFlash && needsFlash) {\r\n\r\n messages.push(strings.needFlash);\r\n\r\n // TODO: Fatal here vs. timeout approach, etc.\r\n // hack: fail sooner.\r\n sm2.setup({\r\n flashLoadTimeout: 1\r\n });\r\n\r\n }\r\n\r\n if (doc.removeEventListener) {\r\n doc.removeEventListener('DOMContentLoaded', domContentLoaded, false);\r\n }\r\n\r\n initMovie();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoadedIE = function() {\r\n\r\n if (doc.readyState === 'complete') {\r\n domContentLoaded();\r\n doc.detachEvent('onreadystatechange', domContentLoadedIE);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n winOnLoad = function() {\r\n\r\n // catch edge case of initComplete() firing after window.load()\r\n windowLoaded = true;\r\n\r\n // catch case where DOMContentLoaded has been sent, but we're still in doc.readyState = 'interactive'\r\n domContentLoaded();\r\n\r\n event.remove(window, 'load', winOnLoad);\r\n\r\n };\r\n\r\n // sniff up-front\r\n detectFlash();\r\n\r\n // focus and window load, init (primarily flash-driven)\r\n event.add(window, 'focus', handleFocus);\r\n event.add(window, 'load', delayWaitForEI);\r\n event.add(window, 'load', winOnLoad);\r\n\r\n if (doc.addEventListener) {\r\n\r\n doc.addEventListener('DOMContentLoaded', domContentLoaded, false);\r\n\r\n } else if (doc.attachEvent) {\r\n\r\n doc.attachEvent('onreadystatechange', domContentLoadedIE);\r\n\r\n } else {\r\n\r\n // no add/attachevent support - safe to assume no JS -> Flash either\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'NO_DOM2_EVENTS',\r\n fatal: true\r\n });\r\n\r\n }\r\n\r\n} // SoundManager()\r\n\r\n// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading\r\n\r\nif (window.SM2_DEFER === _undefined || !SM2_DEFER) {\r\n soundManager = new SoundManager();\r\n}\r\n\r\n/**\r\n * SoundManager public interfaces\r\n * ------------------------------\r\n */\r\n\r\nif (typeof module === 'object' && module && typeof module.exports === 'object') {\r\n\r\n /**\r\n * commonJS module\r\n */\r\n\r\n module.exports.SoundManager = SoundManager;\r\n module.exports.soundManager = soundManager;\r\n\r\n} else if (typeof define === 'function' && define.amd) {\r\n\r\n /**\r\n * AMD - requireJS\r\n * basic usage:\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance().setup({\r\n * url: '/swf/',\r\n * onready: function() { ... }\r\n * })\r\n * });\r\n *\r\n * SM2_DEFER usage:\r\n * window.SM2_DEFER = true;\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance(function() {\r\n * var soundManager = new SoundManager.constructor();\r\n * soundManager.setup({\r\n * url: '/swf/',\r\n * ...\r\n * });\r\n * ...\r\n * soundManager.beginDelayedInit();\r\n * return soundManager;\r\n * })\r\n * });\r\n */\r\n\r\n define(function() {\r\n /**\r\n * Retrieve the global instance of SoundManager.\r\n * If a global instance does not exist it can be created using a callback.\r\n *\r\n * @param {Function} smBuilder Optional: Callback used to create a new SoundManager instance\r\n * @return {SoundManager} The global SoundManager instance\r\n */\r\n function getInstance(smBuilder) {\r\n if (!window.soundManager && smBuilder instanceof Function) {\r\n var instance = smBuilder(SoundManager);\r\n if (instance instanceof SoundManager) {\r\n window.soundManager = instance;\r\n }\r\n }\r\n return window.soundManager;\r\n }\r\n return {\r\n constructor: SoundManager,\r\n getInstance: getInstance\r\n };\r\n });\r\n\r\n}\r\n\r\n// standard browser case\r\n\r\n// constructor\r\nwindow.SoundManager = SoundManager;\r\n\r\n/**\r\n * note: SM2 requires a window global due to Flash, which makes calls to window.soundManager.\r\n * Flash may not always be needed, but this is not known until async init and SM2 may even \"reboot\" into Flash mode.\r\n */\r\n\r\n// public API, flash callbacks etc.\r\nwindow.soundManager = soundManager;\r\n\r\n}(window));\r\n"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"plugins/plugin.tts.js","mappings":";ysDACAA,EAAA,kBAAAC,CAAA,MAAAC,EAAAD,EAAA,GAAAE,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAK,gBAAA,SAAAP,EAAAD,EAAAE,GAAAD,EAAAD,GAAAE,EAAAO,KAAA,EAAAC,EAAA,mBAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,EAAAjB,EAAAD,EAAAE,GAAA,OAAAC,OAAAK,eAAAP,EAAAD,EAAA,CAAAS,MAAAP,EAAAiB,YAAA,EAAAC,cAAA,EAAAC,UAAA,IAAApB,EAAAD,EAAA,KAAAkB,EAAA,aAAAjB,GAAAiB,EAAA,SAAAjB,EAAAD,EAAAE,GAAA,OAAAD,EAAAD,GAAAE,CAAA,WAAAoB,EAAArB,EAAAD,EAAAE,EAAAG,GAAA,IAAAK,EAAAV,GAAAA,EAAAI,qBAAAmB,EAAAvB,EAAAuB,EAAAX,EAAAT,OAAAqB,OAAAd,EAAAN,WAAAU,EAAA,IAAAW,EAAApB,GAAA,WAAAE,EAAAK,EAAA,WAAAH,MAAAiB,EAAAzB,EAAAC,EAAAY,KAAAF,CAAA,UAAAe,EAAA1B,EAAAD,EAAAE,GAAA,WAAA0B,KAAA,SAAAC,IAAA5B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YAChB,EAKD,gCAOH9G,EAAOuW,aAAeA,EAQtBvW,EAAO8G,aAAeA,CAEtB,CAxnMA,CAwnME9G,2CCppMF,IAAItF,EAAI,EAAQ,MACZwjC,EAAW,gBAIfxjC,EAAE,CAAE5B,OAAQ,SAAUqlC,MAAM,GAAQ,CAClCjrB,QAAS,SAAiBkrB,GACxB,OAAOF,EAASE,EAClB","sources":["webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunk.js","webpack://@internetarchive/bookreader/./src/plugins/tts/PageChunkIterator.js","webpack://@internetarchive/bookreader/./src/plugins/tts/utils.js","webpack://@internetarchive/bookreader/./src/plugins/tts/AbstractTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/FestivalTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/WebTTSEngine.js","webpack://@internetarchive/bookreader/./src/plugins/tts/plugin.tts.js","webpack://@internetarchive/bookreader/./src/plugins/tts/tooltip_dict.js","webpack://@internetarchive/bookreader/./node_modules/iso-language-codes/js/data.js","webpack://@internetarchive/bookreader/./node_modules/jquery.browser/dist/jquery.browser.js","webpack://@internetarchive/bookreader/./node_modules/soundmanager2/script/soundmanager2.js","webpack://@internetarchive/bookreader/./node_modules/core-js/modules/es.object.entries.js"],"sourcesContent":["/**\n * Class to manage a 'chunk' (approximately a paragraph) of text on a page.\n */\nexport default class PageChunk {\n /**\n * @param {number} leafIndex\n * @param {number} chunkIndex\n * @param {string} text\n * @param {DJVURect[]} lineRects\n */\n constructor(leafIndex, chunkIndex, text, lineRects) {\n this.leafIndex = leafIndex;\n this.chunkIndex = chunkIndex;\n this.text = text;\n this.lineRects = lineRects;\n }\n\n /**\n * @param {string} server\n * @param {string} bookPath\n * @param {number} leafIndex\n * @return {Promise<PageChunk[]>}\n */\n static async fetch(server, bookPath, leafIndex) {\n const chunks = await $.ajax({\n type: 'GET',\n url: `https://${server}/BookReader/BookReaderGetTextWrapper.php`,\n dataType:'jsonp',\n cache: true,\n data: {\n path: `${bookPath}_djvu.xml`,\n page: leafIndex\n }\n });\n return PageChunk._fromTextWrapperResponse(leafIndex, chunks);\n }\n\n /**\n * Convert the response from BookReaderGetTextWrapper.php into a {@link PageChunk} instance\n * @param {number} leafIndex\n * @param {Array<[String, ...DJVURect[]]>} chunksResponse\n * @return {PageChunk[]}\n */\n static _fromTextWrapperResponse(leafIndex, chunksResponse) {\n return chunksResponse.map((c, i) => {\n const correctedLineRects = PageChunk._fixChunkRects(c.slice(1));\n const correctedText = PageChunk._removeDanglingHyphens(c[0]);\n return new PageChunk(leafIndex, i, correctedText, correctedLineRects);\n });\n }\n\n /**\n * @private\n * Sometimes the first rectangle will be ridiculously wide/tall. Find those and fix them\n * *NOTE*: Modifies the original array and returns it.\n * *NOTE*: This should probably be fixed on the petabox side, and then removed here\n * Has 2 problems:\n * - If the rect is the last rect on the page (and hence the only rect in the array),\n * the rect's size isn't fixed\n * - Because this relies on the second rect, there's a chance it won't be the right\n * width\n * @param {DJVURect[]} rects\n * @return {DJVURect[]}\n */\n static _fixChunkRects(rects) {\n if (rects.length < 2) return rects;\n\n const [firstRect, secondRect] = rects;\n const [left, bottom, right] = firstRect;\n const width = right - left;\n const secondHeight = secondRect[1] - secondRect[3];\n const secondWidth = secondRect[2] - secondRect[0];\n const secondRight = secondRect[2];\n\n if (width > secondWidth * 30) {\n // Set the end to be the same\n firstRect[2] = secondRight;\n // And the top to be the same height\n firstRect[3] = bottom - secondHeight;\n }\n\n return rects;\n }\n\n /**\n * Remove \"dangling\" hyphens from read aloud text to avoid TTS stuttering\n * @param {string} text\n * @return {string}\n */\n static _removeDanglingHyphens(text) {\n // Some books mis-OCR a dangling hyphen as a ¬ (mathematical not sign) . Since in math\n // the not sign should not appear followed by a space, we think we can safely assume\n // this should be replaced.\n return text.replace(/[-¬]\\s+/g, '');\n }\n}\n\n/**\n * @typedef {[number, number, number, number]} DJVURect\n * coords are in l,b,r,t order\n */\n","import PageChunk from './PageChunk.js';\n\n/**\n * Class that iterates over the page chunks of a book; caching/buffering\n * as much as possible to try to ensure a smooth experience.\n */\nexport default class PageChunkIterator {\n /**\n * @param {number} pageCount total number of pages\n * @param {number} start page to start on\n * @param {PageChunkIteratorOptions} opts\n */\n constructor(pageCount, start, opts) {\n this.pageCount = pageCount;\n this.opts = Object.assign({}, DEFAULT_OPTS, opts);\n /** Position in the chunk sequence */\n this._cursor = { page: start, chunk: 0 };\n /** @type {Object<number, PageChunk[]>} leaf index -> chunks*/\n this._bufferedPages = {};\n /** @type {Object<number, PromiseLike<PageChunk[]>} leaf index -> chunks*/\n this._bufferingPages = {};\n /**\n * @type {Promise} promise that manages cursor modifications so that they\n * happen in order triggered as opposed to order the server responds\n **/\n this._cursorLock = Promise.resolve();\n }\n\n /**\n * Get the next chunk\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n next() {\n return this._cursorLock = this._cursorLock\n .then(() => this._nextUncontrolled());\n }\n\n /**\n * Sends the cursor back 1\n * @return {Promise}\n **/\n decrement() {\n return this._cursorLock = this._cursorLock\n .then(() => this._decrementUncontrolled());\n }\n\n /**\n * Gets without ensuring synchronization. Since this iterator has a lot of async\n * code, calling e.g. \"next\" twice (before the first call to next has finished)\n * would cause the system to be in a weird state. To avoid that, we make sure calls\n * to next and decrement (functions that modify the cursor) are synchronized,\n * so that regardless how long it takes for one to respond, they'll always be executed\n * in the correct order.\n * @return {PromiseLike<\"__PageChunkIterator.AT_END__\" | PageChunk>}\n */\n async _nextUncontrolled() {\n if (this._cursor.page == this.pageCount) {\n return Promise.resolve(PageChunkIterator.AT_END);\n }\n this._recenterBuffer(this._cursor.page);\n const chunks = await this._fetchPageChunks(this._cursor.page);\n if (this._cursor.chunk == chunks.length) {\n this._cursor.page++;\n this._cursor.chunk = 0;\n return this._nextUncontrolled();\n }\n return chunks[this._cursor.chunk++];\n }\n\n /**\n * Decrements without ensuring synchronization. (See {@link PageChunkIterator._nextUncontrolled});\n * @return {Promise}\n */\n _decrementUncontrolled() {\n let cursorChangePromise = Promise.resolve();\n\n if (this._cursor.chunk > 0) {\n this._cursor.chunk--;\n } else if (this._cursor.page > 0) {\n this._cursor.page--;\n // Go back possibly multiple pages, because pages can be blank\n cursorChangePromise = this._fetchPageChunks(this._cursor.page)\n .then(prevPageChunks => {\n if (prevPageChunks.length == 0) return this._decrementUncontrolled();\n else this._cursor.chunk = prevPageChunks.length - 1;\n });\n }\n\n return cursorChangePromise\n .then(() => this._fetchPageChunks(this._cursor.page));\n }\n\n /**\n * Recenter the buffer around the provided page index\n * @param {number} index\n */\n _recenterBuffer(index) {\n const start = Math.max(0, index - this.opts.pageBufferSize);\n const end = Math.min(this.pageCount, index + this.opts.pageBufferSize + 1);\n for (let i = start; i < end; i++) {\n this._fetchPageChunks(i);\n }\n\n this._removePageFromBuffer(start - 1);\n this._removePageFromBuffer(end + 1);\n }\n\n /**\n * @param {number} index\n */\n _removePageFromBuffer(index) {\n delete this._bufferingPages[index];\n delete this._bufferedPages[index];\n }\n\n /**\n * Fetches the chunks on a page; checks the buffer, so it won't make unnecessary\n * requests if it's called multiple times for the same index.\n * @param {number} index\n * @return {Promise<PageChunk[]>}\n */\n _fetchPageChunks(index) {\n if (index in this._bufferingPages) return this._bufferingPages[index];\n if (index in this._bufferedPages) return Promise.resolve(this._bufferedPages[index]);\n\n this._bufferingPages[index] = this._fetchPageChunksDirect(index)\n .then(chunks => {\n delete this._bufferingPages[index];\n this._bufferedPages[index] = chunks;\n return chunks;\n });\n\n return this._bufferingPages[index];\n }\n\n /**\n * Fetches a page without checking buffer\n * @param {number} index\n */\n _fetchPageChunksDirect(index) {\n return PageChunk.fetch(this.opts.server, this.opts.bookPath, index);\n }\n}\n\nPageChunkIterator.AT_END = \"__PageChunkIterator.AT_END__\";\n\n/** @type {PageChunkIteratorOptions} */\nconst DEFAULT_OPTS = {\n server: null,\n bookPath: null,\n pageBufferSize: 2,\n};\n\n/**\n * @typedef {Object} PageChunkIteratorOptions\n * @property {string} server\n * @property {string} bookPath\n * @property {number} [pageBufferSize] number of pages to buffer before/after the current page\n */\n","import langs from 'iso-language-codes/js/data.js';\n\n/**\n * Use regex to approximate word count in a string\n * @param {string} text\n * @return {number}\n */\nexport function approximateWordCount(text) {\n const m = text.match(/\\S+/g);\n return m ? m.length : 0;\n}\n\n/**\n * Checks whether the current browser is on android\n * @param {string} [userAgent]\n * @return {boolean}\n */\nexport function isAndroid(userAgent = navigator.userAgent) {\n return /android/i.test(userAgent);\n}\n\n/**\n * @typedef {string} ISO6391\n * Language code in ISO 639-1 format. e.g. en, fr, zh\n **/\n\n/** Each lang is an array, with each index mapping to a different property */\nconst COLUMN_TO_LANG_INDEX = {\n 'Name': 0,\n 'Endonym': 1,\n 'ISO 639-1': 2,\n 'ISO 639-2/T': 3,\n 'ISO 639-2/B': 4\n};\n\n/**\n * @param {string} language in some format\n * @return {ISO6391?}\n */\nexport function toISO6391(language) {\n if (!language) return null;\n language = language.toLowerCase();\n\n return searchForISO6391(language, ['ISO 639-1']) ||\n searchForISO6391(language, ['ISO 639-2/B']) ||\n searchForISO6391(language, ['ISO 639-2/T', 'Endonym', 'Name']);\n}\n\n/**\n * Searches for the given long in the given columns.\n * @param {string} language\n * @param {Array<keyof COLUMN_TO_LANG_INDEX>} columnsToSearch\n * @return {ISO6391?}\n */\nfunction searchForISO6391(language, columnsToSearch) {\n for (let i = 0; i < langs.length; i++) {\n for (let colI = 0; colI < columnsToSearch.length; colI++) {\n const column = columnsToSearch[colI];\n const columnValue = langs[i][COLUMN_TO_LANG_INDEX[column]];\n if (columnValue.split(', ').map(x => x.toLowerCase()).indexOf(language) != -1) {\n return langs[i][COLUMN_TO_LANG_INDEX['ISO 639-1']];\n }\n }\n }\n return null;\n}\n\n/**\n * Checks whether the current browser supports localStorage or\n * if the current context has access to it.\n * @return {boolean}\n */\nexport function hasLocalStorage() {\n try {\n return !!window.localStorage;\n } catch (e) {\n // Will throw in sandboxed iframe\n // DOMException: Window.localStorage getter: Forbidden in a sandboxed document without the 'allow-same-origin' flag.\n return false;\n }\n}\n","import PageChunkIterator from './PageChunkIterator.js';\nimport { hasLocalStorage } from './utils.js';\n/** @typedef {import('./utils.js').ISO6391} ISO6391 */\n/** @typedef {import('./PageChunk.js')} PageChunk */\n\n/**\n * @export\n * @typedef {Object} TTSEngineOptions\n * @property {String} server\n * @property {String} bookPath\n * @property {ISO6391} bookLanguage\n * @property {Function} onLoadingStart\n * @property {Function} onLoadingComplete\n * @property {Function} onDone called when the entire book is done\n * @property {function(PageChunk): PromiseLike} beforeChunkPlay will delay the playing of the chunk\n * @property {function(PageChunk): void} afterChunkPlay fires once a chunk has fully finished\n */\n\n/**\n * @typedef {Object} AbstractTTSSound\n * @property {PageChunk} chunk\n * @property {boolean} loaded\n * @property {number} rate\n * @property {SpeechSynthesisVoice} voice\n * @property {(callback: Function) => void} load\n * @property {() => PromiseLike} play\n * @property {() => Promise} stop\n * @property {() => void} pause\n * @property {() => void} resume\n * @property {() => void} finish force the sound to 'finish'\n * @property {number => void} setPlaybackRate\n * @property {SpeechSynthesisVoice => void} setVoice\n **/\n\n/** Handling bookreader's text-to-speech */\nexport default class AbstractTTSEngine {\n /**\n * @protected\n * @param {TTSEngineOptions} options\n */\n constructor(options) {\n this.playing = false;\n this.paused = false;\n this.opts = options;\n /** @type {PageChunkIterator} */\n this._chunkIterator = null;\n /** @type {AbstractTTSSound} */\n this.activeSound = null;\n this.playbackRate = 1;\n /** Events we can bind to */\n this.events = $({});\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n // Listen for voice changes (fired by subclasses)\n this.events.on('voiceschanged', this.updateBestVoice);\n this.events.trigger('voiceschanged');\n }\n\n /**\n * @abstract\n * @return {boolean}\n */\n static isSupported() { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @abstract\n * @return {SpeechSynthesisVoice[]}\n */\n getVoices() { throw new Error(\"Unimplemented abstract class\"); }\n\n /** @abstract */\n init() { return null; }\n\n updateBestVoice = () => {\n this.voice = AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n }\n\n /**\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n this.playing = true;\n this.paused = false;\n this.opts.onLoadingStart();\n\n this._chunkIterator = new PageChunkIterator(numLeafs, leafIndex, {\n server: this.opts.server,\n bookPath: this.opts.bookPath,\n pageBufferSize: 5,\n });\n\n this.step();\n this.events.trigger('start');\n }\n\n stop() {\n if (this.activeSound) this.activeSound.stop();\n this.playing = false;\n this.paused = true;\n this._chunkIterator = null;\n this.activeSound = null;\n this.events.trigger('stop');\n }\n\n /** @public */\n pause() {\n const fireEvent = !this.paused && this.activeSound;\n this.paused = true;\n if (this.activeSound) this.activeSound.pause();\n if (fireEvent) this.events.trigger('pause');\n }\n\n /** @public */\n resume() {\n const fireEvent = this.paused && this.activeSound;\n this.paused = false;\n if (this.activeSound) this.activeSound.resume();\n if (fireEvent) this.events.trigger('resume');\n }\n\n togglePlayPause() {\n if (this.paused) this.resume();\n else this.pause();\n }\n\n /** @public */\n jumpForward() {\n if (this.activeSound) this.activeSound.finish();\n }\n\n /** @public */\n async jumpBackward() {\n await Promise.all([\n this.activeSound.stop(),\n this._chunkIterator.decrement()\n .then(() => this._chunkIterator.decrement())\n ]);\n this.step();\n }\n\n /** @param {string} voiceURI */\n setVoice(voiceURI) {\n // if the user actively selects a voice, don't re-choose best voice anymore\n // MS Edge fires voices changed randomly very often\n this.events.off('voiceschanged', this.updateBestVoice);\n this.voice = this.getVoices().find(voice => voice.voiceURI === voiceURI);\n // if the current book has a language set, store the selected voice with the book language as a suffix\n if (this.opts.bookLanguage && hasLocalStorage()) {\n localStorage.setItem(`BRtts-voice-${this.opts.bookLanguage}`, this.voice.voiceURI);\n }\n if (this.activeSound) this.activeSound.setVoice(this.voice);\n }\n\n /** @param {number} newRate */\n setPlaybackRate(newRate) {\n this.playbackRate = newRate;\n if (this.activeSound) this.activeSound.setPlaybackRate(newRate);\n }\n\n /** @private */\n async step() {\n const chunk = await this._chunkIterator.next();\n if (chunk == PageChunkIterator.AT_END) {\n this.stop();\n this.opts.onDone();\n return;\n }\n this.opts.onLoadingStart();\n const sound = this.createSound(chunk);\n sound.chunk = chunk;\n sound.rate = this.playbackRate;\n sound.voice = this.voice;\n sound.load(() => this.opts.onLoadingComplete());\n\n this.opts.onLoadingComplete();\n\n await this.opts.beforeChunkPlay(chunk);\n\n if (!this.playing) return;\n\n const playPromise = await this.playSound(sound)\n .then(()=> this.opts.afterChunkPlay(sound.chunk));\n\n if (this.paused) this.pause();\n await playPromise;\n\n if (this.playing) return this.step();\n }\n\n /**\n * @abstract\n * @param {PageChunk} chunk\n * @return {AbstractTTSSound}\n */\n createSound(chunk) { throw new Error(\"Unimplemented abstract class\"); }\n\n /**\n * @param {AbstractTTSSound} sound\n * @return {PromiseLike} promise called once playing finished\n */\n playSound(sound) {\n this.activeSound = sound;\n if (!this.activeSound.loaded) this.opts.onLoadingStart();\n return this.activeSound.play();\n }\n\n /** Convenience wrapper for {@see AbstractTTSEngine.getBestVoice} */\n getBestVoice() {\n return AbstractTTSEngine.getBestBookVoice(this.getVoices(), this.opts.bookLanguage);\n }\n\n /**\n * @private\n * Find the best voice to use given the available voices, the book language, and the user's\n * languages.\n * @param {SpeechSynthesisVoice[]} voices\n * @param {ISO6391} bookLanguage\n * @param {string[]} userLanguages languages in BCP47 format (e.g. en-US). Ordered by preference.\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getBestBookVoice(voices, bookLanguage, userLanguages = navigator.languages) {\n const bookLangVoices = voices.filter(v => v.lang.startsWith(bookLanguage));\n // navigator.languages browser support isn't great yet, so get just 1 language otherwise\n // Sample navigator.languages: [\"en-CA\", \"fr-CA\", \"fr\", \"en-US\", \"en\", \"de-DE\", \"de\"]\n userLanguages = userLanguages || (navigator.language ? [navigator.language] : []);\n\n // user languages that match the book language\n const matchingUserLangs = userLanguages.filter(lang => lang.startsWith(bookLanguage));\n\n // First try to find the last chosen voice from localStorage for the current book language\n return AbstractTTSEngine.getMatchingStoredVoice(bookLangVoices, bookLanguage)\n // Try to find voices that intersect these two sets\n || AbstractTTSEngine.getMatchingVoice(matchingUserLangs, bookLangVoices)\n // no user languages match the books; let's return the best voice for the book language\n || (bookLangVoices.find(v => v.default) || bookLangVoices[0])\n // No voices match the book language? let's find a voice in the user's language\n // and ignore book lang\n || AbstractTTSEngine.getMatchingVoice(userLanguages, voices)\n // C'mon! Ok, just read with whatever we got!\n || (voices.find(v => v.default) || voices[0]);\n }\n\n /**\n * @private\n * Get the voice last selected by the user for the book language from localStorage.\n * Returns undefined if no voice is stored or found.\n * @param {SpeechSynthesisVoice[]} voices browser voices to choose from\n * @param {ISO6391} bookLanguage book language to look for\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getMatchingStoredVoice(voices, bookLanguage) {\n const storedVoice = hasLocalStorage() && localStorage.getItem(`BRtts-voice-${bookLanguage}`);\n return (storedVoice ? voices.find(v => v.voiceURI === storedVoice) : undefined);\n }\n\n /**\n * @private\n * Get the best voice that matches one of the BCP47 languages (order by preference)\n * @param {string[]} languages in BCP 47 format (e.g. 'en-US', or 'en'); ordered by preference\n * @param {SpeechSynthesisVoice[]} voices voices to choose from\n * @return {SpeechSynthesisVoice | undefined}\n */\n static getMatchingVoice(languages, voices) {\n for (const lang of languages) {\n // Chrome Android was returning voice languages like `en_US` instead of `en-US`\n const matchingVoices = voices.filter(v => v.lang.replace('_', '-').startsWith(lang));\n if (matchingVoices.length) {\n return matchingVoices.find(v => v.default) || matchingVoices[0];\n }\n }\n }\n}\n","import AbstractTTSEngine from './AbstractTTSEngine.js';\nimport { sleep } from '../../BookReader/utils.js';\n/* global soundManager */\nimport 'soundmanager2';\nimport 'jquery.browser';\n\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Festival endpoint\n **/\nexport default class FestivalTTSEngine extends AbstractTTSEngine {\n /** @override */\n static isSupported() {\n return typeof(soundManager) !== 'undefined' && soundManager.supported();\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n // $.browsers is sometimes undefined on some Android browsers :/\n // Likely related to when $.browser was moved to npm\n /** @type {'mp3' | 'ogg'} format of audio to get */\n this.audioFormat = $.browser?.mozilla ? 'ogg' : 'mp3'; //eslint-disable-line no-jquery/no-browser\n }\n\n /** @override */\n getVoices() {\n return [\n { default: true, lang: \"en-US\", localService: false, name: \"Festival - English (US)\", voiceURI: null }\n ];\n }\n\n /** @override */\n init() {\n // setup sound manager\n soundManager.setup({\n debugMode: false,\n // Note, there's a bug in Chrome regarding range requests.\n // Flash is used as a workaround.\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=505707\n preferFlash: true,\n url: '/bookreader/BookReader/soundmanager/swf',\n useHTML5Audio: true,\n //flash 8 version of swf is buggy when calling play() on a sound that is still loading\n flashVersion: 9\n });\n }\n\n /**\n * @override\n * @param {number} leafIndex\n * @param {number} numLeafs total number of leafs in the current book\n */\n start(leafIndex, numLeafs) {\n let promise = null;\n\n // Hack for iOS\n if (navigator.userAgent.match(/mobile/i)) {\n promise = this.iOSCaptureUserIntentHack();\n }\n\n promise = promise || Promise.resolve();\n promise.then(() => super.start(leafIndex, numLeafs));\n }\n\n /** @override */\n createSound(chunk) {\n return new FestivalTTSSound(this.getSoundUrl(chunk.text));\n }\n\n /**\n * @private\n * Get URL for audio that says this text\n * @param {String} dataString the thing to say\n * @return {String} url\n */\n getSoundUrl(dataString) {\n return 'https://' + this.opts.server + '/BookReader/BookReaderGetTTS.php?string='\n + encodeURIComponent(dataString)\n + '&format=.' + this.audioFormat;\n }\n\n /**\n * @private\n * Security restrictions require playback to be triggered\n * by a user click/touch. This intention gets lost in the async calls\n * on iOS, but, for some reason, if we start the audio here, it works.\n * See https://stackoverflow.com/questions/12206631/html5-audio-cant-play-through-javascript-unless-triggered-manually-once\n * @return {PromiseLike}\n */\n async iOSCaptureUserIntentHack() {\n const sound = soundManager.createSound({ url: SILENCE_1MS[this.audioFormat] });\n await new Promise(res => sound.play({onfinish: res}));\n sound.destruct();\n }\n}\n\n/** @extends AbstractTTSSound */\nclass FestivalTTSSound {\n /** @param {string} soundUrl **/\n constructor(soundUrl) {\n this.soundUrl = soundUrl;\n /** @type {SMSound} */\n this.sound = null;\n this.rate = 1;\n /** @type {function} calling this resolves the \"play\" promise */\n this._finishResolver = null;\n }\n\n get loaded() {\n return this.sound && this.sound.loaded;\n }\n\n load(onload) {\n this.sound = soundManager.createSound({\n url: this.soundUrl,\n // API recommended, but only fires once play started on safari\n onload: () => {\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n onload();\n },\n onresume: async () => {\n await sleep(25);\n if (this.rate != 1) this.sound.setPlaybackRate(this.rate);\n }\n });\n return this.sound.load();\n }\n\n async play() {\n await new Promise(res => {\n this._finishResolver = res;\n this.sound.play({ onfinish: res });\n });\n this.sound.destruct();\n }\n\n /** @override */\n stop() {\n this.sound.stop();\n return Promise.resolve();\n }\n\n /** @override */\n pause() { this.sound.pause(); }\n /** @override */\n resume() { this.sound.resume(); }\n /** @override */\n setPlaybackRate(rate) {\n this.rate = rate;\n this.sound.setPlaybackRate(rate);\n }\n\n /** @override */\n finish() {\n this.sound.stop();\n this._finishResolver();\n }\n}\n\n/** Needed to capture the audio context for iOS hack. Generated using Audacity. */\nconst SILENCE_1MS = {\n mp3: 'data:audio/mp3;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAAWGluZwAAAA8AAAACAAACcQCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA//////////////////////////////////////////////////////////////////8AAAAeTEFNRTMuOTlyBJwAAAAAAAAAADUgJAaUQQABrgAAAnHIf8sZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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FFNSa+icYoxRT51jSjHDrJRWSiiRgtJyrLV2zAEAACAIADAQITOBQAEUGMgAgAOEBCkAoLDA0DFcBATkEjIKDArHhHPSaQMAEITIDJGIWAwSE6qBomI6AFhcYMgHgAyNjbSLC+gywAVd3HUghCAEIYjFARSQgIMTbnjiDU+4wQk6RaUOAgAAAAAAAQAeAACSDSAiIpo5jg6PD5AQkRGSEpMTlAAAAAAA4AGADwCAJAWIiIhmjqPD4wMkRGSEpMTkBCUAAAAAAAAAAAAICAgAAAAAAAQAAAAICE9nZ1MABCwAAAAAAAAAFRIAAAIAAAAPBTD1AgEBAAo=',\n};\n","/* global br */\nimport { isChrome, isFirefox } from '../../util/browserSniffing.js';\nimport { isAndroid } from './utils.js';\nimport { promisifyEvent, sleep } from '../../BookReader/utils.js';\nimport AbstractTTSEngine from './AbstractTTSEngine.js';\n/** @typedef {import(\"./AbstractTTSEngine.js\").PageChunk} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\").AbstractTTSSound} AbstractTTSSound */\n/** @typedef {import(\"./AbstractTTSEngine.js\").TTSEngineOptions} TTSEngineOptions */\n\n/**\n * @extends AbstractTTSEngine\n * TTS using Web Speech APIs\n **/\nexport default class WebTTSEngine extends AbstractTTSEngine {\n static isSupported() {\n return typeof(window.speechSynthesis) !== 'undefined' && !/samsungbrowser/i.test(navigator.userAgent);\n }\n\n /** @param {TTSEngineOptions} options */\n constructor(options) {\n super(options);\n\n // SAFARI doesn't have addEventListener on speechSynthesis\n if (speechSynthesis.addEventListener) {\n speechSynthesis.addEventListener('voiceschanged', () => this.events.trigger('voiceschanged'));\n }\n }\n\n /** @override */\n start(leafIndex, numLeafs) {\n // Need to run in this function to capture user intent to start playing audio\n if ('mediaSession' in navigator) {\n const audio = new Audio(SILENCE_6S_MP3);\n audio.loop = true;\n\n this.events.on('pause', () => audio.pause());\n this.events.on('resume', () => audio.play());\n // apparently this is what you need to do to make the media session notification go away\n // See https://developers.google.com/web/updates/2017/02/media-session#implementation_notes\n this.events.on('stop', () => audio.src = '');\n audio.play().then(() => {\n navigator.mediaSession.metadata = new MediaMetadata({\n title: br.bookTitle,\n artist: br.options.metadata.filter(m => m.label == 'Author').map(m => m.value)[0],\n // album: 'The Ultimate Collection (Remastered)',\n artwork: [\n { src: br.options.thumbnail, type: 'image/jpg' },\n ]\n });\n\n navigator.mediaSession.setActionHandler('play', () => {\n audio.play();\n this.resume();\n });\n navigator.mediaSession.setActionHandler('pause', () => {\n audio.pause();\n this.pause();\n });\n\n // navigator.mediaSession.setActionHandler('seekbackward', () => this.jumpBackward());\n // navigator.mediaSession.setActionHandler('seekforward', () => this.jumpForward());\n // Some devices only support the previoustrack/nexttrack (e.g. Win10), so show those.\n // Android devices do support the seek actions, but we don't want to show both buttons\n // and have them do the same thing.\n navigator.mediaSession.setActionHandler('previoustrack', () => this.jumpBackward());\n navigator.mediaSession.setActionHandler('nexttrack', () => this.jumpForward());\n });\n }\n\n return super.start(leafIndex, numLeafs);\n }\n\n /** @override */\n getVoices() {\n const voices = speechSynthesis.getVoices();\n if (voices.filter(v => v.default).length != 1) {\n // iOS bug where the default system voice is sometimes\n // missing from the list\n voices.unshift({\n voiceURI: 'bookreader.SystemDefault',\n name: 'System Default',\n // Not necessarily true, but very likely\n lang: navigator.language,\n default: true,\n localService: true,\n });\n }\n return voices;\n }\n\n /** @override */\n createSound(chunk) {\n return new WebTTSSound(chunk.text);\n }\n}\n\n/** @extends AbstractTTSSound */\nexport class WebTTSSound {\n /** @param {string} text **/\n constructor(text) {\n this.text = text;\n this.loaded = false;\n this.paused = false;\n this.started = false;\n /** Whether the audio was stopped with a .stop() call */\n this.stopped = false;\n this.rate = 1;\n\n /** @type {SpeechSynthesisUtterance} */\n this.utterance = null;\n\n /** @type {SpeechSynthesisVoice} */\n this.voice = null;\n\n this._lastEvents = {\n /** @type {SpeechSynthesisEvent} */\n pause: null,\n /** @type {SpeechSynthesisEvent} */\n boundary: null,\n /** @type {SpeechSynthesisEvent} */\n start: null,\n };\n\n /** Store where we are in the text. Only works on some browsers. */\n this._charIndex = 0;\n\n /** @type {Function} resolve function called when playback finished */\n this._finishResolver = null;\n\n /** @type {Promise} promise resolved by _finishResolver */\n this._finishPromise = null;\n }\n\n /** @override **/\n load(onload) {\n this.loaded = false;\n this.started = false;\n\n this.utterance = new SpeechSynthesisUtterance(this.text.slice(this._charIndex));\n // iOS bug where the default system voice is sometimes\n // missing from the list\n if (this.voice?.voiceURI !== 'bookreader.SystemDefault') {\n this.utterance.voice = this.voice;\n }\n // Need to also set lang (for some reason); won't set voice on Chrome@Android otherwise\n if (this.voice) this.utterance.lang = this.voice.lang;\n this.utterance.rate = this.rate;\n\n // Useful for debugging things\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n this.utterance.addEventListener('pause', () => console.log('pause'));\n this.utterance.addEventListener('resume', () => console.log('resume'));\n this.utterance.addEventListener('start', () => console.log('start'));\n this.utterance.addEventListener('end', () => console.log('end'));\n this.utterance.addEventListener('error', () => console.log('error'));\n this.utterance.addEventListener('boundary', () => console.log('boundary'));\n this.utterance.addEventListener('mark', () => console.log('mark'));\n this.utterance.addEventListener('finish', () => console.log('finish'));\n }\n\n // Keep track of the speech synthesis events that come in; they have useful info\n // about progress (like charIndex)\n this.utterance.addEventListener('start', ev => this._lastEvents.start = ev);\n this.utterance.addEventListener('boundary', ev => this._lastEvents.boundary = ev);\n this.utterance.addEventListener('pause', ev => this._lastEvents.pause = ev);\n\n // Update our state\n this.utterance.addEventListener('start', () => {\n this.started = true;\n this.stopped = false;\n this.paused = false;\n });\n this.utterance.addEventListener('pause', () => this.paused = true);\n this.utterance.addEventListener('resume', () => this.paused = false);\n this.utterance.addEventListener('end', ev => {\n if (!this.paused && !this.stopped) {\n // Trigger a new event, finish, which only fires when audio fully completed\n this.utterance.dispatchEvent(new CustomEvent('finish', ev));\n }\n });\n this.loaded = true;\n onload && onload();\n }\n\n /**\n * Run whenever properties have changed. Tries to restart in the same spot it\n * left off.\n * @return {Promise<void>}\n */\n async reload() {\n // We'll restore the pause state, so copy it here\n const wasPaused = this.paused;\n // Use recent event to determine where we'll restart from\n // Browser support for this is mixed, but it degrades to restarting the chunk\n // and that's ok\n const recentEvent = this._lastEvents.boundary || this._lastEvents.pause;\n if (recentEvent) {\n this._charIndex = this.text.indexOf(recentEvent.target.text) + recentEvent.charIndex;\n }\n\n // We can't modify the utterance object, so we have to make a new one\n await this.stop();\n this.load();\n // Instead of playing and immediately pausing, we don't start playing. Note\n // this is a requirement because pause doesn't work consistently across\n // browsers.\n if (!wasPaused) this.play();\n }\n\n play() {\n this._finishPromise = this._finishPromise || new Promise(res => this._finishResolver = res);\n this.utterance.addEventListener('finish', this._finishResolver);\n\n // clear the queue\n speechSynthesis.cancel();\n // reset pause state\n speechSynthesis.resume();\n // Speak\n speechSynthesis.speak(this.utterance);\n\n const isLocalVoice = this.utterance.voice && this.utterance.voice.localService;\n if (isChrome() && !isLocalVoice) this._chromePausingBugFix();\n\n return this._finishPromise;\n }\n\n /** @return {Promise} */\n stop() {\n // 'end' won't fire if already stopped\n let endPromise = Promise.resolve();\n if (!this.stopped) {\n endPromise = Promise.race([\n promisifyEvent(this.utterance, 'end'),\n // Safari triggers an error when you call cancel mid-sound\n promisifyEvent(this.utterance, 'error'),\n ]);\n }\n this.stopped = true;\n speechSynthesis.cancel();\n return endPromise;\n }\n\n async finish() {\n await this.stop();\n this.utterance.dispatchEvent(new Event('finish'));\n }\n\n /**\n * @override\n * Will fire a pause event unless already paused\n **/\n async pause() {\n if (this.paused) return;\n\n const pausePromise = promisifyEvent(this.utterance, 'pause');\n speechSynthesis.pause();\n\n // There are a few awful browser cases:\n // 1. Pause works and fires\n // 2. Pause doesn't work and doesn't fire\n // 3. Pause works but doesn't fire\n const pauseMightNotWork = (isFirefox() && isAndroid());\n const pauseMightNotFire = isChrome() || pauseMightNotWork;\n\n if (pauseMightNotFire) {\n // wait for it just in case\n const timeoutPromise = sleep(100).then(() => 'timeout');\n const result = await Promise.race([pausePromise, timeoutPromise]);\n // We got our pause event; nothing to do!\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('pause', this._lastEvents.start));\n\n // if pause might not work, then we'll stop entirely and restart later\n if (pauseMightNotWork) this.stop();\n }\n }\n\n async resume() {\n if (!this.started) {\n this.play();\n return;\n }\n\n if (!this.paused) return;\n\n // Browser cases:\n // 1. Resume works + fires\n // 2. Resume works + doesn't fire (Chrome Desktop)\n // 3. Resume doesn't work + doesn't fire (Chrome/FF Android)\n const resumeMightNotWork = (isChrome() && isAndroid()) || (isFirefox() && isAndroid());\n const resumeMightNotFire = isChrome() || resumeMightNotWork;\n\n // Try resume\n const resumePromise = promisifyEvent(this.utterance, 'resume');\n speechSynthesis.resume();\n\n if (resumeMightNotFire) {\n const result = await Promise.race([resumePromise, sleep(100).then(() => 'timeout')]);\n\n if (result != 'timeout') return;\n\n this.utterance.dispatchEvent(new CustomEvent('resume', {}));\n if (resumeMightNotWork) {\n await this.reload();\n this.play();\n }\n }\n }\n\n setPlaybackRate(rate) {\n this.rate = rate;\n this.reload();\n }\n\n /** @param {SpeechSynthesisVoice} voice */\n setVoice(voice) {\n this.voice = voice;\n this.reload();\n }\n /**\n * @private\n * Chrome has a bug where it only plays 15 seconds of TTS and then\n * suddenly stops (see https://bugs.chromium.org/p/chromium/issues/detail?id=679437 )\n * We avoid this (as described here: https://bugs.chromium.org/p/chromium/issues/detail?id=679437#c15 )\n * by pausing after 14 seconds and ~instantly resuming.\n */\n async _chromePausingBugFix() {\n const timeoutPromise = sleep(14000).then(() => 'timeout');\n const pausePromise = promisifyEvent(this.utterance, 'pause').then(() => 'paused');\n const endPromise = promisifyEvent(this.utterance, 'end').then(() => 'ended');\n const result = await Promise.race([timeoutPromise, pausePromise, endPromise]);\n if (location.toString().indexOf('_debugReadAloud=true') != -1) {\n console.log(`CHROME-PAUSE-HACK: ${result}`);\n }\n switch (result) {\n case 'ended':\n // audio was stopped/finished; nothing to do\n break;\n case 'paused':\n // audio was paused; wait for resume\n // Chrome won't let you resume the audio if 14s have passed 🤷\n // We could do the same as before (but resume+pause instead of pause+resume),\n // but that means we'd _constantly_ be running in the background. So in that\n // case, let's just restart the chunk\n await Promise.race([\n promisifyEvent(this.utterance, 'resume'),\n sleep(14000).then(() => 'timeout'),\n ]);\n result == 'timeout' ? this.reload() : this._chromePausingBugFix();\n break;\n case 'timeout':\n // We hit Chrome's secret cut off time. Pause/resume\n // to be able to keep TTS-ing\n speechSynthesis.pause();\n await sleep(25);\n speechSynthesis.resume();\n this._chromePausingBugFix();\n break;\n }\n }\n}\n\n/**\n * According to https://developers.google.com/web/updates/2017/02/media-session#implementation_notes , it needs to be at least 5 seconds\n * long to allow usage of the media sessions api\n */\nconst SILENCE_6S_MP3 = 'data:audio/mp3;base64,/+MYxAAMEAISSAhElhIpJYzz1vz9mUdlHvJwTP/n3FJesPxB9/8mp0oGaz9+7+T//8oCDhJqOMqLh4o4uhUAUUDaf//3r+///+MYxAoKy2ImKAgEqbfr/t///27/+n3s32/////+b5qMsq7vnXCKh2By3ZcIqyrUYbbRH0fp+ljtf+n2Uo72PHX/03f0df///+MYxBkKUAYmQAhEAL+2l44oKFjZMwJAOJnhguMqokFAqBKl/5f1/+f+3/v////9GT//r+//v+//////b1VvucaRChqnMqsY/+MYxCoLo2IiSAgEpRrgIRVq//p////25nlpVFbQ9kuXtrpt+n//3ZUZNKHVTHdJk3Q6h961DAU8loFlsfTnTZYLLQ1xiIYC/+MYxDYLa2YYAACNFAKKv5swEnqSccBoi//xVP9R/q/370r02////7VpaiWWLrDaF//X8+Rf/6ys2irmURCrI/Lr7///+m1t/+MYxEMKqAI2SAhElh7vNPmHrKdmMPFMimBI5xYQEiIRxh1gk0pKvfo7nezMyH6P67uKW+z/7NusoS/4//STUtCUiwASccAQ/+MYxFMKs2IcIABFEFRhEOUCgACs//l3/6df///+qZf6V9X2t69f/p////+v97UOY7UyyIxZWPa1inCgyCDq//pXpSia2v23/+MYxGMK6AYqSABEAl70RfX2+nu6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/fXz/vlOfvzMv/LWRcWGz16///9fZMlpasVhhHOGxIRbHk8nkkYP+EQKl/+MYxPUPG2IdgAjNozJQByAMF/6//le/y////8/rVl/v5/d/5U98kU2tzl5SITKXk///7Pt5VWhZSMOQqIHZwB0LymkzFFnA/+MYxPMOw2oQAABNEL0pKo025GgSbCS9H7lzLlV58mRTv//3+W8WT//f/7zz5//l/9ki/6////WXFkRjlygC4US7JYQwCIg1/+MYxPMPk1YaQAjNof+3GgQj8XKu+pz/PNeX2//81+BMxLX//nz8/5vXovznf9GZ8kZy//J/t1dPqqsZWQIqK2lF4LBUIAJn/+MYxO8Pq2YdoAlNopA5QImv5P/i4cqmi/y///9DP/mplLdWL/8rZS/qX////m+pfVpWM5jBgJysYxQpTGMYUcygIwYU6qqq/+MYxOsPE14aQAiNoYAwNmLCuoX4szULsxZmoXZiwr/FhX//gIWFSJmtiVCwr3f7P/ioqLCwsLC4qK1MQU1FMy45OS4zVVVV/+MYxOkN614mSAhE31VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOwz4hqAiHo1VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxOwOG1oOIAgEqFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxO4L6AVtkAhEAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';\n","/* global BookReader */\n/**\n * Plugin for Text to Speech in BookReader\n */\nimport FestivalTTSEngine from './FestivalTTSEngine.js';\nimport WebTTSEngine from './WebTTSEngine.js';\nimport { toISO6391, approximateWordCount } from './utils.js';\nimport { en as tooltips } from './tooltip_dict.js';\nimport { renderBoxesInPageContainerLayer } from '../../BookReader/PageContainer.js';\n/** @typedef {import('./PageChunk.js').default} PageChunk */\n/** @typedef {import(\"./AbstractTTSEngine.js\").default} AbstractTTSEngine */\n\n// Default options for TTS\njQuery.extend(BookReader.defaultOptions, {\n server: 'ia600609.us.archive.org',\n bookPath: '',\n enableTtsPlugin: true,\n});\n\n// Extend the constructor to add TTS properties\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n if (this.options.enableTtsPlugin) {\n /** @type { {[pageIndex: number]: Array<{ l: number, r: number, t: number, b: number }>} } */\n this._ttsBoxesByIndex = {};\n\n let TTSEngine = WebTTSEngine.isSupported() ? WebTTSEngine :\n FestivalTTSEngine.isSupported() ? FestivalTTSEngine :\n null;\n\n if (/_forceTTSEngine=(festival|web)/.test(location.toString())) {\n const engineName = location.toString().match(/_forceTTSEngine=(festival|web)/)[1];\n TTSEngine = { festival: FestivalTTSEngine, web: WebTTSEngine }[engineName];\n }\n\n if (TTSEngine) {\n /** @type {AbstractTTSEngine} */\n this.ttsEngine = new TTSEngine({\n server: options.server,\n bookPath: options.bookPath,\n bookLanguage: toISO6391(options.bookLanguage),\n onLoadingStart: this.showProgressPopup.bind(this, 'Loading audio...'),\n onLoadingComplete: this.removeProgressPopup.bind(this),\n onDone: this.ttsStop.bind(this),\n beforeChunkPlay: this.ttsBeforeChunkPlay.bind(this),\n afterChunkPlay: this.ttsSendChunkFinishedAnalyticsEvent.bind(this),\n });\n }\n }\n };\n})(BookReader.prototype.setup);\n\nBookReader.prototype.init = (function(super_) {\n return function() {\n if (this.options.enableTtsPlugin) {\n // Bind to events\n\n this.bind(BookReader.eventNames.PostInit, () => {\n this.$('.BRicon.read').click(() => {\n this.ttsToggle();\n return false;\n });\n if (this.ttsEngine) {\n this.ttsEngine.init();\n if (/[?&]_autoReadAloud=show/.test(location.toString())) {\n this.ttsStart(false); // false flag is to initiate read aloud controls\n }\n }\n });\n\n // This is fired when the hash changes by one of the other plugins!\n // i.e. it will fire every time the page changes -_-\n // this.bind(BookReader.eventNames.stop, function(e, br) {\n // this.ttsStop();\n // }.bind(this));\n }\n super_.call(this);\n };\n})(BookReader.prototype.init);\n\n/** @override */\nBookReader.prototype._createPageContainer = (function (super_) {\n return function (index) {\n const pageContainer = super_.call(this, index);\n if (this.options.enableTtsPlugin && pageContainer.page && index in this._ttsBoxesByIndex) {\n const pageIndex = pageContainer.page.index;\n renderBoxesInPageContainerLayer('ttsHiliteLayer', this._ttsBoxesByIndex[pageIndex], pageContainer.page, pageContainer.$container[0]);\n }\n return pageContainer;\n };\n})(BookReader.prototype._createPageContainer);\n\n// Extend buildMobileDrawerElement\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li>\n <span>\n <span class=\"DrawerIconWrapper\"><img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_speaker_open.svg\" alt=\"info-speaker\"/></span>\n Read Aloud\n </span>\n <div>\n <span class=\"larger\">Press to toggle read aloud</span>\n <br/>\n <button class=\"BRicon read\"></button>\n </div>\n </li>`));\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n// Extend initNavbar\nBookReader.prototype.initNavbar = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.options.enableTtsPlugin && this.ttsEngine) {\n this.refs.$BRReadAloudToolbar = $(`\n <ul class=\"read-aloud\">\n <li>\n <select class=\"playback-speed\" name=\"playback-speed\" title=\"${tooltips.playbackSpeed}\">\n <option value=\"0.25\">0.25x</option>\n <option value=\"0.5\">0.5x</option>\n <option value=\"0.75\">0.75x</option>\n <option value=\"1.0\" selected>1.0x</option>\n <option value=\"1.25\">1.25x</option>\n <option value=\"1.5\">1.5x</option>\n <option value=\"1.75\">1.75x</option>\n <option value=\"2\">2x</option>\n </select>\n </li>\n <li>\n <button type=\"button\" name=\"review\" title=\"${tooltips.review}\">\n <div class=\"icon icon-review\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"play\" title=\"${tooltips.play}\">\n <div class=\"icon icon-play\"></div>\n <div class=\"icon icon-pause\"></div>\n </button>\n </li>\n <li>\n <button type=\"button\" name=\"advance\" title=\"${tooltips.advance}\">\n <div class=\"icon icon-advance\"></div>\n </button>\n </li>\n <li>\n <select class=\"playback-voices\" name=\"playback-voice\" style=\"display: none\" title=\"Change read aloud voices\">\n </select>\n </li>\n </ul>\n `);\n\n $el.find('.BRcontrols').prepend(this.refs.$BRReadAloudToolbar);\n\n const renderVoiceOption = (voices) => {\n return voices.map(voice =>\n `<option value=\"${voice.voiceURI}\">${voice.lang} - ${voice.name}</option>`).join('');\n };\n\n const voiceSortOrder = (a,b) => `${a.lang} - ${a.name}`.localeCompare(`${b.lang} - ${b.name}`);\n\n const renderVoicesMenu = (voicesMenu) => {\n voicesMenu.empty();\n const bookLanguage = this.ttsEngine.opts.bookLanguage;\n const bookLanguages = this.ttsEngine.getVoices().filter(v => v.lang.startsWith(bookLanguage)).sort(voiceSortOrder);\n const otherLanguages = this.ttsEngine.getVoices().filter(v => !v.lang.startsWith(bookLanguage)).sort(voiceSortOrder);\n\n if (this.ttsEngine.getVoices().length > 1) {\n voicesMenu.append($(`<optgroup label=\"Book Language (${bookLanguage})\"> ${renderVoiceOption(bookLanguages)} </optgroup>`));\n voicesMenu.append($(`<optgroup label=\"Other Languages\"> ${renderVoiceOption(otherLanguages)} </optgroup>`));\n\n voicesMenu.val(this.ttsEngine.voice.voiceURI);\n voicesMenu.show();\n } else {\n voicesMenu.hide();\n }\n };\n\n const voicesMenu = this.refs.$BRReadAloudToolbar.find('[name=playback-voice]');\n renderVoicesMenu(voicesMenu);\n voicesMenu.on(\"change\", ev => this.ttsEngine.setVoice(voicesMenu.val()));\n this.ttsEngine.events.on('pause resume start', () => this.ttsUpdateState());\n this.ttsEngine.events.on('voiceschanged', () => renderVoicesMenu(voicesMenu));\n this.refs.$BRReadAloudToolbar.find('[name=play]').on(\"click\", this.ttsPlayPause.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=advance]').on(\"click\", this.ttsJumpForward.bind(this));\n this.refs.$BRReadAloudToolbar.find('[name=review]').on(\"click\", this.ttsJumpBackward.bind(this));\n const $rateSelector = this.refs.$BRReadAloudToolbar.find('select[name=\"playback-speed\"]');\n $rateSelector.on(\"change\", ev => this.ttsEngine.setPlaybackRate(parseFloat($rateSelector.val())));\n $(`<li>\n <button class=\"BRicon read js-tooltip\" title=\"${tooltips.readAloud}\">\n <div class=\"icon icon-read-aloud\"></div>\n <span class=\"BRtooltip\">${tooltips.readAloud}</span>\n </button>\n </li>`).insertBefore($el.find('.BRcontrols .BRicon.zoom_out').closest('li'));\n }\n return $el;\n };\n})(BookReader.prototype.initNavbar);\n\n// ttsToggle()\n//______________________________________________________________________________\nBookReader.prototype.ttsToggle = function () {\n if (this.autoStop) this.autoStop();\n if (this.ttsEngine.playing) {\n this.ttsStop();\n } else {\n this.ttsStart();\n }\n};\n\n// ttsStart(\n//______________________________________________________________________________\nBookReader.prototype.ttsStart = function (startTTSEngine = true) {\n if (this.constModeThumb == this.mode)\n this.switchMode(this.constMode1up);\n\n this.refs.$BRReadAloudToolbar.addClass('visible');\n this.$('.BRicon.read').addClass('unread active');\n this.ttsSendAnalyticsEvent('Start');\n if (startTTSEngine)\n this.ttsEngine.start(this.currentIndex(), this.book.getNumLeafs());\n};\n\nBookReader.prototype.ttsJumpForward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpForward();\n};\n\nBookReader.prototype.ttsJumpBackward = function () {\n if (this.ttsEngine.paused) {\n this.ttsEngine.resume();\n }\n this.ttsEngine.jumpBackward();\n};\n\nBookReader.prototype.ttsUpdateState = function() {\n const isPlaying = !(this.ttsEngine.paused || !this.ttsEngine.playing);\n this.$('.read-aloud [name=play]').toggleClass('playing', isPlaying);\n};\n\nBookReader.prototype.ttsPlayPause = function() {\n if (!this.ttsEngine.playing) {\n this.ttsToggle();\n } else {\n this.ttsEngine.togglePlayPause();\n this.ttsUpdateState();\n }\n};\n\n// ttsStop()\n//______________________________________________________________________________\nBookReader.prototype.ttsStop = function () {\n this.refs.$BRReadAloudToolbar.removeClass('visible');\n this.$('.BRicon.read').removeClass('unread active');\n this.ttsSendAnalyticsEvent('Stop');\n this.ttsEngine.stop();\n this.ttsRemoveHilites();\n this.removeProgressPopup();\n};\n\n/**\n * @param {PageChunk} chunk\n * @return {PromiseLike<void>} returns once the flip is done\n */\nBookReader.prototype.ttsBeforeChunkPlay = async function(chunk) {\n await this.ttsMaybeFlipToIndex(chunk.leafIndex);\n this.ttsHighlightChunk(chunk);\n this.ttsScrollToChunk(chunk);\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsSendChunkFinishedAnalyticsEvent = function(chunk) {\n this.ttsSendAnalyticsEvent('ChunkFinished-Words', approximateWordCount(chunk.text));\n};\n\n/**\n * Flip the page if the provided leaf index is not visible\n * @param {Number} leafIndex\n */\nBookReader.prototype.ttsMaybeFlipToIndex = async function (leafIndex) {\n if (this.constMode2up != this.mode) {\n this.jumpToIndex(leafIndex);\n } else {\n await this._modes.mode2Up.mode2UpLit.jumpToIndex(leafIndex);\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsHighlightChunk = function(chunk) {\n // The poorly-named variable leafIndex\n const pageIndex = chunk.leafIndex;\n\n this.ttsRemoveHilites();\n\n // group by index; currently only possible to have chunks on one page :/\n this._ttsBoxesByIndex = {\n [pageIndex]: chunk.lineRects.map(([l, b, r, t]) => ({l, r, b, t}))\n };\n\n // update any already created pages\n for (const [pageIndexString, boxes] of Object.entries(this._ttsBoxesByIndex)) {\n const pageIndex = parseFloat(pageIndexString);\n const page = this.book.getPage(pageIndex);\n const pageContainers = this.getActivePageContainerElementsForIndex(pageIndex);\n pageContainers.forEach(container => renderBoxesInPageContainerLayer('ttsHiliteLayer', boxes, page, container));\n }\n};\n\n/**\n * @param {PageChunk} chunk\n */\nBookReader.prototype.ttsScrollToChunk = function(chunk) {\n // It behaves weird if used in thumb mode\n if (this.constModeThumb == this.mode) return;\n\n $(`.pagediv${chunk.leafIndex} .ttsHiliteLayer rect`).last()?.[0]?.scrollIntoView({\n // Only vertically center the highlight if we're in 1up or in full screen. In\n // 2up, if we're not fullscreen, the whole body gets scrolled around to try to\n // center the highlight 🙄 See:\n // https://stackoverflow.com/questions/11039885/scrollintoview-causing-the-whole-page-to-move/11041376\n // Note: nearest doesn't quite work great, because the ReadAloud toolbar is now\n // full-width, and covers up the last line of the highlight.\n block: this.constMode1up == this.mode || this.isFullscreenActive ? 'center' : 'nearest',\n inline: 'center',\n behavior: 'smooth',\n });\n};\n\n// ttsRemoveHilites()\n//______________________________________________________________________________\nBookReader.prototype.ttsRemoveHilites = function () {\n $(this.getActivePageContainerElements()).find('.ttsHiliteLayer').remove();\n this._ttsBoxesByIndex = {};\n};\n\n/**\n * @private\n * Send an analytics event with an optional value. Also attaches the book's language.\n * @param {string} action\n * @param {number} [value]\n */\nBookReader.prototype.ttsSendAnalyticsEvent = function(action, value) {\n if (this.archiveAnalyticsSendEvent) {\n const extraValues = {};\n const mediaLanguage = this.ttsEngine.opts.bookLanguage;\n if (mediaLanguage) extraValues.mediaLanguage = mediaLanguage;\n this.archiveAnalyticsSendEvent('BRReadAloud', action, value, extraValues);\n }\n};\n","export const en = {\n advance: 'Advance 10 seconds',\n play: 'Play',\n playbackSpeed: 'Playback speed',\n readAloud: 'Read this book aloud',\n review: 'Review 10 seconds',\n};\n\nexport const es = {\n advance: 'Avance 10 segundos',\n play: 'Jugar',\n playbackSpeed: 'Velocidad de reproducción',\n readAloud: 'Lee este libro en voz alta',\n review: 'Revisar 10 segundos',\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar _default = [['Serbian', 'српски језик', 'sr', 'srp', 'srp'], ['Romanian, Moldavian, Moldovan', 'Română', 'ro', 'ron', 'rum'], ['Sichuan Yi, Nuosu', 'ꆈꌠ꒿ Nuosuhxop', 'ii', 'iii', 'iii'], ['Tahitian', 'Reo Tahiti', 'ty', 'tah', 'tah'], ['Tagalog', 'Wikang Tagalog', 'tl', 'tgl', 'tgl'], ['Yiddish', 'ייִדיש', 'yi', 'yid', 'yid'], ['Akan', 'Akan', 'ak', 'aka', 'aka'], ['Malay', 'Bahasa Melayu, بهاس ملايو', 'ms', 'msa', 'may'], ['Arabic', 'العربية', 'ar', 'ara', 'ara'], ['Norwegian', 'Norsk', 'no', 'nor', 'nor'], ['Ojibwa', 'ᐊᓂᔑᓈᐯᒧᐎᓐ', 'oj', 'oji', 'oji'], ['Fulah', 'Fulfulde, Pulaar, Pular', 'ff', 'ful', 'ful'], ['Persian', 'فارسی', 'fa', 'fas', 'per'], ['Albanian', 'Shqip', 'sq', 'sqi', 'alb'], ['Aymara', 'aymar aru', 'ay', 'aym', 'aym'], ['Azerbaijani', 'azərbaycan dili', 'az', 'aze', 'aze'], ['Chinese', '中文 (Zhōngwén), 汉语, 漢語', 'zh', 'zho', 'chi'], ['Cree', 'ᓀᐦᐃᔭᐍᐏᐣ', 'cr', 'cre', 'cre'], ['Estonian', 'eesti, eesti keel', 'et', 'est', 'est'], ['Guaraní', 'Avañe\\'ẽ', 'gn', 'grn', 'grn'], ['Inupiaq', 'Iñupiaq, Iñupiatun', 'ik', 'ipk', 'ipk'], ['Inuktitut', 'ᐃᓄᒃᑎᑐᑦ', 'iu', 'iku', 'iku'], ['Kanuri', 'Kanuri', 'kr', 'kau', 'kau'], ['Komi', 'коми кыв', 'kv', 'kom', 'kom'], ['Kongo', 'Kikongo', 'kg', 'kon', 'kon'], ['Kurdish', 'Kurdî, کوردی', 'ku', 'kur', 'kur'], ['Latvian', 'latviešu valoda', 'lv', 'lav', 'lav'], ['Malagasy', 'fiteny malagasy', 'mg', 'mlg', 'mlg'], ['Mongolian', 'Монгол хэл', 'mn', 'mon', 'mon'], ['Oromo', 'Afaan Oromoo', 'om', 'orm', 'orm'], ['Pashto, Pushto', 'پښتو', 'ps', 'pus', 'pus'], ['Quechua', 'Runa Simi, Kichwa', 'qu', 'que', 'que'], ['Sardinian', 'sardu', 'sc', 'srd', 'srd'], ['Swahili', 'Kiswahili', 'sw', 'swa', 'swa'], ['Uzbek', 'Oʻzbek, Ўзбек, أۇزبېك', 'uz', 'uzb', 'uzb'], ['Zhuang, Chuang', 'Saɯ cueŋƅ, Saw cuengh', 'za', 'zha', 'zha'], ['Bislama', 'Bislama', 'bi', 'bis', 'bis'], ['Norwegian Bokmål', 'Norsk Bokmål', 'nb', 'nob', 'nob'], ['Norwegian Nynorsk', 'Norsk Nynorsk', 'nn', 'nno', 'nno'], ['Indonesian', 'Bahasa Indonesia', 'id', 'ind', 'ind'], ['Twi', 'Twi', 'tw', 'twi', 'twi'], ['Esperanto', 'Esperanto', 'eo', 'epo', 'epo'], ['Interlingua', 'Interlingua', 'ia', 'ina', 'ina'], ['Interlingue', 'Originally called Occidental; then Interlingue after WWII', 'ie', 'ile', 'ile'], ['Ido', 'Ido', 'io', 'ido', 'ido'], ['Volapük', 'Volapük', 'vo', 'vol', 'vol'], ['Bihari languages', 'भोजपुरी', 'bh', 'bih', 'bih'], ['Hebrew (modern)', 'עברית', 'he', 'heb', 'heb'], ['Sanskrit', 'संस्कृतम्', 'sa', 'san', 'san'], ['Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian', 'ѩзыкъ словѣньскъ', 'cu', 'chu', 'chu'], ['Pali', 'पाऴि', 'pi', 'pli', 'pli'], ['Avestan', 'avesta', 'ae', 'ave', 'ave'], ['Latin', 'latine, lingua latina', 'la', 'lat', 'lat'], ['Armenian', 'Հայերեն', 'hy', 'hye', 'arm'], ['Swati', 'SiSwati', 'ss', 'ssw', 'ssw'], ['Tibetan', 'བོད་ཡིག', 'bo', 'bod', 'tib'], ['South Ndebele', 'isiNdebele', 'nr', 'nbl', 'nbl'], ['Slovene', 'Slovenski Jezik, Slovenščina', 'sl', 'slv', 'slv'], ['Oriya', 'ଓଡ଼ିଆ', 'or', 'ori', 'ori'], ['North Ndebele', 'isiNdebele', 'nd', 'nde', 'nde'], ['Nauru', 'Dorerin Naoero', 'na', 'nau', 'nau'], ['Maori', 'te reo Māori', 'mi', 'mri', 'mao'], ['Marathi', 'मराठी', 'mr', 'mar', 'mar'], ['Luba-Katanga', 'Kiluba', 'lu', 'lub', 'lub'], ['Rundi', 'Ikirundi', 'rn', 'run', 'run'], ['Central Khmer', 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ', 'km', 'khm', 'khm'], ['Western Frisian', 'Frysk', 'fy', 'fry', 'fry'], ['Bengali', 'বাংলা', 'bn', 'ben', 'ben'], ['Avaric', 'авар мацӀ, магӀарул мацӀ', 'av', 'ava', 'ava'], ['Abkhazian', 'аҧсуа бызшәа, аҧсшәа', 'ab', 'abk', 'abk'], ['Afar', 'Afaraf', 'aa', 'aar', 'aar'], ['Afrikaans', 'Afrikaans', 'af', 'afr', 'afr'], ['Amharic', 'አማርኛ', 'am', 'amh', 'amh'], ['Aragonese', 'aragonés', 'an', 'arg', 'arg'], ['Assamese', 'অসমীয়া', 'as', 'asm', 'asm'], ['Bambara', 'bamanankan', 'bm', 'bam', 'bam'], ['Bashkir', 'башҡорт теле', 'ba', 'bak', 'bak'], ['Basque', 'euskara, euskera', 'eu', 'eus', 'baq'], ['Belarusian', 'беларуская мова', 'be', 'bel', 'bel'], ['Bosnian', 'bosanski jezik', 'bs', 'bos', 'bos'], ['Breton', 'brezhoneg', 'br', 'bre', 'bre'], ['Bulgarian', 'български език', 'bg', 'bul', 'bul'], ['Burmese', 'ဗမာစာ', 'my', 'mya', 'bur'], ['Catalan, Valencian', 'català, valencià', 'ca', 'cat', 'cat'], ['Chamorro', 'Chamoru', 'ch', 'cha', 'cha'], ['Chechen', 'нохчийн мотт', 'ce', 'che', 'che'], ['Chichewa, Chewa, Nyanja', 'chiCheŵa, chinyanja', 'ny', 'nya', 'nya'], ['Chuvash', 'чӑваш чӗлхи', 'cv', 'chv', 'chv'], ['Cornish', 'Kernewek', 'kw', 'cor', 'cor'], ['Corsican', 'corsu, lingua corsa', 'co', 'cos', 'cos'], ['Croatian', 'hrvatski jezik', 'hr', 'hrv', 'hrv'], ['Czech', 'čeština, český jazyk', 'cs', 'ces', 'cze'], ['Danish', 'dansk', 'da', 'dan', 'dan'], ['Divehi, Dhivehi, Maldivian', 'ދިވެހި', 'dv', 'div', 'div'], ['Dutch, Flemish', 'Nederlands, Vlaams', 'nl', 'nld', 'dut'], ['Dzongkha', 'རྫོང་ཁ', 'dz', 'dzo', 'dzo'], ['English', 'English', 'en', 'eng', 'eng'], ['Ewe', 'Eʋegbe', 'ee', 'ewe', 'ewe'], ['Faroese', 'føroyskt', 'fo', 'fao', 'fao'], ['Fijian', 'vosa Vakaviti', 'fj', 'fij', 'fij'], ['Finnish', 'suomi, suomen kieli', 'fi', 'fin', 'fin'], ['French', 'français, langue française', 'fr', 'fra', 'fre'], ['Galician', 'Galego', 'gl', 'glg', 'glg'], ['Georgian', 'ქართული', 'ka', 'kat', 'geo'], ['German', 'Deutsch', 'de', 'deu', 'ger'], ['Greek (modern)', 'ελληνικά', 'el', 'ell', 'gre'], ['Gujarati', 'ગુજરાતી', 'gu', 'guj', 'guj'], ['Haitian, Haitian Creole', 'Kreyòl ayisyen', 'ht', 'hat', 'hat'], ['Hausa', '(Hausa) هَوُسَ', 'ha', 'hau', 'hau'], ['Herero', 'Otjiherero', 'hz', 'her', 'her'], ['Hindi', 'हिन्दी, हिंदी', 'hi', 'hin', 'hin'], ['Hiri Motu', 'Hiri Motu', 'ho', 'hmo', 'hmo'], ['Hungarian', 'magyar', 'hu', 'hun', 'hun'], ['Irish', 'Gaeilge', 'ga', 'gle', 'gle'], ['Igbo', 'Asụsụ Igbo', 'ig', 'ibo', 'ibo'], ['Icelandic', 'Íslenska', 'is', 'isl', 'ice'], ['Italian', 'Italiano', 'it', 'ita', 'ita'], ['Japanese', '日本語 (にほんご)', 'ja', 'jpn', 'jpn'], ['Javanese', 'ꦧꦱꦗꦮ, Basa Jawa', 'jv', 'jav', 'jav'], ['Kalaallisut, Greenlandic', 'kalaallisut, kalaallit oqaasii', 'kl', 'kal', 'kal'], ['Kannada', 'ಕನ್ನಡ', 'kn', 'kan', 'kan'], ['Kashmiri', 'कश्मीरी, كشميري', 'ks', 'kas', 'kas'], ['Kazakh', 'қазақ тілі', 'kk', 'kaz', 'kaz'], ['Kikuyu, Gikuyu', 'Gĩkũyũ', 'ki', 'kik', 'kik'], ['Kinyarwanda', 'Ikinyarwanda', 'rw', 'kin', 'kin'], ['Kirghiz, Kyrgyz', 'Кыргызча, Кыргыз тили', 'ky', 'kir', 'kir'], ['Korean', '한국어', 'ko', 'kor', 'kor'], ['Kuanyama, Kwanyama', 'Kuanyama', 'kj', 'kua', 'kua'], ['Luxembourgish, Letzeburgesch', 'Lëtzebuergesch', 'lb', 'ltz', 'ltz'], ['Ganda', 'Luganda', 'lg', 'lug', 'lug'], ['Limburgan, Limburger, Limburgish', 'Limburgs', 'li', 'lim', 'lim'], ['Lingala', 'Lingála', 'ln', 'lin', 'lin'], ['Lao', 'ພາສາລາວ', 'lo', 'lao', 'lao'], ['Lithuanian', 'lietuvių kalba', 'lt', 'lit', 'lit'], ['Manx', 'Gaelg, Gailck', 'gv', 'glv', 'glv'], ['Macedonian', 'македонски јазик', 'mk', 'mkd', 'mac'], ['Malayalam', 'മലയാളം', 'ml', 'mal', 'mal'], ['Maltese', 'Malti', 'mt', 'mlt', 'mlt'], ['Marshallese', 'Kajin M̧ajeļ', 'mh', 'mah', 'mah'], ['Navajo, Navaho', 'Diné bizaad', 'nv', 'nav', 'nav'], ['Nepali', 'नेपाली', 'ne', 'nep', 'nep'], ['Ndonga', 'Owambo', 'ng', 'ndo', 'ndo'], ['Occitan', 'occitan, lenga d\\'òc', 'oc', 'oci', 'oci'], ['Ossetian, Ossetic', 'ирон æвзаг', 'os', 'oss', 'oss'], ['Panjabi, Punjabi', 'ਪੰਜਾਬੀ', 'pa', 'pan', 'pan'], ['Polish', 'język polski, polszczyzna', 'pl', 'pol', 'pol'], ['Portuguese', 'Português', 'pt', 'por', 'por'], ['Romansh', 'Rumantsch Grischun', 'rm', 'roh', 'roh'], ['Russian', 'русский', 'ru', 'rus', 'rus'], ['Sindhi', 'सिन्धी, سنڌي، سندھی', 'sd', 'snd', 'snd'], ['Northern Sami', 'Davvisámegiella', 'se', 'sme', 'sme'], ['Samoan', 'gagana fa\\'a Samoa', 'sm', 'smo', 'smo'], ['Sango', 'yângâ tî sängö', 'sg', 'sag', 'sag'], ['Gaelic, Scottish Gaelic', 'Gàidhlig', 'gd', 'gla', 'gla'], ['Shona', 'chiShona', 'sn', 'sna', 'sna'], ['Sinhala, Sinhalese', 'සිංහල', 'si', 'sin', 'sin'], ['Slovak', 'Slovenčina, Slovenský Jazyk', 'sk', 'slk', 'slo'], ['Somali', 'Soomaaliga, af Soomaali', 'so', 'som', 'som'], ['Southern Sotho', 'Sesotho', 'st', 'sot', 'sot'], ['Spanish, Castilian', 'Español', 'es', 'spa', 'spa'], ['Sundanese', 'Basa Sunda', 'su', 'sun', 'sun'], ['Swedish', 'Svenska', 'sv', 'swe', 'swe'], ['Tamil', 'தமிழ்', 'ta', 'tam', 'tam'], ['Telugu', 'తెలుగు', 'te', 'tel', 'tel'], ['Tajik', 'тоҷикӣ, toçikī, تاجیکی', 'tg', 'tgk', 'tgk'], ['Thai', 'ไทย', 'th', 'tha', 'tha'], ['Tigrinya', 'ትግርኛ', 'ti', 'tir', 'tir'], ['Turkmen', 'Türkmen, Түркмен', 'tk', 'tuk', 'tuk'], ['Tswana', 'Setswana', 'tn', 'tsn', 'tsn'], ['Tongan (Tonga Islands)', 'Faka Tonga', 'to', 'ton', 'ton'], ['Turkish', 'Türkçe', 'tr', 'tur', 'tur'], ['Tsonga', 'Xitsonga', 'ts', 'tso', 'tso'], ['Tatar', 'татар теле, tatar tele', 'tt', 'tat', 'tat'], ['Uighur, Uyghur', 'ئۇيغۇرچە, Uyghurche', 'ug', 'uig', 'uig'], ['Ukrainian', 'Українська', 'uk', 'ukr', 'ukr'], ['Urdu', 'اردو', 'ur', 'urd', 'urd'], ['Venda', 'Tshivenḓa', 've', 'ven', 'ven'], ['Vietnamese', 'Tiếng Việt', 'vi', 'vie', 'vie'], ['Walloon', 'Walon', 'wa', 'wln', 'wln'], ['Welsh', 'Cymraeg', 'cy', 'cym', 'wel'], ['Wolof', 'Wollof', 'wo', 'wol', 'wol'], ['Xhosa', 'isiXhosa', 'xh', 'xho', 'xho'], ['Yoruba', 'Yorùbá', 'yo', 'yor', 'yor'], ['Zulu', 'isiZulu', 'zu', 'zul', 'zul']];\nexports[\"default\"] = _default;","/*!\n * jQuery Browser Plugin 0.1.0\n * https://github.com/gabceb/jquery-browser-plugin\n *\n * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors\n * http://jquery.org/license\n *\n * Modifications Copyright 2015 Gabriel Cebrian\n * https://github.com/gabceb\n *\n * Released under the MIT license\n *\n * Date: 05-07-2015\n */\n/*global window: false */\n\n(function (factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['jquery'], function ($) {\n return factory($);\n });\n } else if (typeof module === 'object' && typeof module.exports === 'object') {\n // Node-like environment\n module.exports = factory(require('jquery'));\n } else {\n // Browser globals\n factory(window.jQuery);\n }\n}(function(jQuery) {\n \"use strict\";\n\n function uaMatch( ua ) {\n // If an UA is not provided, default to the current browser UA.\n if ( ua === undefined ) {\n ua = window.navigator.userAgent;\n }\n ua = ua.toLowerCase();\n\n var match = /(edge)\\/([\\w.]+)/.exec( ua ) ||\n /(opr)[\\/]([\\w.]+)/.exec( ua ) ||\n /(chrome)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(iemobile)[\\/]([\\w.]+)/.exec( ua ) ||\n /(version)(applewebkit)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+).*(version)[ \\/]([\\w.]+).*(safari)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(webkit)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(opera)(?:.*version|)[ \\/]([\\w.]+)/.exec( ua ) ||\n /(msie) ([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"trident\") >= 0 && /(rv)(?::| )([\\w.]+)/.exec( ua ) ||\n ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec( ua ) ||\n [];\n\n var platform_match = /(ipad)/.exec( ua ) ||\n /(ipod)/.exec( ua ) ||\n /(windows phone)/.exec( ua ) ||\n /(iphone)/.exec( ua ) ||\n /(kindle)/.exec( ua ) ||\n /(silk)/.exec( ua ) ||\n /(android)/.exec( ua ) ||\n /(win)/.exec( ua ) ||\n /(mac)/.exec( ua ) ||\n /(linux)/.exec( ua ) ||\n /(cros)/.exec( ua ) ||\n /(playbook)/.exec( ua ) ||\n /(bb)/.exec( ua ) ||\n /(blackberry)/.exec( ua ) ||\n [];\n\n var browser = {},\n matched = {\n browser: match[ 5 ] || match[ 3 ] || match[ 1 ] || \"\",\n version: match[ 2 ] || match[ 4 ] || \"0\",\n versionNumber: match[ 4 ] || match[ 2 ] || \"0\",\n platform: platform_match[ 0 ] || \"\"\n };\n\n if ( matched.browser ) {\n browser[ matched.browser ] = true;\n browser.version = matched.version;\n browser.versionNumber = parseInt(matched.versionNumber, 10);\n }\n\n if ( matched.platform ) {\n browser[ matched.platform ] = true;\n }\n\n // These are all considered mobile platforms, meaning they run a mobile browser\n if ( browser.android || browser.bb || browser.blackberry || browser.ipad || browser.iphone ||\n browser.ipod || browser.kindle || browser.playbook || browser.silk || browser[ \"windows phone\" ]) {\n browser.mobile = true;\n }\n\n // These are all considered desktop platforms, meaning they run a desktop browser\n if ( browser.cros || browser.mac || browser.linux || browser.win ) {\n browser.desktop = true;\n }\n\n // Chrome, Opera 15+ and Safari are webkit based browsers\n if ( browser.chrome || browser.opr || browser.safari ) {\n browser.webkit = true;\n }\n\n // IE11 has a new token so we will assign it msie to avoid breaking changes\n if ( browser.rv || browser.iemobile) {\n var ie = \"msie\";\n\n matched.browser = ie;\n browser[ie] = true;\n }\n\n // Edge is officially known as Microsoft Edge, so rewrite the key to match\n if ( browser.edge ) {\n delete browser.edge;\n var msedge = \"msedge\";\n\n matched.browser = msedge;\n browser[msedge] = true;\n }\n\n // Blackberry browsers are marked as Safari on BlackBerry\n if ( browser.safari && browser.blackberry ) {\n var blackberry = \"blackberry\";\n\n matched.browser = blackberry;\n browser[blackberry] = true;\n }\n\n // Playbook browsers are marked as Safari on Playbook\n if ( browser.safari && browser.playbook ) {\n var playbook = \"playbook\";\n\n matched.browser = playbook;\n browser[playbook] = true;\n }\n\n // BB10 is a newer OS version of BlackBerry\n if ( browser.bb ) {\n var bb = \"blackberry\";\n\n matched.browser = bb;\n browser[bb] = true;\n }\n\n // Opera 15+ are identified as opr\n if ( browser.opr ) {\n var opera = \"opera\";\n\n matched.browser = opera;\n browser[opera] = true;\n }\n\n // Stock Android browsers are marked as Safari on Android.\n if ( browser.safari && browser.android ) {\n var android = \"android\";\n\n matched.browser = android;\n browser[android] = true;\n }\n\n // Kindle browsers are marked as Safari on Kindle\n if ( browser.safari && browser.kindle ) {\n var kindle = \"kindle\";\n\n matched.browser = kindle;\n browser[kindle] = true;\n }\n\n // Kindle Silk browsers are marked as Safari on Kindle\n if ( browser.safari && browser.silk ) {\n var silk = \"silk\";\n\n matched.browser = silk;\n browser[silk] = true;\n }\n\n // Assign the name and platform variable\n browser.name = matched.browser;\n browser.platform = matched.platform;\n return browser;\n }\n\n // Run the matching process, also assign the function to the returned object\n // for manual, jQuery-free use if desired\n window.jQBrowser = uaMatch( window.navigator.userAgent );\n window.jQBrowser.uaMatch = uaMatch;\n\n // Only assign to jQuery.browser if jQuery is loaded\n if ( jQuery ) {\n jQuery.browser = window.jQBrowser;\n }\n\n return window.jQBrowser;\n}));\n","/** @license\r\n *\r\n * SoundManager 2: JavaScript Sound for the Web\r\n * ----------------------------------------------\r\n * http://schillmania.com/projects/soundmanager2/\r\n *\r\n * Copyright (c) 2007, Scott Schiller. All rights reserved.\r\n * Code provided under the BSD License:\r\n * http://schillmania.com/projects/soundmanager2/license.txt\r\n *\r\n * V2.97a.20170601\r\n */\r\n\r\n/**\r\n * About this file\r\n * -------------------------------------------------------------------------------------\r\n * This is the fully-commented source version of the SoundManager 2 API,\r\n * recommended for use during development and testing.\r\n *\r\n * See soundmanager2-nodebug-jsmin.js for an optimized build (~11KB with gzip.)\r\n * http://schillmania.com/projects/soundmanager2/doc/getstarted/#basic-inclusion\r\n * Alternately, serve this file with gzip for 75% compression savings (~30KB over HTTP.)\r\n *\r\n * You may notice <d> and </d> comments in this source; these are delimiters for\r\n * debug blocks which are removed in the -nodebug builds, further optimizing code size.\r\n *\r\n * Also, as you may note: Whoa, reliable cross-platform/device audio support is hard! ;)\r\n */\r\n\r\n(function SM2(window, _undefined) {\r\n\r\n/* global Audio, document, window, navigator, define, module, SM2_DEFER, opera, setTimeout, setInterval, clearTimeout, sm2Debugger */\r\n\r\n'use strict';\r\n\r\nif (!window || !window.document) {\r\n\r\n // Don't cross the [environment] streams. SM2 expects to be running in a browser, not under node.js etc.\r\n // Additionally, if a browser somehow manages to fail this test, as Egon said: \"It would be bad.\"\r\n\r\n throw new Error('SoundManager requires a browser with window and document objects.');\r\n\r\n}\r\n\r\nvar soundManager = null;\r\n\r\n/**\r\n * The SoundManager constructor.\r\n *\r\n * @constructor\r\n * @param {string} smURL Optional: Path to SWF files\r\n * @param {string} smID Optional: The ID to use for the SWF container element\r\n * @this {SoundManager}\r\n * @return {SoundManager} The new SoundManager instance\r\n */\r\n\r\nfunction SoundManager(smURL, smID) {\r\n\r\n /**\r\n * soundManager configuration options list\r\n * defines top-level configuration properties to be applied to the soundManager instance (eg. soundManager.flashVersion)\r\n * to set these properties, use the setup() method - eg., soundManager.setup({url: '/swf/', flashVersion: 9})\r\n */\r\n\r\n this.setupOptions = {\r\n\r\n url: (smURL || null), // path (directory) where SoundManager 2 SWFs exist, eg., /path/to/swfs/\r\n flashVersion: 8, // flash build to use (8 or 9.) Some API features require 9.\r\n debugMode: true, // enable debugging output (console.log() with HTML fallback)\r\n debugFlash: false, // enable debugging output inside SWF, troubleshoot Flash/browser issues\r\n useConsole: true, // use console.log() if available (otherwise, writes to #soundmanager-debug element)\r\n consoleOnly: true, // if console is being used, do not create/write to #soundmanager-debug\r\n waitForWindowLoad: false, // force SM2 to wait for window.onload() before trying to call soundManager.onload()\r\n bgColor: '#ffffff', // SWF background color. N/A when wmode = 'transparent'\r\n useHighPerformance: false, // position:fixed flash movie can help increase js/flash speed, minimize lag\r\n flashPollingInterval: null, // msec affecting whileplaying/loading callback frequency. If null, default of 50 msec is used.\r\n html5PollingInterval: null, // msec affecting whileplaying() for HTML5 audio, excluding mobile devices. If null, native HTML5 update events are used.\r\n flashLoadTimeout: 1000, // msec to wait for flash movie to load before failing (0 = infinity)\r\n wmode: null, // flash rendering mode - null, 'transparent', or 'opaque' (last two allow z-index to work)\r\n allowScriptAccess: 'always', // for scripting the SWF (object/embed property), 'always' or 'sameDomain'\r\n useFlashBlock: false, // *requires flashblock.css, see demos* - allow recovery from flash blockers. Wait indefinitely and apply timeout CSS to SWF, if applicable.\r\n useHTML5Audio: true, // use HTML5 Audio() where API is supported (most Safari, Chrome versions), Firefox (MP3/MP4 support varies.) Ideally, transparent vs. Flash API where possible.\r\n forceUseGlobalHTML5Audio: false, // if true, a single Audio() object is used for all sounds - and only one can play at a time.\r\n ignoreMobileRestrictions: false, // if true, SM2 will not apply global HTML5 audio rules to mobile UAs. iOS > 7 and WebViews may allow multiple Audio() instances.\r\n html5Test: /^(probably|maybe)$/i, // HTML5 Audio() format support test. Use /^probably$/i; if you want to be more conservative.\r\n preferFlash: false, // overrides useHTML5audio, will use Flash for MP3/MP4/AAC if present. Potential option if HTML5 playback with these formats is quirky.\r\n noSWFCache: false, // if true, appends ?ts={date} to break aggressive SWF caching.\r\n idPrefix: 'sound' // if an id is not provided to createSound(), this prefix is used for generated IDs - 'sound0', 'sound1' etc.\r\n\r\n };\r\n\r\n this.defaultOptions = {\r\n\r\n /**\r\n * the default configuration for sound objects made with createSound() and related methods\r\n * eg., volume, auto-load behaviour and so forth\r\n */\r\n\r\n autoLoad: false, // enable automatic loading (otherwise .load() will be called on demand with .play(), the latter being nicer on bandwidth - if you want to .load yourself, you also can)\r\n autoPlay: false, // enable playing of file as soon as possible (much faster if \"stream\" is true)\r\n from: null, // position to start playback within a sound (msec), default = beginning\r\n loops: 1, // how many times to repeat the sound (position will wrap around to 0, setPosition() will break out of loop when >0)\r\n onid3: null, // callback function for \"ID3 data is added/available\"\r\n onerror: null, // callback function for \"load failed\" (or, playback/network/decode error under HTML5.)\r\n onload: null, // callback function for \"load finished\"\r\n whileloading: null, // callback function for \"download progress update\" (X of Y bytes received)\r\n onplay: null, // callback for \"play\" start\r\n onpause: null, // callback for \"pause\"\r\n onresume: null, // callback for \"resume\" (pause toggle)\r\n whileplaying: null, // callback during play (position update)\r\n onposition: null, // object containing times and function callbacks for positions of interest\r\n onstop: null, // callback for \"user stop\"\r\n onfinish: null, // callback function for \"sound finished playing\"\r\n multiShot: true, // let sounds \"restart\" or layer on top of each other when played multiple times, rather than one-shot/one at a time\r\n multiShotEvents: false, // fire multiple sound events (currently onfinish() only) when multiShot is enabled\r\n position: null, // offset (milliseconds) to seek to within loaded sound data.\r\n pan: 0, // \"pan\" settings, left-to-right, -100 to 100\r\n playbackRate: 1, // rate at which to play the sound (HTML5-only)\r\n stream: true, // allows playing before entire file has loaded (recommended)\r\n to: null, // position to end playback within a sound (msec), default = end\r\n type: null, // MIME-like hint for file pattern / canPlay() tests, eg. audio/mp3\r\n usePolicyFile: false, // enable crossdomain.xml request for audio on remote domains (for ID3/waveform access)\r\n volume: 100 // self-explanatory. 0-100, the latter being the max.\r\n\r\n };\r\n\r\n this.flash9Options = {\r\n\r\n /**\r\n * flash 9-only options,\r\n * merged into defaultOptions if flash 9 is being used\r\n */\r\n\r\n onfailure: null, // callback function for when playing fails (Flash 9, MovieStar + RTMP-only)\r\n isMovieStar: null, // \"MovieStar\" MPEG4 audio mode. Null (default) = auto detect MP4, AAC etc. based on URL. true = force on, ignore URL\r\n usePeakData: false, // enable left/right channel peak (level) data\r\n useWaveformData: false, // enable sound spectrum (raw waveform data) - NOTE: May increase CPU load.\r\n useEQData: false, // enable sound EQ (frequency spectrum data) - NOTE: May increase CPU load.\r\n onbufferchange: null, // callback for \"isBuffering\" property change\r\n ondataerror: null // callback for waveform/eq data access error (flash playing audio in other tabs/domains)\r\n\r\n };\r\n\r\n this.movieStarOptions = {\r\n\r\n /**\r\n * flash 9.0r115+ MPEG4 audio options,\r\n * merged into defaultOptions if flash 9+movieStar mode is enabled\r\n */\r\n\r\n bufferTime: 3, // seconds of data to buffer before playback begins (null = flash default of 0.1 seconds - if AAC playback is gappy, try increasing.)\r\n serverURL: null, // rtmp: FMS or FMIS server to connect to, required when requesting media via RTMP or one of its variants\r\n onconnect: null, // rtmp: callback for connection to flash media server\r\n duration: null // rtmp: song duration (msec)\r\n\r\n };\r\n\r\n this.audioFormats = {\r\n\r\n /**\r\n * determines HTML5 support + flash requirements.\r\n * if no support (via flash and/or HTML5) for a \"required\" format, SM2 will fail to start.\r\n * flash fallback is used for MP3 or MP4 if HTML5 can't play it (or if preferFlash = true)\r\n */\r\n\r\n mp3: {\r\n type: ['audio/mpeg; codecs=\"mp3\"', 'audio/mpeg', 'audio/mp3', 'audio/MPA', 'audio/mpa-robust'],\r\n required: true\r\n },\r\n\r\n mp4: {\r\n related: ['aac', 'm4a', 'm4b'], // additional formats under the MP4 container\r\n type: ['audio/mp4; codecs=\"mp4a.40.2\"', 'audio/aac', 'audio/x-m4a', 'audio/MP4A-LATM', 'audio/mpeg4-generic'],\r\n required: false\r\n },\r\n\r\n ogg: {\r\n type: ['audio/ogg; codecs=vorbis'],\r\n required: false\r\n },\r\n\r\n opus: {\r\n type: ['audio/ogg; codecs=opus', 'audio/opus'],\r\n required: false\r\n },\r\n\r\n wav: {\r\n type: ['audio/wav; codecs=\"1\"', 'audio/wav', 'audio/wave', 'audio/x-wav'],\r\n required: false\r\n },\r\n\r\n flac: {\r\n type: ['audio/flac'],\r\n required: false\r\n }\r\n\r\n };\r\n\r\n // HTML attributes (id + class names) for the SWF container\r\n\r\n this.movieID = 'sm2-container';\r\n this.id = (smID || 'sm2movie');\r\n\r\n this.debugID = 'soundmanager-debug';\r\n this.debugURLParam = /([#?&])debug=1/i;\r\n\r\n // dynamic attributes\r\n\r\n this.versionNumber = 'V2.97a.20170601';\r\n this.version = null;\r\n this.movieURL = null;\r\n this.altURL = null;\r\n this.swfLoaded = false;\r\n this.enabled = false;\r\n this.oMC = null;\r\n this.sounds = {};\r\n this.soundIDs = [];\r\n this.muted = false;\r\n this.didFlashBlock = false;\r\n this.filePattern = null;\r\n\r\n this.filePatterns = {\r\n flash8: /\\.mp3(\\?.*)?$/i,\r\n flash9: /\\.mp3(\\?.*)?$/i\r\n };\r\n\r\n // support indicators, set at init\r\n\r\n this.features = {\r\n buffering: false,\r\n peakData: false,\r\n waveformData: false,\r\n eqData: false,\r\n movieStar: false\r\n };\r\n\r\n // flash sandbox info, used primarily in troubleshooting\r\n\r\n this.sandbox = {\r\n // <d>\r\n type: null,\r\n types: {\r\n remote: 'remote (domain-based) rules',\r\n localWithFile: 'local with file access (no internet access)',\r\n localWithNetwork: 'local with network (internet access only, no local access)',\r\n localTrusted: 'local, trusted (local+internet access)'\r\n },\r\n description: null,\r\n noRemote: null,\r\n noLocal: null\r\n // </d>\r\n };\r\n\r\n /**\r\n * format support (html5/flash)\r\n * stores canPlayType() results based on audioFormats.\r\n * eg. { mp3: boolean, mp4: boolean }\r\n * treat as read-only.\r\n */\r\n\r\n this.html5 = {\r\n usingFlash: null // set if/when flash fallback is needed\r\n };\r\n\r\n // file type support hash\r\n this.flash = {};\r\n\r\n // determined at init time\r\n this.html5Only = false;\r\n\r\n // used for special cases (eg. iPad/iPhone/palm OS?)\r\n this.ignoreFlash = false;\r\n\r\n /**\r\n * a few private internals (OK, a lot. :D)\r\n */\r\n\r\n var SMSound,\r\n sm2 = this, globalHTML5Audio = null, flash = null, sm = 'soundManager', smc = sm + ': ', h5 = 'HTML5::', id, ua = navigator.userAgent, wl = window.location.href.toString(), doc = document, doNothing, setProperties, init, fV, on_queue = [], debugOpen = true, debugTS, didAppend = false, appendSuccess = false, didInit = false, disabled = false, windowLoaded = false, _wDS, wdCount = 0, initComplete, mixin, assign, extraOptions, addOnEvent, processOnEvents, initUserOnload, delayWaitForEI, waitForEI, rebootIntoHTML5, setVersionInfo, handleFocus, strings, initMovie, domContentLoaded, winOnLoad, didDCLoaded, getDocument, createMovie, catchError, setPolling, initDebug, debugLevels = ['log', 'info', 'warn', 'error'], defaultFlashVersion = 8, disableObject, failSafely, normalizeMovieURL, oRemoved = null, oRemovedHTML = null, str, flashBlockHandler, getSWFCSS, swfCSS, toggleDebug, loopFix, policyFix, complain, idCheck, waitingForEI = false, initPending = false, startTimer, stopTimer, timerExecute, h5TimerCount = 0, h5IntervalTimer = null, parseURL, messages = [],\r\n canIgnoreFlash, needsFlash = null, featureCheck, html5OK, html5CanPlay, html5ErrorCodes, html5Ext, html5Unload, domContentLoadedIE, testHTML5, event, slice = Array.prototype.slice, useGlobalHTML5Audio = false, lastGlobalHTML5URL, hasFlash, detectFlash, badSafariFix, html5_events, showSupport, flushMessages, wrapCallback, idCounter = 0, didSetup, msecScale = 1000,\r\n is_iDevice = ua.match(/(ipad|iphone|ipod)/i), isAndroid = ua.match(/android/i), isIE = ua.match(/msie|trident/i),\r\n isWebkit = ua.match(/webkit/i),\r\n isSafari = (ua.match(/safari/i) && !ua.match(/chrome/i)),\r\n isOpera = (ua.match(/opera/i)),\r\n mobileHTML5 = (ua.match(/(mobile|pre\\/|xoom)/i) || is_iDevice || isAndroid),\r\n isBadSafari = (!wl.match(/usehtml5audio/i) && !wl.match(/sm2-ignorebadua/i) && isSafari && !ua.match(/silk/i) && ua.match(/OS\\sX\\s10_6_([3-7])/i)), // Safari 4 and 5 (excluding Kindle Fire, \"Silk\") occasionally fail to load/play HTML5 audio on Snow Leopard 10.6.3 through 10.6.7 due to bug(s) in QuickTime X and/or other underlying frameworks. :/ Confirmed bug. https://bugs.webkit.org/show_bug.cgi?id=32159\r\n hasConsole = (window.console !== _undefined && console.log !== _undefined),\r\n isFocused = (doc.hasFocus !== _undefined ? doc.hasFocus() : null),\r\n tryInitOnFocus = (isSafari && (doc.hasFocus === _undefined || !doc.hasFocus())),\r\n okToDisable = !tryInitOnFocus,\r\n flashMIME = /(mp3|mp4|mpa|m4a|m4b)/i,\r\n emptyURL = 'about:blank', // safe URL to unload, or load nothing from (flash 8 + most HTML5 UAs)\r\n emptyWAV = 'data:audio/wave;base64,/UklGRiYAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQIAAAD//w==', // tiny WAV for HTML5 unloading\r\n overHTTP = (doc.location ? doc.location.protocol.match(/http/i) : null),\r\n http = (!overHTTP ? '//' : ''),\r\n // mp3, mp4, aac etc.\r\n netStreamMimeTypes = /^\\s*audio\\/(?:x-)?(?:mpeg4|aac|flv|mov|mp4|m4v|m4a|m4b|mp4v|3gp|3g2)\\s*(?:$|;)/i,\r\n // Flash v9.0r115+ \"moviestar\" formats\r\n netStreamTypes = ['mpeg4', 'aac', 'flv', 'mov', 'mp4', 'm4v', 'f4v', 'm4a', 'm4b', 'mp4v', '3gp', '3g2'],\r\n netStreamPattern = new RegExp('\\\\.(' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n this.mimePattern = /^\\s*audio\\/(?:x-)?(?:mp(?:eg|3))\\s*(?:$|;)/i; // default mp3 set\r\n\r\n // use altURL if not \"online\"\r\n this.useAltURL = !overHTTP;\r\n\r\n swfCSS = {\r\n swfBox: 'sm2-object-box',\r\n swfDefault: 'movieContainer',\r\n swfError: 'swf_error', // SWF loaded, but SM2 couldn't start (other error)\r\n swfTimedout: 'swf_timedout',\r\n swfLoaded: 'swf_loaded',\r\n swfUnblocked: 'swf_unblocked', // or loaded OK\r\n sm2Debug: 'sm2_debug',\r\n highPerf: 'high_performance',\r\n flashDebug: 'flash_debug'\r\n };\r\n\r\n /**\r\n * HTML5 error codes, per W3C\r\n * Error code 1, MEDIA_ERR_ABORTED: Client aborted download at user's request.\r\n * Error code 2, MEDIA_ERR_NETWORK: A network error of some description caused the user agent to stop fetching the media resource, after the resource was established to be usable.\r\n * Error code 3, MEDIA_ERR_DECODE: An error of some description occurred while decoding the media resource, after the resource was established to be usable.\r\n * Error code 4, MEDIA_ERR_SRC_NOT_SUPPORTED: Media (audio file) not supported (\"not usable.\")\r\n * Reference: https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n */\r\n html5ErrorCodes = [\r\n null,\r\n 'MEDIA_ERR_ABORTED',\r\n 'MEDIA_ERR_NETWORK',\r\n 'MEDIA_ERR_DECODE',\r\n 'MEDIA_ERR_SRC_NOT_SUPPORTED'\r\n ];\r\n\r\n /**\r\n * basic HTML5 Audio() support test\r\n * try...catch because of IE 9 \"not implemented\" nonsense\r\n * https://github.com/Modernizr/Modernizr/issues/224\r\n */\r\n\r\n this.hasHTML5 = (function() {\r\n try {\r\n // new Audio(null) for stupid Opera 9.64 case, which throws not_enough_arguments exception otherwise.\r\n return (Audio !== _undefined && (isOpera && opera !== _undefined && opera.version() < 10 ? new Audio(null) : new Audio()).canPlayType !== _undefined);\r\n } catch(e) {\r\n return false;\r\n }\r\n }());\r\n\r\n /**\r\n * Public SoundManager API\r\n * -----------------------\r\n */\r\n\r\n /**\r\n * Configures top-level soundManager properties.\r\n *\r\n * @param {object} options Option parameters, eg. { flashVersion: 9, url: '/path/to/swfs/' }\r\n * onready and ontimeout are also accepted parameters. call soundManager.setup() to see the full list.\r\n */\r\n\r\n this.setup = function(options) {\r\n\r\n var noURL = (!sm2.url);\r\n\r\n // warn if flash options have already been applied\r\n\r\n if (options !== _undefined && didInit && needsFlash && sm2.ok() && (options.flashVersion !== _undefined || options.url !== _undefined || options.html5Test !== _undefined)) {\r\n complain(str('setupLate'));\r\n }\r\n\r\n // TODO: defer: true?\r\n\r\n assign(options);\r\n\r\n if (!useGlobalHTML5Audio) {\r\n\r\n if (mobileHTML5) {\r\n\r\n // force the singleton HTML5 pattern on mobile, by default.\r\n if (!sm2.setupOptions.ignoreMobileRestrictions || sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n }\r\n\r\n } else if (sm2.setupOptions.forceUseGlobalHTML5Audio) {\r\n\r\n // only apply singleton HTML5 on desktop if forced.\r\n messages.push(strings.globalHTML5);\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!didSetup && mobileHTML5) {\r\n\r\n if (sm2.setupOptions.ignoreMobileRestrictions) {\r\n\r\n messages.push(strings.ignoreMobile);\r\n\r\n } else {\r\n\r\n // prefer HTML5 for mobile + tablet-like devices, probably more reliable vs. flash at this point.\r\n\r\n // <d>\r\n if (!sm2.setupOptions.useHTML5Audio || sm2.setupOptions.preferFlash) {\r\n // notify that defaults are being changed.\r\n sm2._wD(strings.mobileUA);\r\n }\r\n // </d>\r\n\r\n sm2.setupOptions.useHTML5Audio = true;\r\n sm2.setupOptions.preferFlash = false;\r\n\r\n if (is_iDevice) {\r\n\r\n // no flash here.\r\n sm2.ignoreFlash = true;\r\n\r\n } else if ((isAndroid && !ua.match(/android\\s2\\.3/i)) || !isAndroid) {\r\n\r\n /**\r\n * Android devices tend to work better with a single audio instance, specifically for chained playback of sounds in sequence.\r\n * Common use case: exiting sound onfinish() -> createSound() -> play()\r\n * Presuming similar restrictions for other mobile, non-Android, non-iOS devices.\r\n */\r\n\r\n // <d>\r\n sm2._wD(strings.globalHTML5);\r\n // </d>\r\n\r\n useGlobalHTML5Audio = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // special case 1: \"Late setup\". SM2 loaded normally, but user didn't assign flash URL eg., setup({url:...}) before SM2 init. Treat as delayed init.\r\n\r\n if (options) {\r\n\r\n if (noURL && didDCLoaded && options.url !== _undefined) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n // special case 2: If lazy-loading SM2 (DOMContentLoaded has already happened) and user calls setup() with url: parameter, try to init ASAP.\r\n\r\n if (!didDCLoaded && options.url !== _undefined && doc.readyState === 'complete') {\r\n setTimeout(domContentLoaded, 1);\r\n }\r\n\r\n }\r\n\r\n didSetup = true;\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.ok = function() {\r\n\r\n return (needsFlash ? (didInit && !disabled) : (sm2.useHTML5Audio && sm2.hasHTML5));\r\n\r\n };\r\n\r\n this.supported = this.ok; // legacy\r\n\r\n this.getMovie = function(movie_id) {\r\n\r\n // safety net: some old browsers differ on SWF references, possibly related to ExternalInterface / flash version\r\n return id(movie_id) || doc[movie_id] || window[movie_id];\r\n\r\n };\r\n\r\n /**\r\n * Creates a SMSound sound object instance. Can also be overloaded, e.g., createSound('mySound', '/some.mp3');\r\n *\r\n * @param {object} oOptions Sound options (at minimum, url parameter is required.)\r\n * @return {object} SMSound The new SMSound object.\r\n */\r\n\r\n this.createSound = function(oOptions, _url) {\r\n\r\n var cs, cs_string, options, oSound = null;\r\n\r\n // <d>\r\n cs = sm + '.createSound(): ';\r\n cs_string = cs + str(!didInit ? 'notReady' : 'notOK');\r\n // </d>\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(cs_string);\r\n return false;\r\n }\r\n\r\n if (_url !== _undefined) {\r\n // function overloading in JS! :) ... assume simple createSound(id, url) use case.\r\n oOptions = {\r\n id: oOptions,\r\n url: _url\r\n };\r\n }\r\n\r\n // inherit from defaultOptions\r\n options = mixin(oOptions);\r\n\r\n options.url = parseURL(options.url);\r\n\r\n // generate an id, if needed.\r\n if (options.id === _undefined) {\r\n options.id = sm2.setupOptions.idPrefix + (idCounter++);\r\n }\r\n\r\n // <d>\r\n if (options.id.toString().charAt(0).match(/^[0-9]$/)) {\r\n sm2._wD(cs + str('badID', options.id), 2);\r\n }\r\n\r\n sm2._wD(cs + options.id + (options.url ? ' (' + options.url + ')' : ''), 1);\r\n // </d>\r\n\r\n if (idCheck(options.id, true)) {\r\n sm2._wD(cs + options.id + ' exists', 1);\r\n return sm2.sounds[options.id];\r\n }\r\n\r\n function make() {\r\n\r\n options = loopFix(options);\r\n sm2.sounds[options.id] = new SMSound(options);\r\n sm2.soundIDs.push(options.id);\r\n return sm2.sounds[options.id];\r\n\r\n }\r\n\r\n if (html5OK(options)) {\r\n\r\n oSound = make();\r\n // <d>\r\n if (!sm2.html5Only) {\r\n sm2._wD(options.id + ': Using HTML5');\r\n }\r\n // </d>\r\n oSound._setup_html5(options);\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(options.id + ': No HTML5 support for this sound, and no Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n // TODO: Move HTML5/flash checks into generic URL parsing/handling function.\r\n\r\n if (sm2.html5.usingFlash && options.url && options.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(options.id + ': data: URIs not supported via Flash. Exiting.');\r\n return make();\r\n }\r\n\r\n if (fV > 8) {\r\n if (options.isMovieStar === null) {\r\n // attempt to detect MPEG-4 formats\r\n options.isMovieStar = !!(options.serverURL || (options.type ? options.type.match(netStreamMimeTypes) : false) || (options.url && options.url.match(netStreamPattern)));\r\n }\r\n // <d>\r\n if (options.isMovieStar) {\r\n sm2._wD(cs + 'using MovieStar handling');\r\n if (options.loops > 1) {\r\n _wDS('noNSLoop');\r\n }\r\n }\r\n // </d>\r\n }\r\n\r\n options = policyFix(options, cs);\r\n oSound = make();\r\n\r\n if (fV === 8) {\r\n flash._createSound(options.id, options.loops || 1, options.usePolicyFile);\r\n } else {\r\n flash._createSound(options.id, options.url, options.usePeakData, options.useWaveformData, options.useEQData, options.isMovieStar, (options.isMovieStar ? options.bufferTime : false), options.loops || 1, options.serverURL, options.duration || null, options.autoPlay, true, options.autoLoad, options.usePolicyFile);\r\n if (!options.serverURL) {\r\n // We are connected immediately\r\n oSound.connected = true;\r\n if (options.onconnect) {\r\n options.onconnect.apply(oSound);\r\n }\r\n }\r\n }\r\n\r\n if (!options.serverURL && (options.autoLoad || options.autoPlay)) {\r\n // call load for non-rtmp streams\r\n oSound.load(options);\r\n }\r\n\r\n }\r\n\r\n // rtmp will play in onconnect\r\n if (!options.serverURL && options.autoPlay) {\r\n oSound.play();\r\n }\r\n\r\n return oSound;\r\n\r\n };\r\n\r\n /**\r\n * Destroys a SMSound sound object instance.\r\n *\r\n * @param {string} sID The ID of the sound to destroy\r\n */\r\n\r\n this.destroySound = function(sID, _bFromSound) {\r\n\r\n // explicitly destroy a sound before normal page unload, etc.\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n var oS = sm2.sounds[sID], i;\r\n\r\n oS.stop();\r\n\r\n // Disable all callbacks after stop(), when the sound is being destroyed\r\n oS._iO = {};\r\n\r\n oS.unload();\r\n\r\n for (i = 0; i < sm2.soundIDs.length; i++) {\r\n if (sm2.soundIDs[i] === sID) {\r\n sm2.soundIDs.splice(i, 1);\r\n break;\r\n }\r\n }\r\n\r\n if (!_bFromSound) {\r\n // ignore if being called from SMSound instance\r\n oS.destruct(true);\r\n }\r\n\r\n oS = null;\r\n delete sm2.sounds[sID];\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Calls the load() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n */\r\n\r\n this.load = function(sID, oOptions) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].load(oOptions);\r\n\r\n };\r\n\r\n /**\r\n * Calls the unload() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n */\r\n\r\n this.unload = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].unload();\r\n\r\n };\r\n\r\n /**\r\n * Calls the onPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(sID, nPosition, oMethod, oScope) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].onposition(nPosition, oMethod, oScope);\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Calls the clearOnPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod Optional: The relevant callback to fire\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(sID, nPosition, oMethod) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].clearOnPosition(nPosition, oMethod);\r\n\r\n };\r\n\r\n /**\r\n * Calls the play() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {object} oOptions Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(sID, oOptions) {\r\n\r\n var result = null,\r\n // legacy function-overloading use case: play('mySound', '/path/to/some.mp3');\r\n overloaded = (oOptions && !(oOptions instanceof Object));\r\n\r\n if (!didInit || !sm2.ok()) {\r\n complain(sm + '.play(): ' + str(!didInit ? 'notReady' : 'notOK'));\r\n return false;\r\n }\r\n\r\n if (!idCheck(sID, overloaded)) {\r\n\r\n // no sound found for the given ID. Bail.\r\n if (!overloaded) return false;\r\n\r\n if (overloaded) {\r\n oOptions = {\r\n url: oOptions\r\n };\r\n }\r\n\r\n if (oOptions && oOptions.url) {\r\n // overloading use case, create+play: .play('someID', {url:'/path/to.mp3'});\r\n sm2._wD(sm + '.play(): Attempting to create \"' + sID + '\"', 1);\r\n oOptions.id = sID;\r\n result = sm2.createSound(oOptions).play();\r\n }\r\n\r\n } else if (overloaded) {\r\n\r\n // existing sound object case\r\n oOptions = {\r\n url: oOptions\r\n };\r\n\r\n }\r\n\r\n if (result === null) {\r\n // default case\r\n result = sm2.sounds[sID].play(oOptions);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Calls the setPlaybackRate() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(sID, rate, allowOverride) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPlaybackRate(rate, allowOverride);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPosition() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(sID, nMsecOffset) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPosition(nMsecOffset);\r\n\r\n };\r\n\r\n /**\r\n * Calls the stop() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.stop(' + sID + ')', 1);\r\n\r\n return sm2.sounds[sID].stop();\r\n\r\n };\r\n\r\n /**\r\n * Stops all currently-playing sounds.\r\n */\r\n\r\n this.stopAll = function() {\r\n\r\n var oSound;\r\n sm2._wD(sm + '.stopAll()', 1);\r\n\r\n for (oSound in sm2.sounds) {\r\n if (sm2.sounds.hasOwnProperty(oSound)) {\r\n // apply only to sound objects\r\n sm2.sounds[oSound].stop();\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the pause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].pause();\r\n\r\n };\r\n\r\n /**\r\n * Pauses all currently-playing sounds.\r\n */\r\n\r\n this.pauseAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].pause();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the resume() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.resume = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].resume();\r\n\r\n };\r\n\r\n /**\r\n * Resumes all currently-paused sounds.\r\n */\r\n\r\n this.resumeAll = function() {\r\n\r\n var i;\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].resume();\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Calls the togglePause() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].togglePause();\r\n\r\n };\r\n\r\n /**\r\n * Calls the setPan() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(sID, nPan) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setPan(nPan);\r\n\r\n };\r\n\r\n /**\r\n * Calls the setVolume() method of a SMSound object by ID\r\n * Overloaded case: pass only volume argument eg., setVolume(50) to apply to all sounds.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(sID, nVol) {\r\n\r\n // setVolume(50) function overloading case - apply to all sounds\r\n\r\n var i, j;\r\n\r\n if (sID !== _undefined && !isNaN(sID) && nVol === _undefined) {\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]].setVolume(sID);\r\n }\r\n return false;\r\n }\r\n\r\n // setVolume('mySound', 50) case\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].setVolume(nVol);\r\n\r\n };\r\n\r\n /**\r\n * Calls the mute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.mute = function(sID) {\r\n\r\n var i = 0;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.mute(): Muting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].mute();\r\n }\r\n sm2.muted = true;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.mute(): Muting \"' + sID + '\"');\r\n return sm2.sounds[sID].mute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Mutes all sounds.\r\n */\r\n\r\n this.muteAll = function() {\r\n\r\n sm2.mute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the unmute() method of either a single SMSound object by ID, or all sound objects.\r\n *\r\n * @param {string} sID Optional: The ID of the sound (if omitted, all sounds will be used.)\r\n */\r\n\r\n this.unmute = function(sID) {\r\n\r\n var i;\r\n\r\n if (sID instanceof String) {\r\n sID = null;\r\n }\r\n\r\n if (!sID) {\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting all sounds');\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].unmute();\r\n }\r\n sm2.muted = false;\r\n\r\n } else {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n sm2._wD(sm + '.unmute(): Unmuting \"' + sID + '\"');\r\n\r\n return sm2.sounds[sID].unmute();\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes all sounds.\r\n */\r\n\r\n this.unmuteAll = function() {\r\n\r\n sm2.unmute();\r\n\r\n };\r\n\r\n /**\r\n * Calls the toggleMute() method of a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function(sID) {\r\n\r\n if (!idCheck(sID)) return false;\r\n\r\n return sm2.sounds[sID].toggleMute();\r\n\r\n };\r\n\r\n /**\r\n * Retrieves the memory used by the flash plugin.\r\n *\r\n * @return {number} The amount of memory in use\r\n */\r\n\r\n this.getMemoryUse = function() {\r\n\r\n // flash-only\r\n var ram = 0;\r\n\r\n if (flash && fV !== 8) {\r\n ram = parseInt(flash._getMemoryUse(), 10);\r\n }\r\n\r\n return ram;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: NOPs soundManager and all SMSound objects.\r\n */\r\n\r\n this.disable = function(bNoDisable) {\r\n\r\n // destroy all functions\r\n var i;\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n // already disabled?\r\n if (disabled) return false;\r\n\r\n disabled = true;\r\n\r\n _wDS('shutdown', 1);\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n disableObject(sm2.sounds[sm2.soundIDs[i]]);\r\n }\r\n\r\n disableObject(sm2);\r\n\r\n // fire \"complete\", despite fail\r\n initComplete(bNoDisable);\r\n\r\n event.remove(window, 'load', initUserOnload);\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a MIME type, eg. 'audio/mp3'.\r\n */\r\n\r\n this.canPlayMIME = function(sMIME) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n type: sMIME\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n // if flash 9, test netStream (movieStar) types as well.\r\n result = (sMIME && sm2.ok() ? !!((fV > 8 ? sMIME.match(netStreamMimeTypes) : null) || sMIME.match(sm2.mimePattern)) : null); // TODO: make less \"weird\" (per JSLint)\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of a URL based on audio support.\r\n *\r\n * @param {string} sURL The URL to test\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayURL = function(sURL) {\r\n\r\n var result;\r\n\r\n if (sm2.hasHTML5) {\r\n result = html5CanPlay({\r\n url: sURL\r\n });\r\n }\r\n\r\n if (!result && needsFlash) {\r\n result = (sURL && sm2.ok() ? !!(sURL.match(sm2.filePattern)) : null);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Determines playability of an HTML DOM <a> object (or similar object literal) based on audio support.\r\n *\r\n * @param {object} oLink an HTML DOM <a> object or object literal including href and/or type attributes\r\n * @return {boolean} URL playability\r\n */\r\n\r\n this.canPlayLink = function(oLink) {\r\n\r\n if (oLink.type !== _undefined && oLink.type && sm2.canPlayMIME(oLink.type)) return true;\r\n\r\n return sm2.canPlayURL(oLink.href);\r\n\r\n };\r\n\r\n /**\r\n * Retrieves a SMSound object by ID.\r\n *\r\n * @param {string} sID The ID of the sound\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.getSoundById = function(sID, _suppressDebug) {\r\n\r\n if (!sID) return null;\r\n\r\n var result = sm2.sounds[sID];\r\n\r\n // <d>\r\n if (!result && !_suppressDebug) {\r\n sm2._wD(sm + '.getSoundById(): Sound \"' + sID + '\" not found.', 2);\r\n }\r\n // </d>\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has successfully initialized.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.onready = function(oMethod, oScope) {\r\n\r\n var sType = 'onready',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents();\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Queues a callback for execution when SoundManager has failed to initialize.\r\n *\r\n * @param {function} oMethod The callback method to fire\r\n * @param {object} oScope Optional: The scope to apply to the callback\r\n */\r\n\r\n this.ontimeout = function(oMethod, oScope) {\r\n\r\n var sType = 'ontimeout',\r\n result = false;\r\n\r\n if (typeof oMethod === 'function') {\r\n\r\n // <d>\r\n if (didInit) {\r\n sm2._wD(str('queue', sType));\r\n }\r\n // </d>\r\n\r\n if (!oScope) {\r\n oScope = window;\r\n }\r\n\r\n addOnEvent(sType, oMethod, oScope);\r\n processOnEvents({ type: sType });\r\n\r\n result = true;\r\n\r\n } else {\r\n\r\n throw str('needFunction', sType);\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * Writes console.log()-style debug output to a console or in-browser element.\r\n * Applies when debugMode = true\r\n *\r\n * @param {string} sText The console message\r\n * @param {object} nType Optional log level (number), or object. Number case: Log type/style where 0 = 'info', 1 = 'warn', 2 = 'error'. Object case: Object to be dumped.\r\n */\r\n\r\n this._writeDebug = function(sText, sTypeOrObject) {\r\n\r\n // pseudo-private console.log()-style output\r\n // <d>\r\n\r\n var sDID = 'soundmanager-debug', o, oItem;\r\n\r\n if (!sm2.setupOptions.debugMode) return false;\r\n\r\n if (hasConsole && sm2.useConsole) {\r\n if (sTypeOrObject && typeof sTypeOrObject === 'object') {\r\n // object passed; dump to console.\r\n console.log(sText, sTypeOrObject);\r\n } else if (debugLevels[sTypeOrObject] !== _undefined) {\r\n console[debugLevels[sTypeOrObject]](sText);\r\n } else {\r\n console.log(sText);\r\n }\r\n if (sm2.consoleOnly) return true;\r\n }\r\n\r\n o = id(sDID);\r\n\r\n if (!o) return false;\r\n\r\n oItem = doc.createElement('div');\r\n\r\n if (++wdCount % 2 === 0) {\r\n oItem.className = 'sm2-alt';\r\n }\r\n\r\n if (sTypeOrObject === _undefined) {\r\n sTypeOrObject = 0;\r\n } else {\r\n sTypeOrObject = parseInt(sTypeOrObject, 10);\r\n }\r\n\r\n oItem.appendChild(doc.createTextNode(sText));\r\n\r\n if (sTypeOrObject) {\r\n if (sTypeOrObject >= 2) {\r\n oItem.style.fontWeight = 'bold';\r\n }\r\n if (sTypeOrObject === 3) {\r\n oItem.style.color = '#ff3333';\r\n }\r\n }\r\n\r\n // top-to-bottom\r\n // o.appendChild(oItem);\r\n\r\n // bottom-to-top\r\n o.insertBefore(oItem, o.firstChild);\r\n\r\n o = null;\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n // <d>\r\n // last-resort debugging option\r\n if (wl.indexOf('sm2-debug=alert') !== -1) {\r\n this._writeDebug = function(sText) {\r\n window.alert(sText);\r\n };\r\n }\r\n // </d>\r\n\r\n // alias\r\n this._wD = this._writeDebug;\r\n\r\n /**\r\n * Provides debug / state information on all SMSound objects.\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n var i, j;\r\n _wDS('currentObj', 1);\r\n\r\n for (i = 0, j = sm2.soundIDs.length; i < j; i++) {\r\n sm2.sounds[sm2.soundIDs[i]]._debug();\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Restarts and re-initializes the SoundManager instance.\r\n *\r\n * @param {boolean} resetEvents Optional: When true, removes all registered onready and ontimeout event callbacks.\r\n * @param {boolean} excludeInit Options: When true, does not call beginDelayedInit() (which would restart SM2).\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n this.reboot = function(resetEvents, excludeInit) {\r\n\r\n // reset some (or all) state, and re-init unless otherwise specified.\r\n\r\n // <d>\r\n if (sm2.soundIDs.length) {\r\n sm2._wD('Destroying ' + sm2.soundIDs.length + ' SMSound object' + (sm2.soundIDs.length !== 1 ? 's' : '') + '...');\r\n }\r\n // </d>\r\n\r\n var i, j, k;\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n sm2.sounds[sm2.soundIDs[i]].destruct();\r\n }\r\n\r\n // trash ze flash (remove from the DOM)\r\n\r\n if (flash) {\r\n\r\n try {\r\n\r\n if (isIE) {\r\n oRemovedHTML = flash.innerHTML;\r\n }\r\n\r\n oRemoved = flash.parentNode.removeChild(flash);\r\n\r\n } catch(e) {\r\n\r\n // Remove failed? May be due to flash blockers silently removing the SWF object/embed node from the DOM. Warn and continue.\r\n\r\n _wDS('badRemove', 2);\r\n\r\n }\r\n\r\n }\r\n\r\n // actually, force recreate of movie.\r\n\r\n oRemovedHTML = oRemoved = needsFlash = flash = null;\r\n\r\n sm2.enabled = didDCLoaded = didInit = waitingForEI = initPending = didAppend = appendSuccess = disabled = useGlobalHTML5Audio = sm2.swfLoaded = false;\r\n\r\n sm2.soundIDs = [];\r\n sm2.sounds = {};\r\n\r\n idCounter = 0;\r\n didSetup = false;\r\n\r\n if (!resetEvents) {\r\n // reset callbacks for onready, ontimeout etc. so that they will fire again on re-init\r\n for (i in on_queue) {\r\n if (on_queue.hasOwnProperty(i)) {\r\n for (j = 0, k = on_queue[i].length; j < k; j++) {\r\n on_queue[i][j].fired = false;\r\n }\r\n }\r\n }\r\n } else {\r\n // remove all callbacks entirely\r\n on_queue = [];\r\n }\r\n\r\n // <d>\r\n if (!excludeInit) {\r\n sm2._wD(sm + ': Rebooting...');\r\n }\r\n // </d>\r\n\r\n // reset HTML5 and flash canPlay test results\r\n\r\n sm2.html5 = {\r\n usingFlash: null\r\n };\r\n\r\n sm2.flash = {};\r\n\r\n // reset device-specific HTML/flash mode switches\r\n\r\n sm2.html5Only = false;\r\n sm2.ignoreFlash = false;\r\n\r\n window.setTimeout(function() {\r\n\r\n // by default, re-init\r\n\r\n if (!excludeInit) {\r\n sm2.beginDelayedInit();\r\n }\r\n\r\n }, 20);\r\n\r\n return sm2;\r\n\r\n };\r\n\r\n this.reset = function() {\r\n\r\n /**\r\n * Shuts down and restores the SoundManager instance to its original loaded state, without an explicit reboot. All onready/ontimeout handlers are removed.\r\n * After this call, SM2 may be re-initialized via soundManager.beginDelayedInit().\r\n * @return {object} soundManager The soundManager instance.\r\n */\r\n\r\n _wDS('reset');\r\n\r\n return sm2.reboot(true, true);\r\n\r\n };\r\n\r\n /**\r\n * Undocumented: Determines the SM2 flash movie's load progress.\r\n *\r\n * @return {number or null} Percent loaded, or if invalid/unsupported, null.\r\n */\r\n\r\n this.getMoviePercent = function() {\r\n\r\n /**\r\n * Interesting syntax notes...\r\n * Flash/ExternalInterface (ActiveX/NPAPI) bridge methods are not typeof \"function\" nor instanceof Function, but are still valid.\r\n * Furthermore, using (flash && flash.PercentLoaded) causes IE to throw \"object doesn't support this property or method\".\r\n * Thus, 'in' syntax must be used.\r\n */\r\n\r\n return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null);\r\n\r\n };\r\n\r\n /**\r\n * Additional helper for manually invoking SM2's init process after DOM Ready / window.onload().\r\n */\r\n\r\n this.beginDelayedInit = function() {\r\n\r\n windowLoaded = true;\r\n domContentLoaded();\r\n\r\n setTimeout(function() {\r\n\r\n if (initPending) return false;\r\n\r\n createMovie();\r\n initMovie();\r\n initPending = true;\r\n\r\n return true;\r\n\r\n }, 20);\r\n\r\n delayWaitForEI();\r\n\r\n };\r\n\r\n /**\r\n * Destroys the SoundManager instance and all SMSound instances.\r\n */\r\n\r\n this.destruct = function() {\r\n\r\n sm2._wD(sm + '.destruct()');\r\n sm2.disable(true);\r\n\r\n };\r\n\r\n /**\r\n * SMSound() (sound object) constructor\r\n * ------------------------------------\r\n *\r\n * @param {object} oOptions Sound options (id and url are required attributes)\r\n * @return {SMSound} The new SMSound object\r\n */\r\n\r\n SMSound = function(oOptions) {\r\n\r\n var s = this, resetProperties, add_html5_events, remove_html5_events, stop_html5_timer, start_html5_timer, attachOnPosition, onplay_called = false, onPositionItems = [], onPositionFired = 0, detachOnPosition, applyFromTo, lastURL = null, lastHTML5State, urlOmitted;\r\n\r\n lastHTML5State = {\r\n // tracks duration + position (time)\r\n duration: null,\r\n time: null\r\n };\r\n\r\n this.id = oOptions.id;\r\n\r\n // legacy\r\n this.sID = this.id;\r\n\r\n this.url = oOptions.url;\r\n this.options = mixin(oOptions);\r\n\r\n // per-play-instance-specific options\r\n this.instanceOptions = this.options;\r\n\r\n // short alias\r\n this._iO = this.instanceOptions;\r\n\r\n // assign property defaults\r\n this.pan = this.options.pan;\r\n this.volume = this.options.volume;\r\n\r\n // whether or not this object is using HTML5\r\n this.isHTML5 = false;\r\n\r\n // internal HTML5 Audio() object reference\r\n this._a = null;\r\n\r\n // for flash 8 special-case createSound() without url, followed by load/play with url case\r\n urlOmitted = (!this.url);\r\n\r\n /**\r\n * SMSound() public methods\r\n * ------------------------\r\n */\r\n\r\n this.id3 = {};\r\n\r\n /**\r\n * Writes SMSound object parameters to debug console\r\n */\r\n\r\n this._debug = function() {\r\n\r\n // <d>\r\n sm2._wD(s.id + ': Merged options:', s.options);\r\n // </d>\r\n\r\n };\r\n\r\n /**\r\n * Begins loading a sound per its *url*.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.load = function(options) {\r\n\r\n var oSound = null, instanceOptions;\r\n\r\n if (options !== _undefined) {\r\n s._iO = mixin(options, s.options);\r\n } else {\r\n options = s.options;\r\n s._iO = options;\r\n if (lastURL && lastURL !== s.url) {\r\n _wDS('manURL');\r\n s._iO.url = s.url;\r\n s.url = null;\r\n }\r\n }\r\n\r\n if (!s._iO.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n // ensure we're in sync\r\n s.instanceOptions = s._iO;\r\n\r\n // local shortcut\r\n instanceOptions = s._iO;\r\n\r\n sm2._wD(s.id + ': load (' + instanceOptions.url + ')');\r\n\r\n if (!instanceOptions.url && !s.url) {\r\n sm2._wD(s.id + ': load(): url is unassigned. Exiting.', 2);\r\n return s;\r\n }\r\n\r\n // <d>\r\n if (!s.isHTML5 && fV === 8 && !s.url && !instanceOptions.autoPlay) {\r\n // flash 8 load() -> play() won't work before onload has fired.\r\n sm2._wD(s.id + ': Flash 8 load() limitation: Wait for onload() before calling play().', 1);\r\n }\r\n // </d>\r\n\r\n if (instanceOptions.url === s.url && s.readyState !== 0 && s.readyState !== 2) {\r\n _wDS('onURL', 1);\r\n // if loaded and an onload() exists, fire immediately.\r\n if (s.readyState === 3 && instanceOptions.onload) {\r\n // assume success based on truthy duration.\r\n wrapCallback(s, function() {\r\n instanceOptions.onload.apply(s, [(!!s.duration)]);\r\n });\r\n }\r\n return s;\r\n }\r\n\r\n // reset a few state properties\r\n\r\n s.loaded = false;\r\n s.readyState = 1;\r\n s.playState = 0;\r\n s.id3 = {};\r\n\r\n // TODO: If switching from HTML5 -> flash (or vice versa), stop currently-playing audio.\r\n\r\n if (html5OK(instanceOptions)) {\r\n\r\n oSound = s._setup_html5(instanceOptions);\r\n\r\n if (!oSound._called_load) {\r\n\r\n s._html5_canplay = false;\r\n\r\n // TODO: review called_load / html5_canplay logic\r\n\r\n // if url provided directly to load(), assign it here.\r\n\r\n if (s.url !== instanceOptions.url) {\r\n\r\n sm2._wD(_wDS('manURL') + ': ' + instanceOptions.url);\r\n\r\n s._a.src = instanceOptions.url;\r\n\r\n // TODO: review / re-apply all relevant options (volume, loop, onposition etc.)\r\n\r\n // reset position for new URL\r\n s.setPosition(0);\r\n\r\n }\r\n\r\n // given explicit load call, try to preload.\r\n\r\n // early HTML5 implementation (non-standard)\r\n s._a.autobuffer = 'auto';\r\n\r\n // standard property, values: none / metadata / auto\r\n // reference: http://msdn.microsoft.com/en-us/library/ie/ff974759%28v=vs.85%29.aspx\r\n s._a.preload = 'auto';\r\n\r\n s._a._called_load = true;\r\n\r\n } else {\r\n\r\n sm2._wD(s.id + ': Ignoring request to load again');\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (sm2.html5Only) {\r\n sm2._wD(s.id + ': No flash support. Exiting.');\r\n return s;\r\n }\r\n\r\n if (s._iO.url && s._iO.url.match(/data:/i)) {\r\n // data: URIs not supported by Flash, either.\r\n sm2._wD(s.id + ': data: URIs not supported via Flash. Exiting.');\r\n return s;\r\n }\r\n\r\n try {\r\n s.isHTML5 = false;\r\n s._iO = policyFix(loopFix(instanceOptions));\r\n // if we have \"position\", disable auto-play as we'll be seeking to that position at onload().\r\n if (s._iO.autoPlay && (s._iO.position || s._iO.from)) {\r\n sm2._wD(s.id + ': Disabling autoPlay because of non-zero offset case');\r\n s._iO.autoPlay = false;\r\n }\r\n // re-assign local shortcut\r\n instanceOptions = s._iO;\r\n if (fV === 8) {\r\n flash._load(s.id, instanceOptions.url, instanceOptions.stream, instanceOptions.autoPlay, instanceOptions.usePolicyFile);\r\n } else {\r\n flash._load(s.id, instanceOptions.url, !!(instanceOptions.stream), !!(instanceOptions.autoPlay), instanceOptions.loops || 1, !!(instanceOptions.autoLoad), instanceOptions.usePolicyFile);\r\n }\r\n } catch(e) {\r\n _wDS('smError', 2);\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'SMSOUND_LOAD_JS_EXCEPTION',\r\n fatal: true\r\n });\r\n }\r\n\r\n }\r\n\r\n // after all of this, ensure sound url is up to date.\r\n s.url = instanceOptions.url;\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads a sound, canceling any open HTTP requests.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unload = function() {\r\n\r\n // Flash 8/AS2 can't \"close\" a stream - fake it by loading an empty URL\r\n // Flash 9/AS3: Close stream, preventing further load\r\n // HTML5: Most UAs will use empty URL\r\n\r\n if (s.readyState !== 0) {\r\n\r\n sm2._wD(s.id + ': unload()');\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (fV === 8) {\r\n flash._unload(s.id, emptyURL);\r\n } else {\r\n flash._unload(s.id);\r\n }\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n\r\n s._a.pause();\r\n\r\n // update empty URL, too\r\n lastURL = html5Unload(s._a);\r\n\r\n }\r\n\r\n }\r\n\r\n // reset load/status flags\r\n resetProperties();\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unloads and destroys a sound.\r\n */\r\n\r\n this.destruct = function(_bFromSM) {\r\n\r\n sm2._wD(s.id + ': Destruct');\r\n\r\n if (!s.isHTML5) {\r\n\r\n // kill sound within Flash\r\n // Disable the onfailure handler\r\n s._iO.onfailure = null;\r\n flash._destroySound(s.id);\r\n\r\n } else {\r\n\r\n stop_html5_timer();\r\n\r\n if (s._a) {\r\n s._a.pause();\r\n html5Unload(s._a);\r\n if (!useGlobalHTML5Audio) {\r\n remove_html5_events();\r\n }\r\n // break obvious circular reference\r\n s._a._s = null;\r\n s._a = null;\r\n }\r\n\r\n }\r\n\r\n if (!_bFromSM) {\r\n // ensure deletion from controller\r\n sm2.destroySound(s.id, true);\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Begins playing a sound.\r\n *\r\n * @param {object} options Optional: Sound options\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.play = function(options, _updatePlayState) {\r\n\r\n var fN, allowMulti, a, onready,\r\n audioClone, onended, oncanplay,\r\n startOK = true;\r\n\r\n // <d>\r\n fN = s.id + ': play(): ';\r\n // </d>\r\n\r\n // default to true\r\n _updatePlayState = (_updatePlayState === _undefined ? true : _updatePlayState);\r\n\r\n if (!options) {\r\n options = {};\r\n }\r\n\r\n // first, use local URL (if specified)\r\n if (s.url) {\r\n s._iO.url = s.url;\r\n }\r\n\r\n // mix in any options defined at createSound()\r\n s._iO = mixin(s._iO, s.options);\r\n\r\n // mix in any options specific to this method\r\n s._iO = mixin(options, s._iO);\r\n\r\n s._iO.url = parseURL(s._iO.url);\r\n\r\n s.instanceOptions = s._iO;\r\n\r\n // RTMP-only\r\n if (!s.isHTML5 && s._iO.serverURL && !s.connected) {\r\n if (!s.getAutoPlay()) {\r\n sm2._wD(fN + ' Netstream not connected yet - setting autoPlay');\r\n s.setAutoPlay(true);\r\n }\r\n // play will be called in onconnect()\r\n return s;\r\n }\r\n\r\n if (html5OK(s._iO)) {\r\n s._setup_html5(s._iO);\r\n start_html5_timer();\r\n }\r\n\r\n if (s.playState === 1 && !s.paused) {\r\n\r\n allowMulti = s._iO.multiShot;\r\n\r\n if (!allowMulti) {\r\n\r\n sm2._wD(fN + 'Already playing (one-shot)', 1);\r\n\r\n if (s.isHTML5) {\r\n // go back to original position.\r\n s.setPosition(s._iO.position);\r\n }\r\n\r\n return s;\r\n\r\n }\r\n\r\n sm2._wD(fN + 'Already playing (multi-shot)', 1);\r\n\r\n }\r\n\r\n // edge case: play() with explicit URL parameter\r\n if (options.url && options.url !== s.url) {\r\n\r\n // special case for createSound() followed by load() / play() with url; avoid double-load case.\r\n if (!s.readyState && !s.isHTML5 && fV === 8 && urlOmitted) {\r\n\r\n urlOmitted = false;\r\n\r\n } else {\r\n\r\n // load using merged options\r\n s.load(s._iO);\r\n\r\n }\r\n\r\n }\r\n\r\n if (!s.loaded) {\r\n\r\n if (s.readyState === 0) {\r\n\r\n sm2._wD(fN + 'Attempting to load');\r\n\r\n // try to get this sound playing ASAP\r\n if (!s.isHTML5 && !sm2.html5Only) {\r\n\r\n // flash: assign directly because setAutoPlay() increments the instanceCount\r\n s._iO.autoPlay = true;\r\n s.load(s._iO);\r\n\r\n } else if (s.isHTML5) {\r\n\r\n // iOS needs this when recycling sounds, loading a new URL on an existing object.\r\n s.load(s._iO);\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Unsupported type. Exiting.');\r\n\r\n return s;\r\n\r\n }\r\n\r\n // HTML5 hack - re-set instanceOptions?\r\n s.instanceOptions = s._iO;\r\n\r\n } else if (s.readyState === 2) {\r\n\r\n sm2._wD(fN + 'Could not load - exiting', 2);\r\n\r\n return s;\r\n\r\n } else {\r\n\r\n sm2._wD(fN + 'Loading - attempting to play...');\r\n\r\n }\r\n\r\n } else {\r\n\r\n // \"play()\"\r\n sm2._wD(fN.substr(0, fN.lastIndexOf(':')));\r\n\r\n }\r\n\r\n if (!s.isHTML5 && fV === 9 && s.position > 0 && s.position === s.duration) {\r\n // flash 9 needs a position reset if play() is called while at the end of a sound.\r\n sm2._wD(fN + 'Sound at end, resetting to position: 0');\r\n options.position = 0;\r\n }\r\n\r\n /**\r\n * Streams will pause when their buffer is full if they are being loaded.\r\n * In this case paused is true, but the song hasn't started playing yet.\r\n * If we just call resume() the onplay() callback will never be called.\r\n * So only call resume() if the position is > 0.\r\n * Another reason is because options like volume won't have been applied yet.\r\n * For normal sounds, just resume.\r\n */\r\n\r\n if (s.paused && s.position >= 0 && (!s._iO.serverURL || s.position > 0)) {\r\n\r\n // https://gist.github.com/37b17df75cc4d7a90bf6\r\n sm2._wD(fN + 'Resuming from paused state', 1);\r\n s.resume();\r\n\r\n } else {\r\n\r\n s._iO = mixin(options, s._iO);\r\n\r\n /**\r\n * Preload in the event of play() with position under Flash,\r\n * or from/to parameters and non-RTMP case\r\n */\r\n if (((!s.isHTML5 && s._iO.position !== null && s._iO.position > 0) || (s._iO.from !== null && s._iO.from > 0) || s._iO.to !== null) && s.instanceCount === 0 && s.playState === 0 && !s._iO.serverURL) {\r\n\r\n onready = function() {\r\n // sound \"canplay\" or onload()\r\n // re-apply position/from/to to instance options, and start playback\r\n s._iO = mixin(options, s._iO);\r\n s.play(s._iO);\r\n };\r\n\r\n // HTML5 needs to at least have \"canplay\" fired before seeking.\r\n if (s.isHTML5 && !s._html5_canplay) {\r\n\r\n // this hasn't been loaded yet. load it first, and then do this again.\r\n sm2._wD(fN + 'Beginning load for non-zero offset case');\r\n\r\n s.load({\r\n // note: custom HTML5-only event added for from/to implementation.\r\n _oncanplay: onready\r\n });\r\n\r\n } else if (!s.isHTML5 && !s.loaded && (!s.readyState || s.readyState !== 2)) {\r\n\r\n // to be safe, preload the whole thing in Flash.\r\n\r\n sm2._wD(fN + 'Preloading for non-zero offset case');\r\n\r\n s.load({\r\n onload: onready\r\n });\r\n\r\n }\r\n\r\n // otherwise, we're ready to go. re-apply local options, and continue\r\n\r\n s._iO = applyFromTo();\r\n\r\n }\r\n\r\n // sm2._wD(fN + 'Starting to play');\r\n\r\n // increment instance counter, where enabled + supported\r\n if (!s.instanceCount || s._iO.multiShotEvents || (s.isHTML5 && s._iO.multiShot && !useGlobalHTML5Audio) || (!s.isHTML5 && fV > 8 && !s.getAutoPlay())) {\r\n s.instanceCount++;\r\n }\r\n\r\n // if first play and onposition parameters exist, apply them now\r\n if (s._iO.onposition && s.playState === 0) {\r\n attachOnPosition(s);\r\n }\r\n\r\n s.playState = 1;\r\n s.paused = false;\r\n\r\n s.position = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position : 0);\r\n\r\n if (!s.isHTML5) {\r\n s._iO = policyFix(loopFix(s._iO));\r\n }\r\n\r\n if (s._iO.onplay && _updatePlayState) {\r\n s._iO.onplay.apply(s);\r\n onplay_called = true;\r\n }\r\n\r\n s.setVolume(s._iO.volume, true);\r\n s.setPan(s._iO.pan, true);\r\n\r\n if (s._iO.playbackRate !== 1) {\r\n s.setPlaybackRate(s._iO.playbackRate);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n startOK = flash._start(s.id, s._iO.loops || 1, (fV === 9 ? s.position : s.position / msecScale), s._iO.multiShot || false);\r\n\r\n if (fV === 9 && !startOK) {\r\n // edge case: no sound hardware, or 32-channel flash ceiling hit.\r\n // applies only to Flash 9, non-NetStream/MovieStar sounds.\r\n // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/Sound.html#play%28%29\r\n sm2._wD(fN + 'No sound hardware, or 32-sound ceiling hit', 2);\r\n if (s._iO.onplayerror) {\r\n s._iO.onplayerror.apply(s);\r\n }\r\n\r\n }\r\n\r\n } else if (s.instanceCount < 2) {\r\n\r\n // HTML5 single-instance case\r\n\r\n start_html5_timer();\r\n\r\n a = s._setup_html5();\r\n\r\n s.setPosition(s._iO.position);\r\n\r\n a.play();\r\n\r\n } else {\r\n\r\n // HTML5 multi-shot case\r\n\r\n sm2._wD(s.id + ': Cloning Audio() for instance #' + s.instanceCount + '...');\r\n\r\n audioClone = new Audio(s._iO.url);\r\n\r\n onended = function() {\r\n event.remove(audioClone, 'ended', onended);\r\n s._onfinish(s);\r\n // cleanup\r\n html5Unload(audioClone);\r\n audioClone = null;\r\n };\r\n\r\n oncanplay = function() {\r\n event.remove(audioClone, 'canplay', oncanplay);\r\n try {\r\n audioClone.currentTime = s._iO.position / msecScale;\r\n } catch(err) {\r\n complain(s.id + ': multiShot play() failed to apply position of ' + (s._iO.position / msecScale));\r\n }\r\n audioClone.play();\r\n };\r\n\r\n event.add(audioClone, 'ended', onended);\r\n\r\n // apply volume to clones, too\r\n if (s._iO.volume !== _undefined) {\r\n audioClone.volume = Math.max(0, Math.min(1, s._iO.volume / 100));\r\n }\r\n\r\n // playing multiple muted sounds? if you do this, you're weird ;) - but let's cover it.\r\n if (s.muted) {\r\n audioClone.muted = true;\r\n }\r\n\r\n if (s._iO.position) {\r\n // HTML5 audio can't seek before onplay() event has fired.\r\n // wait for canplay, then seek to position and start playback.\r\n event.add(audioClone, 'canplay', oncanplay);\r\n } else {\r\n // begin playback at currentTime: 0\r\n audioClone.play();\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n // just for convenience\r\n this.start = this.play;\r\n\r\n /**\r\n * Stops playing a sound (and optionally, all sounds)\r\n *\r\n * @param {boolean} bAll Optional: Whether to stop all sounds\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.stop = function(bAll) {\r\n\r\n var instanceOptions = s._iO,\r\n originalPosition;\r\n\r\n if (s.playState === 1) {\r\n\r\n sm2._wD(s.id + ': stop()');\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n s.paused = false;\r\n\r\n if (!s.isHTML5) {\r\n s.playState = 0;\r\n }\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // and \"to\" position, if set\r\n if (instanceOptions.to) {\r\n s.clearOnPosition(instanceOptions.to);\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._stop(s.id, bAll);\r\n\r\n // hack for netStream: just unload\r\n if (instanceOptions.serverURL) {\r\n s.unload();\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n originalPosition = s.position;\r\n\r\n // act like Flash, though\r\n s.setPosition(0);\r\n\r\n // hack: reflect old position for onstop() (also like Flash)\r\n s.position = originalPosition;\r\n\r\n // html5 has no stop()\r\n // NOTE: pausing means iOS requires interaction to resume.\r\n s._a.pause();\r\n\r\n s.playState = 0;\r\n\r\n // and update UI\r\n s._onTimer();\r\n\r\n stop_html5_timer();\r\n\r\n }\r\n\r\n s.instanceCount = 0;\r\n s._iO = {};\r\n\r\n if (instanceOptions.onstop) {\r\n instanceOptions.onstop.apply(s);\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Sets autoPlay for RTMP.\r\n *\r\n * @param {boolean} autoPlay state\r\n */\r\n\r\n this.setAutoPlay = function(autoPlay) {\r\n\r\n sm2._wD(s.id + ': Autoplay turned ' + (autoPlay ? 'on' : 'off'));\r\n s._iO.autoPlay = autoPlay;\r\n\r\n if (!s.isHTML5) {\r\n flash._setAutoPlay(s.id, autoPlay);\r\n if (autoPlay) {\r\n // only increment the instanceCount if the sound isn't loaded (TODO: verify RTMP)\r\n if (!s.instanceCount && s.readyState === 1) {\r\n s.instanceCount++;\r\n sm2._wD(s.id + ': Incremented instance count to ' + s.instanceCount);\r\n }\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Undocumented/internal: Returns the autoPlay boolean.\r\n *\r\n * @return {boolean} The current autoPlay value\r\n */\r\n\r\n this.getAutoPlay = function() {\r\n\r\n return s._iO.autoPlay;\r\n\r\n };\r\n\r\n /**\r\n * Sets the playback rate of a sound (HTML5-only.)\r\n *\r\n * @param {number} playbackRate (+/-)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPlaybackRate = function(playbackRate) {\r\n\r\n // Per Mozilla, limit acceptable values to prevent playback from stopping (unless allowOverride is truthy.)\r\n // https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery/WebAudio_playbackRate_explained\r\n var normalizedRate = Math.max(0.5, Math.min(4, playbackRate));\r\n\r\n // <d>\r\n if (normalizedRate !== playbackRate) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + playbackRate + '): limiting rate to ' + normalizedRate, 2);\r\n }\r\n // </d>\r\n\r\n if (s.isHTML5) {\r\n try {\r\n s._iO.playbackRate = normalizedRate;\r\n s._a.playbackRate = normalizedRate;\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPlaybackRate(' + normalizedRate + ') failed: ' + e.message, 2);\r\n }\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the position of a sound.\r\n *\r\n * @param {number} nMsecOffset Position (milliseconds)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPosition = function(nMsecOffset) {\r\n\r\n if (nMsecOffset === _undefined) {\r\n nMsecOffset = 0;\r\n }\r\n\r\n var position, position1K,\r\n // Use the duration from the instance options, if we don't have a track duration yet.\r\n // position >= 0 and <= current available (loaded) duration\r\n offset = (s.isHTML5 ? Math.max(nMsecOffset, 0) : Math.min(s.duration || s._iO.duration, Math.max(nMsecOffset, 0)));\r\n\r\n s.position = offset;\r\n position1K = s.position / msecScale;\r\n s._resetOnPosition(s.position);\r\n s._iO.position = offset;\r\n\r\n if (!s.isHTML5) {\r\n\r\n position = (fV === 9 ? s.position : position1K);\r\n\r\n if (s.readyState && s.readyState !== 2) {\r\n // if paused or not playing, will not resume (by playing)\r\n flash._setPosition(s.id, position, (s.paused || !s.playState), s._iO.multiShot);\r\n }\r\n\r\n } else if (s._a) {\r\n\r\n // Set the position in the canplay handler if the sound is not ready yet\r\n if (s._html5_canplay) {\r\n\r\n if (s._a.currentTime.toFixed(3) !== position1K.toFixed(3)) {\r\n\r\n /**\r\n * DOM/JS errors/exceptions to watch out for:\r\n * if seek is beyond (loaded?) position, \"DOM exception 11\"\r\n * \"INDEX_SIZE_ERR\": DOM exception 1\r\n */\r\n sm2._wD(s.id + ': setPosition(' + position1K + ')');\r\n\r\n try {\r\n s._a.currentTime = position1K;\r\n if (s.playState === 0 || s.paused) {\r\n // allow seek without auto-play/resume\r\n s._a.pause();\r\n }\r\n } catch(e) {\r\n sm2._wD(s.id + ': setPosition(' + position1K + ') failed: ' + e.message, 2);\r\n }\r\n\r\n }\r\n\r\n } else if (position1K) {\r\n\r\n // warn on non-zero seek attempts\r\n sm2._wD(s.id + ': setPosition(' + position1K + '): Cannot seek yet, sound not ready', 2);\r\n return s;\r\n\r\n }\r\n\r\n if (s.paused) {\r\n\r\n // if paused, refresh UI right away by forcing update\r\n s._onTimer(true);\r\n\r\n }\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Pauses sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.pause = function(_bCallFlash) {\r\n\r\n if (s.paused || (s.playState === 0 && s.readyState !== 1)) return s;\r\n\r\n sm2._wD(s.id + ': pause()');\r\n s.paused = true;\r\n\r\n if (!s.isHTML5) {\r\n if (_bCallFlash || _bCallFlash === _undefined) {\r\n flash._pause(s.id, s._iO.multiShot);\r\n }\r\n } else {\r\n s._setup_html5().pause();\r\n stop_html5_timer();\r\n }\r\n\r\n if (s._iO.onpause) {\r\n s._iO.onpause.apply(s);\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Resumes sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n /**\r\n * When auto-loaded streams pause on buffer full they have a playState of 0.\r\n * We need to make sure that the playState is set to 1 when these streams \"resume\".\r\n * When a paused stream is resumed, we need to trigger the onplay() callback if it\r\n * hasn't been called already. In this case since the sound is being played for the\r\n * first time, I think it's more appropriate to call onplay() rather than onresume().\r\n */\r\n\r\n this.resume = function() {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n if (!s.paused) return s;\r\n\r\n sm2._wD(s.id + ': resume()');\r\n s.paused = false;\r\n s.playState = 1;\r\n\r\n if (!s.isHTML5) {\r\n\r\n if (instanceOptions.isMovieStar && !instanceOptions.serverURL) {\r\n // Bizarre Webkit bug (Chrome reported via 8tracks.com dudes): AAC content paused for 30+ seconds(?) will not resume without a reposition.\r\n s.setPosition(s.position);\r\n }\r\n\r\n // flash method is toggle-based (pause/resume)\r\n flash._pause(s.id, instanceOptions.multiShot);\r\n\r\n } else {\r\n\r\n s._setup_html5().play();\r\n start_html5_timer();\r\n\r\n }\r\n\r\n if (!onplay_called && instanceOptions.onplay) {\r\n\r\n instanceOptions.onplay.apply(s);\r\n onplay_called = true;\r\n\r\n } else if (instanceOptions.onresume) {\r\n\r\n instanceOptions.onresume.apply(s);\r\n\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles sound playback.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.togglePause = function() {\r\n\r\n sm2._wD(s.id + ': togglePause()');\r\n\r\n if (s.playState === 0) {\r\n s.play({\r\n position: (fV === 9 && !s.isHTML5 ? s.position : s.position / msecScale)\r\n });\r\n return s;\r\n }\r\n\r\n if (s.paused) {\r\n s.resume();\r\n } else {\r\n s.pause();\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the panning (L-R) effect.\r\n *\r\n * @param {number} nPan The pan value (-100 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setPan = function(nPan, bInstanceOnly) {\r\n\r\n if (nPan === _undefined) {\r\n nPan = 0;\r\n }\r\n\r\n if (bInstanceOnly === _undefined) {\r\n bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n flash._setPan(s.id, nPan);\r\n } // else { no HTML5 pan? }\r\n\r\n s._iO.pan = nPan;\r\n\r\n if (!bInstanceOnly) {\r\n s.pan = nPan;\r\n s.options.pan = nPan;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Sets the volume.\r\n *\r\n * @param {number} nVol The volume value (0 to 100)\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.setVolume = function(nVol, _bInstanceOnly) {\r\n\r\n /**\r\n * Note: Setting volume has no effect on iOS \"special snowflake\" devices.\r\n * Hardware volume control overrides software, and volume\r\n * will always return 1 per Apple docs. (iOS 4 + 5.)\r\n * http://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/HTML-canvas-guide/AddingSoundtoCanvasAnimations/AddingSoundtoCanvasAnimations.html\r\n */\r\n\r\n if (nVol === _undefined) {\r\n nVol = 100;\r\n }\r\n\r\n if (_bInstanceOnly === _undefined) {\r\n _bInstanceOnly = false;\r\n }\r\n\r\n if (!s.isHTML5) {\r\n\r\n flash._setVolume(s.id, (sm2.muted && !s.muted) || s.muted ? 0 : nVol);\r\n\r\n } else if (s._a) {\r\n\r\n if (sm2.muted && !s.muted) {\r\n s.muted = true;\r\n s._a.muted = true;\r\n }\r\n\r\n // valid range for native HTML5 Audio(): 0-1\r\n s._a.volume = Math.max(0, Math.min(1, nVol / 100));\r\n\r\n }\r\n\r\n s._iO.volume = nVol;\r\n\r\n if (!_bInstanceOnly) {\r\n s.volume = nVol;\r\n s.options.volume = nVol;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Mutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.mute = function() {\r\n\r\n s.muted = true;\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, 0);\r\n } else if (s._a) {\r\n s._a.muted = true;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Unmutes the sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.unmute = function() {\r\n\r\n s.muted = false;\r\n var hasIO = (s._iO.volume !== _undefined);\r\n\r\n if (!s.isHTML5) {\r\n flash._setVolume(s.id, hasIO ? s._iO.volume : s.options.volume);\r\n } else if (s._a) {\r\n s._a.muted = false;\r\n }\r\n\r\n return s;\r\n\r\n };\r\n\r\n /**\r\n * Toggles the muted state of a sound.\r\n *\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.toggleMute = function() {\r\n\r\n return (s.muted ? s.unmute() : s.mute());\r\n\r\n };\r\n\r\n /**\r\n * Registers a callback to be fired when a sound reaches a given position during playback.\r\n *\r\n * @param {number} nPosition The position to watch for\r\n * @param {function} oMethod The relevant callback to fire\r\n * @param {object} oScope Optional: The scope to apply the callback to\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.onPosition = function(nPosition, oMethod, oScope) {\r\n\r\n // TODO: basic dupe checking?\r\n\r\n onPositionItems.push({\r\n position: parseInt(nPosition, 10),\r\n method: oMethod,\r\n scope: (oScope !== _undefined ? oScope : s),\r\n fired: false\r\n });\r\n\r\n return s;\r\n\r\n };\r\n\r\n // legacy/backwards-compability: lower-case method name\r\n this.onposition = this.onPosition;\r\n\r\n /**\r\n * Removes registered callback(s) from a sound, by position and/or callback.\r\n *\r\n * @param {number} nPosition The position to clear callback(s) for\r\n * @param {function} oMethod Optional: Identify one callback to be removed when multiple listeners exist for one position\r\n * @return {SMSound} The SMSound object\r\n */\r\n\r\n this.clearOnPosition = function(nPosition, oMethod) {\r\n\r\n var i;\r\n\r\n nPosition = parseInt(nPosition, 10);\r\n\r\n if (isNaN(nPosition)) {\r\n // safety check\r\n return;\r\n }\r\n\r\n for (i = 0; i < onPositionItems.length; i++) {\r\n\r\n if (nPosition === onPositionItems[i].position) {\r\n // remove this item if no method was specified, or, if the method matches\r\n\r\n if (!oMethod || (oMethod === onPositionItems[i].method)) {\r\n\r\n if (onPositionItems[i].fired) {\r\n // decrement \"fired\" counter, too\r\n onPositionFired--;\r\n }\r\n\r\n onPositionItems.splice(i, 1);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._processOnPosition = function() {\r\n\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j || !s.playState || onPositionFired >= j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (!item.fired && s.position >= item.position) {\r\n\r\n item.fired = true;\r\n onPositionFired++;\r\n item.method.apply(item.scope, [item.position]);\r\n\r\n // reset j -- onPositionItems.length can be changed in the item callback above... occasionally breaking the loop.\r\n j = onPositionItems.length;\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._resetOnPosition = function(nPosition) {\r\n\r\n // reset \"fired\" for items interested in this position\r\n var i, item, j = onPositionItems.length;\r\n\r\n if (!j) return false;\r\n\r\n for (i = j - 1; i >= 0; i--) {\r\n\r\n item = onPositionItems[i];\r\n\r\n if (item.fired && nPosition <= item.position) {\r\n item.fired = false;\r\n onPositionFired--;\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * SMSound() private internals\r\n * --------------------------------\r\n */\r\n\r\n applyFromTo = function() {\r\n\r\n var instanceOptions = s._iO,\r\n f = instanceOptions.from,\r\n t = instanceOptions.to,\r\n start, end;\r\n\r\n end = function() {\r\n\r\n // end has been reached.\r\n sm2._wD(s.id + ': \"To\" time of ' + t + ' reached.');\r\n\r\n // detach listener\r\n s.clearOnPosition(t, end);\r\n\r\n // stop should clear this, too\r\n s.stop();\r\n\r\n };\r\n\r\n start = function() {\r\n\r\n sm2._wD(s.id + ': Playing \"from\" ' + f);\r\n\r\n // add listener for end\r\n if (t !== null && !isNaN(t)) {\r\n s.onPosition(t, end);\r\n }\r\n\r\n };\r\n\r\n if (f !== null && !isNaN(f)) {\r\n\r\n // apply to instance options, guaranteeing correct start position.\r\n instanceOptions.position = f;\r\n\r\n // multiShot timing can't be tracked, so prevent that.\r\n instanceOptions.multiShot = false;\r\n\r\n start();\r\n\r\n }\r\n\r\n // return updated instanceOptions including starting position\r\n return instanceOptions;\r\n\r\n };\r\n\r\n attachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // attach onposition things, if any, now.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.onPosition(parseInt(item, 10), op[item]);\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n detachOnPosition = function() {\r\n\r\n var item,\r\n op = s._iO.onposition;\r\n\r\n // detach any onposition()-style listeners.\r\n\r\n if (op) {\r\n\r\n for (item in op) {\r\n if (op.hasOwnProperty(item)) {\r\n s.clearOnPosition(parseInt(item, 10));\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n start_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n startTimer(s);\r\n }\r\n\r\n };\r\n\r\n stop_html5_timer = function() {\r\n\r\n if (s.isHTML5) {\r\n stopTimer(s);\r\n }\r\n\r\n };\r\n\r\n resetProperties = function(retainPosition) {\r\n\r\n if (!retainPosition) {\r\n onPositionItems = [];\r\n onPositionFired = 0;\r\n }\r\n\r\n onplay_called = false;\r\n\r\n s._hasTimer = null;\r\n s._a = null;\r\n s._html5_canplay = false;\r\n s.bytesLoaded = null;\r\n s.bytesTotal = null;\r\n s.duration = (s._iO && s._iO.duration ? s._iO.duration : null);\r\n s.durationEstimate = null;\r\n s.buffered = [];\r\n\r\n // legacy: 1D array\r\n s.eqData = [];\r\n\r\n s.eqData.left = [];\r\n s.eqData.right = [];\r\n\r\n s.failures = 0;\r\n s.isBuffering = false;\r\n s.instanceOptions = {};\r\n s.instanceCount = 0;\r\n s.loaded = false;\r\n s.metadata = {};\r\n\r\n // 0 = uninitialised, 1 = loading, 2 = failed/error, 3 = loaded/success\r\n s.readyState = 0;\r\n\r\n s.muted = false;\r\n s.paused = false;\r\n\r\n s.peakData = {\r\n left: 0,\r\n right: 0\r\n };\r\n\r\n s.waveformData = {\r\n left: [],\r\n right: []\r\n };\r\n\r\n s.playState = 0;\r\n s.position = null;\r\n\r\n s.id3 = {};\r\n\r\n };\r\n\r\n resetProperties();\r\n\r\n /**\r\n * Pseudo-private SMSound internals\r\n * --------------------------------\r\n */\r\n\r\n this._onTimer = function(bForce) {\r\n\r\n /**\r\n * HTML5-only _whileplaying() etc.\r\n * called from both HTML5 native events, and polling/interval-based timers\r\n * mimics flash and fires only when time/duration change, so as to be polling-friendly\r\n */\r\n\r\n var duration, isNew = false, time, x = {};\r\n\r\n if (s._hasTimer || bForce) {\r\n\r\n // TODO: May not need to track readyState (1 = loading)\r\n\r\n if (s._a && (bForce || ((s.playState > 0 || s.readyState === 1) && !s.paused))) {\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (duration !== lastHTML5State.duration) {\r\n\r\n lastHTML5State.duration = duration;\r\n s.duration = duration;\r\n isNew = true;\r\n\r\n }\r\n\r\n // TODO: investigate why this goes wack if not set/re-set each time.\r\n s.durationEstimate = s.duration;\r\n\r\n time = (s._a.currentTime * msecScale || 0);\r\n\r\n if (time !== lastHTML5State.time) {\r\n\r\n lastHTML5State.time = time;\r\n isNew = true;\r\n\r\n }\r\n\r\n if (isNew || bForce) {\r\n\r\n s._whileplaying(time, x, x, x, x);\r\n\r\n }\r\n\r\n }/* else {\r\n\r\n // sm2._wD('_onTimer: Warn for \"'+s.id+'\": '+(!s._a?'Could not find element. ':'')+(s.playState === 0?'playState bad, 0?':'playState = '+s.playState+', OK'));\r\n\r\n return false;\r\n\r\n }*/\r\n\r\n }\r\n\r\n return isNew;\r\n\r\n };\r\n\r\n this._get_html5_duration = function() {\r\n\r\n var instanceOptions = s._iO,\r\n // if audio object exists, use its duration - else, instance option duration (if provided - it's a hack, really, and should be retired) OR null\r\n d = (s._a && s._a.duration ? s._a.duration * msecScale : (instanceOptions && instanceOptions.duration ? instanceOptions.duration : null)),\r\n result = (d && !isNaN(d) && d !== Infinity ? d : null);\r\n\r\n return result;\r\n\r\n };\r\n\r\n this._apply_loop = function(a, nLoops) {\r\n\r\n /**\r\n * boolean instead of \"loop\", for webkit? - spec says string. http://www.w3.org/TR/html-markup/audio.html#audio.attrs.loop\r\n * note that loop is either off or infinite under HTML5, unlike Flash which allows arbitrary loop counts to be specified.\r\n */\r\n\r\n // <d>\r\n if (!a.loop && nLoops > 1) {\r\n sm2._wD('Note: Native HTML5 looping is infinite.', 1);\r\n }\r\n // </d>\r\n\r\n a.loop = (nLoops > 1 ? 'loop' : '');\r\n\r\n };\r\n\r\n this._setup_html5 = function(options) {\r\n\r\n var instanceOptions = mixin(s._iO, options),\r\n a = useGlobalHTML5Audio ? globalHTML5Audio : s._a,\r\n dURL = decodeURI(instanceOptions.url),\r\n sameURL;\r\n\r\n /**\r\n * \"First things first, I, Poppa...\" (reset the previous state of the old sound, if playing)\r\n * Fixes case with devices that can only play one sound at a time\r\n * Otherwise, other sounds in mid-play will be terminated without warning and in a stuck state\r\n */\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (dURL === decodeURI(lastGlobalHTML5URL)) {\r\n // global HTML5 audio: re-use of URL\r\n sameURL = true;\r\n }\r\n\r\n } else if (dURL === decodeURI(lastURL)) {\r\n\r\n // options URL is the same as the \"last\" URL, and we used (loaded) it\r\n sameURL = true;\r\n\r\n }\r\n\r\n if (a) {\r\n\r\n if (a._s) {\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n if (a._s && a._s.playState && !sameURL) {\r\n\r\n // global HTML5 audio case, and loading a new URL. stop the currently-playing one.\r\n a._s.stop();\r\n\r\n }\r\n\r\n } else if (!useGlobalHTML5Audio && dURL === decodeURI(lastURL)) {\r\n\r\n // non-global HTML5 reuse case: same url, ignore request\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n return a;\r\n\r\n }\r\n\r\n }\r\n\r\n if (!sameURL) {\r\n\r\n // don't retain onPosition() stuff with new URLs.\r\n\r\n if (lastURL) {\r\n resetProperties(false);\r\n }\r\n\r\n // assign new HTML5 URL\r\n\r\n a.src = instanceOptions.url;\r\n\r\n s.url = instanceOptions.url;\r\n\r\n lastURL = instanceOptions.url;\r\n\r\n lastGlobalHTML5URL = instanceOptions.url;\r\n\r\n a._called_load = false;\r\n\r\n }\r\n\r\n } else {\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s._a = new Audio(instanceOptions.url);\r\n s._a.load();\r\n\r\n } else {\r\n\r\n // null for stupid Opera 9.64 case\r\n s._a = (isOpera && opera.version() < 10 ? new Audio(null) : new Audio());\r\n\r\n }\r\n\r\n // assign local reference\r\n a = s._a;\r\n\r\n a._called_load = false;\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n globalHTML5Audio = a;\r\n\r\n }\r\n\r\n }\r\n\r\n s.isHTML5 = true;\r\n\r\n // store a ref on the track\r\n s._a = a;\r\n\r\n // store a ref on the audio\r\n a._s = s;\r\n\r\n add_html5_events();\r\n\r\n s._apply_loop(a, instanceOptions.loops);\r\n\r\n if (instanceOptions.autoLoad || instanceOptions.autoPlay) {\r\n\r\n s.load();\r\n\r\n } else {\r\n\r\n // early HTML5 implementation (non-standard)\r\n a.autobuffer = false;\r\n\r\n // standard ('none' is also an option.)\r\n a.preload = 'auto';\r\n\r\n }\r\n\r\n return a;\r\n\r\n };\r\n\r\n add_html5_events = function() {\r\n\r\n if (s._a._added_events) return false;\r\n\r\n var f;\r\n\r\n function add(oEvt, oFn, bCapture) {\r\n return s._a ? s._a.addEventListener(oEvt, oFn, bCapture || false) : null;\r\n }\r\n\r\n s._a._added_events = true;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n add(f, html5_events[f]);\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n remove_html5_events = function() {\r\n\r\n // Remove event listeners\r\n\r\n var f;\r\n\r\n function remove(oEvt, oFn, bCapture) {\r\n return (s._a ? s._a.removeEventListener(oEvt, oFn, bCapture || false) : null);\r\n }\r\n\r\n sm2._wD(s.id + ': Removing event listeners');\r\n s._a._added_events = false;\r\n\r\n for (f in html5_events) {\r\n if (html5_events.hasOwnProperty(f)) {\r\n remove(f, html5_events[f]);\r\n }\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private event internals\r\n * ------------------------------\r\n */\r\n\r\n this._onload = function(nSuccess) {\r\n\r\n var fN,\r\n // check for duration to prevent false positives from flash 8 when loading from cache.\r\n loadOK = !!nSuccess || (!s.isHTML5 && fV === 8 && s.duration);\r\n\r\n // <d>\r\n fN = s.id + ': ';\r\n sm2._wD(fN + (loadOK ? 'onload()' : 'Failed to load / invalid sound?' + (!s.duration ? ' Zero-length duration reported.' : ' -') + ' (' + s.url + ')'), (loadOK ? 1 : 2));\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n if (sm2.sandbox.noRemote === true) {\r\n sm2._wD(fN + str('noNet'), 1);\r\n }\r\n if (sm2.sandbox.noLocal === true) {\r\n sm2._wD(fN + str('noLocal'), 1);\r\n }\r\n }\r\n // </d>\r\n\r\n s.loaded = loadOK;\r\n s.readyState = (loadOK ? 3 : 2);\r\n s._onbufferchange(0);\r\n\r\n if (!loadOK && !s.isHTML5) {\r\n // note: no error code from Flash.\r\n s._onerror();\r\n }\r\n\r\n if (s._iO.onload) {\r\n wrapCallback(s, function() {\r\n s._iO.onload.apply(s, [loadOK]);\r\n });\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._onerror = function(errorCode, description) {\r\n\r\n // https://html.spec.whatwg.org/multipage/embedded-content.html#error-codes\r\n if (s._iO.onerror) {\r\n wrapCallback(s, function() {\r\n s._iO.onerror.apply(s, [errorCode, description]);\r\n });\r\n }\r\n\r\n };\r\n\r\n this._onbufferchange = function(nIsBuffering) {\r\n\r\n // ignore if not playing\r\n if (s.playState === 0) return false;\r\n\r\n if ((nIsBuffering && s.isBuffering) || (!nIsBuffering && !s.isBuffering)) return false;\r\n\r\n s.isBuffering = (nIsBuffering === 1);\r\n\r\n if (s._iO.onbufferchange) {\r\n sm2._wD(s.id + ': Buffer state change: ' + nIsBuffering);\r\n s._iO.onbufferchange.apply(s, [nIsBuffering]);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * Playback may have stopped due to buffering, or related reason.\r\n * This state can be encountered on iOS < 6 when auto-play is blocked.\r\n */\r\n\r\n this._onsuspend = function() {\r\n\r\n if (s._iO.onsuspend) {\r\n sm2._wD(s.id + ': Playback suspended');\r\n s._iO.onsuspend.apply(s);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method, should fire only once at most\r\n * at this point we just recreate failed sounds rather than trying to reconnect\r\n */\r\n\r\n this._onfailure = function(msg, level, code) {\r\n\r\n s.failures++;\r\n sm2._wD(s.id + ': Failure (' + s.failures + '): ' + msg);\r\n\r\n if (s._iO.onfailure && s.failures === 1) {\r\n s._iO.onfailure(msg, level, code);\r\n } else {\r\n sm2._wD(s.id + ': Ignoring failure');\r\n }\r\n\r\n };\r\n\r\n /**\r\n * flash 9/movieStar + RTMP-only method for unhandled warnings/exceptions from Flash\r\n * e.g., RTMP \"method missing\" warning (non-fatal) for getStreamLength on server\r\n */\r\n\r\n this._onwarning = function(msg, level, code) {\r\n\r\n if (s._iO.onwarning) {\r\n s._iO.onwarning(msg, level, code);\r\n }\r\n\r\n };\r\n\r\n this._onfinish = function() {\r\n\r\n // store local copy before it gets trashed...\r\n var io_onfinish = s._iO.onfinish;\r\n\r\n s._onbufferchange(0);\r\n s._resetOnPosition(0);\r\n\r\n // reset some state items\r\n if (s.instanceCount) {\r\n\r\n s.instanceCount--;\r\n\r\n if (!s.instanceCount) {\r\n\r\n // remove onPosition listeners, if any\r\n detachOnPosition();\r\n\r\n // reset instance options\r\n s.playState = 0;\r\n s.paused = false;\r\n s.instanceCount = 0;\r\n s.instanceOptions = {};\r\n s._iO = {};\r\n stop_html5_timer();\r\n\r\n // reset position, too\r\n if (s.isHTML5) {\r\n s.position = 0;\r\n }\r\n\r\n }\r\n\r\n if (!s.instanceCount || s._iO.multiShotEvents) {\r\n // fire onfinish for last, or every instance\r\n if (io_onfinish) {\r\n sm2._wD(s.id + ': onfinish()');\r\n wrapCallback(s, function() {\r\n io_onfinish.apply(s);\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._whileloading = function(nBytesLoaded, nBytesTotal, nDuration, nBufferLength) {\r\n\r\n var instanceOptions = s._iO;\r\n\r\n s.bytesLoaded = nBytesLoaded;\r\n s.bytesTotal = nBytesTotal;\r\n s.duration = Math.floor(nDuration);\r\n s.bufferLength = nBufferLength;\r\n\r\n if (!s.isHTML5 && !instanceOptions.isMovieStar) {\r\n\r\n if (instanceOptions.duration) {\r\n // use duration from options, if specified and larger. nobody should be specifying duration in options, actually, and it should be retired.\r\n s.durationEstimate = (s.duration > instanceOptions.duration) ? s.duration : instanceOptions.duration;\r\n } else {\r\n s.durationEstimate = parseInt((s.bytesTotal / s.bytesLoaded) * s.duration, 10);\r\n }\r\n\r\n } else {\r\n\r\n s.durationEstimate = s.duration;\r\n\r\n }\r\n\r\n // for flash, reflect sequential-load-style buffering\r\n if (!s.isHTML5) {\r\n s.buffered = [{\r\n start: 0,\r\n end: s.duration\r\n }];\r\n }\r\n\r\n // allow whileloading to fire even if \"load\" fired under HTML5, due to HTTP range/partials\r\n if ((s.readyState !== 3 || s.isHTML5) && instanceOptions.whileloading) {\r\n instanceOptions.whileloading.apply(s);\r\n }\r\n\r\n };\r\n\r\n this._whileplaying = function(nPosition, oPeakData, oWaveformDataLeft, oWaveformDataRight, oEQData) {\r\n\r\n var instanceOptions = s._iO,\r\n eqLeft;\r\n\r\n // flash safety net\r\n if (isNaN(nPosition) || nPosition === null) return false;\r\n\r\n // Safari HTML5 play() may return small -ve values when starting from position: 0, eg. -50.120396875. Unexpected/invalid per W3, I think. Normalize to 0.\r\n s.position = Math.max(0, nPosition);\r\n\r\n s._processOnPosition();\r\n\r\n if (!s.isHTML5 && fV > 8) {\r\n\r\n if (instanceOptions.usePeakData && oPeakData !== _undefined && oPeakData) {\r\n s.peakData = {\r\n left: oPeakData.leftPeak,\r\n right: oPeakData.rightPeak\r\n };\r\n }\r\n\r\n if (instanceOptions.useWaveformData && oWaveformDataLeft !== _undefined && oWaveformDataLeft) {\r\n s.waveformData = {\r\n left: oWaveformDataLeft.split(','),\r\n right: oWaveformDataRight.split(',')\r\n };\r\n }\r\n\r\n if (instanceOptions.useEQData) {\r\n if (oEQData !== _undefined && oEQData && oEQData.leftEQ) {\r\n eqLeft = oEQData.leftEQ.split(',');\r\n s.eqData = eqLeft;\r\n s.eqData.left = eqLeft;\r\n if (oEQData.rightEQ !== _undefined && oEQData.rightEQ) {\r\n s.eqData.right = oEQData.rightEQ.split(',');\r\n }\r\n }\r\n }\r\n\r\n }\r\n\r\n if (s.playState === 1) {\r\n\r\n // special case/hack: ensure buffering is false if loading from cache (and not yet started)\r\n if (!s.isHTML5 && fV === 8 && !s.position && s.isBuffering) {\r\n s._onbufferchange(0);\r\n }\r\n\r\n if (instanceOptions.whileplaying) {\r\n // flash may call after actual finish\r\n instanceOptions.whileplaying.apply(s);\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n this._oncaptiondata = function(oData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n *\r\n * @param {object} oData\r\n */\r\n\r\n sm2._wD(s.id + ': Caption data received.');\r\n\r\n s.captiondata = oData;\r\n\r\n if (s._iO.oncaptiondata) {\r\n s._iO.oncaptiondata.apply(s, [oData]);\r\n }\r\n\r\n };\r\n\r\n this._onmetadata = function(oMDProps, oMDData) {\r\n\r\n /**\r\n * internal: flash 9 + NetStream (MovieStar/RTMP-only) feature\r\n * RTMP may include song title, MovieStar content may include encoding info\r\n *\r\n * @param {array} oMDProps (names)\r\n * @param {array} oMDData (values)\r\n */\r\n\r\n sm2._wD(s.id + ': Metadata received.');\r\n\r\n var oData = {}, i, j;\r\n\r\n for (i = 0, j = oMDProps.length; i < j; i++) {\r\n oData[oMDProps[i]] = oMDData[i];\r\n }\r\n\r\n s.metadata = oData;\r\n\r\n if (s._iO.onmetadata) {\r\n s._iO.onmetadata.call(s, s.metadata);\r\n }\r\n\r\n };\r\n\r\n this._onid3 = function(oID3Props, oID3Data) {\r\n\r\n /**\r\n * internal: flash 8 + flash 9 ID3 feature\r\n * may include artist, song title etc.\r\n *\r\n * @param {array} oID3Props (names)\r\n * @param {array} oID3Data (values)\r\n */\r\n\r\n sm2._wD(s.id + ': ID3 data received.');\r\n\r\n var oData = [], i, j;\r\n\r\n for (i = 0, j = oID3Props.length; i < j; i++) {\r\n oData[oID3Props[i]] = oID3Data[i];\r\n }\r\n\r\n s.id3 = mixin(s.id3, oData);\r\n\r\n if (s._iO.onid3) {\r\n s._iO.onid3.apply(s);\r\n }\r\n\r\n };\r\n\r\n // flash/RTMP-only\r\n\r\n this._onconnect = function(bSuccess) {\r\n\r\n bSuccess = (bSuccess === 1);\r\n sm2._wD(s.id + ': ' + (bSuccess ? 'Connected.' : 'Failed to connect? - ' + s.url), (bSuccess ? 1 : 2));\r\n s.connected = bSuccess;\r\n\r\n if (bSuccess) {\r\n\r\n s.failures = 0;\r\n\r\n if (idCheck(s.id)) {\r\n if (s.getAutoPlay()) {\r\n // only update the play state if auto playing\r\n s.play(_undefined, s.getAutoPlay());\r\n } else if (s._iO.autoLoad) {\r\n s.load();\r\n }\r\n }\r\n\r\n if (s._iO.onconnect) {\r\n s._iO.onconnect.apply(s, [bSuccess]);\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n this._ondataerror = function(sError) {\r\n\r\n // flash 9 wave/eq data handler\r\n // hack: called at start, and end from flash at/after onfinish()\r\n if (s.playState > 0) {\r\n sm2._wD(s.id + ': Data error: ' + sError);\r\n if (s._iO.ondataerror) {\r\n s._iO.ondataerror.apply(s);\r\n }\r\n }\r\n\r\n };\r\n\r\n // <d>\r\n this._debug();\r\n // </d>\r\n\r\n }; // SMSound()\r\n\r\n /**\r\n * Private SoundManager internals\r\n * ------------------------------\r\n */\r\n\r\n getDocument = function() {\r\n\r\n return (doc.body || doc.getElementsByTagName('div')[0]);\r\n\r\n };\r\n\r\n id = function(sID) {\r\n\r\n return doc.getElementById(sID);\r\n\r\n };\r\n\r\n mixin = function(oMain, oAdd) {\r\n\r\n // non-destructive merge\r\n var o1 = (oMain || {}), o2, o;\r\n\r\n // if unspecified, o2 is the default options object\r\n o2 = (oAdd === _undefined ? sm2.defaultOptions : oAdd);\r\n\r\n for (o in o2) {\r\n\r\n if (o2.hasOwnProperty(o) && o1[o] === _undefined) {\r\n\r\n if (typeof o2[o] !== 'object' || o2[o] === null) {\r\n\r\n // assign directly\r\n o1[o] = o2[o];\r\n\r\n } else {\r\n\r\n // recurse through o2\r\n o1[o] = mixin(o1[o], o2[o]);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return o1;\r\n\r\n };\r\n\r\n wrapCallback = function(oSound, callback) {\r\n\r\n /**\r\n * 03/03/2013: Fix for Flash Player 11.6.602.171 + Flash 8 (flashVersion = 8) SWF issue\r\n * setTimeout() fix for certain SMSound callbacks like onload() and onfinish(), where subsequent calls like play() and load() fail when Flash Player 11.6.602.171 is installed, and using soundManager with flashVersion = 8 (which is the default).\r\n * Not sure of exact cause. Suspect race condition and/or invalid (NaN-style) position argument trickling down to the next JS -> Flash _start() call, in the play() case.\r\n * Fix: setTimeout() to yield, plus safer null / NaN checking on position argument provided to Flash.\r\n * https://getsatisfaction.com/schillmania/topics/recent_chrome_update_seems_to_have_broken_my_sm2_audio_player\r\n */\r\n if (!oSound.isHTML5 && fV === 8) {\r\n window.setTimeout(callback, 0);\r\n } else {\r\n callback();\r\n }\r\n\r\n };\r\n\r\n // additional soundManager properties that soundManager.setup() will accept\r\n\r\n extraOptions = {\r\n onready: 1,\r\n ontimeout: 1,\r\n defaultOptions: 1,\r\n flash9Options: 1,\r\n movieStarOptions: 1\r\n };\r\n\r\n assign = function(o, oParent) {\r\n\r\n /**\r\n * recursive assignment of properties, soundManager.setup() helper\r\n * allows property assignment based on whitelist\r\n */\r\n\r\n var i,\r\n result = true,\r\n hasParent = (oParent !== _undefined),\r\n setupOptions = sm2.setupOptions,\r\n bonusOptions = extraOptions;\r\n\r\n // <d>\r\n\r\n // if soundManager.setup() called, show accepted parameters.\r\n\r\n if (o === _undefined) {\r\n\r\n result = [];\r\n\r\n for (i in setupOptions) {\r\n\r\n if (setupOptions.hasOwnProperty(i)) {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n for (i in bonusOptions) {\r\n\r\n if (bonusOptions.hasOwnProperty(i)) {\r\n\r\n if (typeof sm2[i] === 'object') {\r\n result.push(i + ': {...}');\r\n } else if (sm2[i] instanceof Function) {\r\n result.push(i + ': function() {...}');\r\n } else {\r\n result.push(i);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n sm2._wD(str('setup', result.join(', ')));\r\n\r\n return false;\r\n\r\n }\r\n\r\n // </d>\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // if not an {object} we want to recurse through...\r\n\r\n if (typeof o[i] !== 'object' || o[i] === null || o[i] instanceof Array || o[i] instanceof RegExp) {\r\n\r\n // check \"allowed\" options\r\n\r\n if (hasParent && bonusOptions[oParent] !== _undefined) {\r\n\r\n // valid recursive / nested object option, eg., { defaultOptions: { volume: 50 } }\r\n sm2[oParent][i] = o[i];\r\n\r\n } else if (setupOptions[i] !== _undefined) {\r\n\r\n // special case: assign to setupOptions object, which soundManager property references\r\n sm2.setupOptions[i] = o[i];\r\n\r\n // assign directly to soundManager, too\r\n sm2[i] = o[i];\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else if (sm2[i] instanceof Function) {\r\n\r\n /**\r\n * valid extraOptions (bonusOptions) parameter.\r\n * is it a method, like onready/ontimeout? call it.\r\n * multiple parameters should be in an array, eg. soundManager.setup({onready: [myHandler, myScope]});\r\n */\r\n sm2[i].apply(sm2, (o[i] instanceof Array ? o[i] : [o[i]]));\r\n\r\n } else {\r\n\r\n // good old-fashioned direct assignment\r\n sm2[i] = o[i];\r\n\r\n }\r\n\r\n } else if (bonusOptions[i] === _undefined) {\r\n\r\n // recursion case, eg., { defaultOptions: { ... } }\r\n\r\n // invalid or disallowed parameter. complain.\r\n complain(str((sm2[i] === _undefined ? 'setupUndef' : 'setupError'), i), 2);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // recurse through object\r\n return assign(o[i], i);\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n function preferFlashCheck(kind) {\r\n\r\n // whether flash should play a given type\r\n return (sm2.preferFlash && hasFlash && !sm2.ignoreFlash && (sm2.flash[kind] !== _undefined && sm2.flash[kind]));\r\n\r\n }\r\n\r\n /**\r\n * Internal DOM2-level event helpers\r\n * ---------------------------------\r\n */\r\n\r\n event = (function() {\r\n\r\n // normalize event methods\r\n var old = (window.attachEvent),\r\n evt = {\r\n add: (old ? 'attachEvent' : 'addEventListener'),\r\n remove: (old ? 'detachEvent' : 'removeEventListener')\r\n };\r\n\r\n // normalize \"on\" event prefix, optional capture argument\r\n function getArgs(oArgs) {\r\n\r\n var args = slice.call(oArgs),\r\n len = args.length;\r\n\r\n if (old) {\r\n // prefix\r\n args[1] = 'on' + args[1];\r\n if (len > 3) {\r\n // no capture\r\n args.pop();\r\n }\r\n } else if (len === 3) {\r\n args.push(false);\r\n }\r\n\r\n return args;\r\n\r\n }\r\n\r\n function apply(args, sType) {\r\n\r\n // normalize and call the event method, with the proper arguments\r\n var element = args.shift(),\r\n method = [evt[sType]];\r\n\r\n if (old) {\r\n // old IE can't do apply().\r\n element[method](args[0], args[1]);\r\n } else {\r\n element[method].apply(element, args);\r\n }\r\n\r\n }\r\n\r\n function add() {\r\n apply(getArgs(arguments), 'add');\r\n }\r\n\r\n function remove() {\r\n apply(getArgs(arguments), 'remove');\r\n }\r\n\r\n return {\r\n add: add,\r\n remove: remove\r\n };\r\n\r\n }());\r\n\r\n /**\r\n * Internal HTML5 event handling\r\n * -----------------------------\r\n */\r\n\r\n function html5_event(oFn) {\r\n\r\n // wrap html5 event handlers so we don't call them on destroyed and/or unloaded sounds\r\n\r\n return function(e) {\r\n\r\n var s = this._s,\r\n result;\r\n\r\n if (!s || !s._a) {\r\n // <d>\r\n if (s && s.id) {\r\n sm2._wD(s.id + ': Ignoring ' + e.type);\r\n } else {\r\n sm2._wD(h5 + 'Ignoring ' + e.type);\r\n }\r\n // </d>\r\n result = null;\r\n } else {\r\n result = oFn.call(this, e);\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n }\r\n\r\n html5_events = {\r\n\r\n // HTML5 event-name-to-handler map\r\n\r\n abort: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': abort');\r\n\r\n }),\r\n\r\n // enough has loaded to play\r\n\r\n canplay: html5_event(function() {\r\n\r\n var s = this._s,\r\n position1K;\r\n\r\n if (s._html5_canplay) {\r\n // this event has already fired. ignore.\r\n return;\r\n }\r\n\r\n s._html5_canplay = true;\r\n sm2._wD(s.id + ': canplay');\r\n s._onbufferchange(0);\r\n\r\n // position according to instance options\r\n position1K = (s._iO.position !== _undefined && !isNaN(s._iO.position) ? s._iO.position / msecScale : null);\r\n\r\n // set the position if position was provided before the sound loaded\r\n if (this.currentTime !== position1K) {\r\n sm2._wD(s.id + ': canplay: Setting position to ' + position1K);\r\n try {\r\n this.currentTime = position1K;\r\n } catch(ee) {\r\n sm2._wD(s.id + ': canplay: Setting position of ' + position1K + ' failed: ' + ee.message, 2);\r\n }\r\n }\r\n\r\n // hack for HTML5 from/to case\r\n if (s._iO._oncanplay) {\r\n s._iO._oncanplay();\r\n }\r\n\r\n }),\r\n\r\n canplaythrough: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n if (!s.loaded) {\r\n s._onbufferchange(0);\r\n s._whileloading(s.bytesLoaded, s.bytesTotal, s._get_html5_duration());\r\n s._onload(true);\r\n }\r\n\r\n }),\r\n\r\n durationchange: html5_event(function() {\r\n\r\n // durationchange may fire at various times, probably the safest way to capture accurate/final duration.\r\n\r\n var s = this._s,\r\n duration;\r\n\r\n duration = s._get_html5_duration();\r\n\r\n if (!isNaN(duration) && duration !== s.duration) {\r\n\r\n sm2._wD(this._s.id + ': durationchange (' + duration + ')' + (s.duration ? ', previously ' + s.duration : ''));\r\n\r\n s.durationEstimate = s.duration = duration;\r\n\r\n }\r\n\r\n }),\r\n\r\n // TODO: Reserved for potential use\r\n /*\r\n emptied: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': emptied');\r\n\r\n }),\r\n */\r\n\r\n ended: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': ended');\r\n\r\n s._onfinish();\r\n\r\n }),\r\n\r\n error: html5_event(function() {\r\n\r\n var description = (html5ErrorCodes[this.error.code] || null);\r\n sm2._wD(this._s.id + ': HTML5 error, code ' + this.error.code + (description ? ' (' + description + ')' : ''));\r\n this._s._onload(false);\r\n this._s._onerror(this.error.code, description);\r\n\r\n }),\r\n\r\n loadeddata: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n sm2._wD(s.id + ': loadeddata');\r\n\r\n // safari seems to nicely report progress events, eventually totalling 100%\r\n if (!s._loaded && !isSafari) {\r\n s.duration = s._get_html5_duration();\r\n }\r\n\r\n }),\r\n\r\n loadedmetadata: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadedmetadata');\r\n\r\n }),\r\n\r\n loadstart: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': loadstart');\r\n // assume buffering at first\r\n this._s._onbufferchange(1);\r\n\r\n }),\r\n\r\n play: html5_event(function() {\r\n\r\n // sm2._wD(this._s.id + ': play()');\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n playing: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': playing ' + String.fromCharCode(9835));\r\n // once play starts, no buffering\r\n this._s._onbufferchange(0);\r\n\r\n }),\r\n\r\n progress: html5_event(function(e) {\r\n\r\n // note: can fire repeatedly after \"loaded\" event, due to use of HTTP range/partials\r\n\r\n var s = this._s,\r\n i, j, progStr, buffered = 0,\r\n isProgress = (e.type === 'progress'),\r\n ranges = e.target.buffered,\r\n // firefox 3.6 implements e.loaded/total (bytes)\r\n loaded = (e.loaded || 0),\r\n total = (e.total || 1);\r\n\r\n // reset the \"buffered\" (loaded byte ranges) array\r\n s.buffered = [];\r\n\r\n if (ranges && ranges.length) {\r\n\r\n // if loaded is 0, try TimeRanges implementation as % of load\r\n // https://developer.mozilla.org/en/DOM/TimeRanges\r\n\r\n // re-build \"buffered\" array\r\n // HTML5 returns seconds. SM2 API uses msec for setPosition() etc., whether Flash or HTML5.\r\n for (i = 0, j = ranges.length; i < j; i++) {\r\n s.buffered.push({\r\n start: ranges.start(i) * msecScale,\r\n end: ranges.end(i) * msecScale\r\n });\r\n }\r\n\r\n // use the last value locally\r\n buffered = (ranges.end(0) - ranges.start(0)) * msecScale;\r\n\r\n // linear case, buffer sum; does not account for seeking and HTTP partials / byte ranges\r\n loaded = Math.min(1, buffered / (e.target.duration * msecScale));\r\n\r\n // <d>\r\n if (isProgress && ranges.length > 1) {\r\n progStr = [];\r\n j = ranges.length;\r\n for (i = 0; i < j; i++) {\r\n progStr.push((e.target.buffered.start(i) * msecScale) + '-' + (e.target.buffered.end(i) * msecScale));\r\n }\r\n sm2._wD(this._s.id + ': progress, timeRanges: ' + progStr.join(', '));\r\n }\r\n\r\n if (isProgress && !isNaN(loaded)) {\r\n sm2._wD(this._s.id + ': progress, ' + Math.floor(loaded * 100) + '% loaded');\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (!isNaN(loaded)) {\r\n\r\n // TODO: prevent calls with duplicate values.\r\n s._whileloading(loaded, total, s._get_html5_duration());\r\n if (loaded && total && loaded === total) {\r\n // in case \"onload\" doesn't fire (eg. gecko 1.9.2)\r\n html5_events.canplaythrough.call(this, e);\r\n }\r\n\r\n }\r\n\r\n }),\r\n\r\n ratechange: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': ratechange');\r\n\r\n }),\r\n\r\n suspend: html5_event(function(e) {\r\n\r\n // download paused/stopped, may have finished (eg. onload)\r\n var s = this._s;\r\n\r\n sm2._wD(this._s.id + ': suspend');\r\n html5_events.progress.call(this, e);\r\n s._onsuspend();\r\n\r\n }),\r\n\r\n stalled: html5_event(function() {\r\n\r\n sm2._wD(this._s.id + ': stalled');\r\n\r\n }),\r\n\r\n timeupdate: html5_event(function() {\r\n\r\n this._s._onTimer();\r\n\r\n }),\r\n\r\n waiting: html5_event(function() {\r\n\r\n var s = this._s;\r\n\r\n // see also: seeking\r\n sm2._wD(this._s.id + ': waiting');\r\n\r\n // playback faster than download rate, etc.\r\n s._onbufferchange(1);\r\n\r\n })\r\n\r\n };\r\n\r\n html5OK = function(iO) {\r\n\r\n // playability test based on URL or MIME type\r\n\r\n var result;\r\n\r\n if (!iO || (!iO.type && !iO.url && !iO.serverURL)) {\r\n\r\n // nothing to check\r\n result = false;\r\n\r\n } else if (iO.serverURL || (iO.type && preferFlashCheck(iO.type))) {\r\n\r\n // RTMP, or preferring flash\r\n result = false;\r\n\r\n } else {\r\n\r\n // Use type, if specified. Pass data: URIs to HTML5. If HTML5-only mode, no other options, so just give 'er\r\n result = ((iO.type ? html5CanPlay({ type: iO.type }) : html5CanPlay({ url: iO.url }) || sm2.html5Only || iO.url.match(/data:/i)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n html5Unload = function(oAudio) {\r\n\r\n /**\r\n * Internal method: Unload media, and cancel any current/pending network requests.\r\n * Firefox can load an empty URL, which allegedly destroys the decoder and stops the download.\r\n * https://developer.mozilla.org/En/Using_audio_and_video_in_Firefox#Stopping_the_download_of_media\r\n * However, Firefox has been seen loading a relative URL from '' and thus requesting the hosting page on unload.\r\n * Other UA behaviour is unclear, so everyone else gets an about:blank-style URL.\r\n */\r\n\r\n var url;\r\n\r\n if (oAudio) {\r\n\r\n // Firefox and Chrome accept short WAVe data: URIs. Chome dislikes audio/wav, but accepts audio/wav for data: MIME.\r\n // Desktop Safari complains / fails on data: URI, so it gets about:blank.\r\n url = (isSafari ? emptyURL : (sm2.html5.canPlayType('audio/wav') ? emptyWAV : emptyURL));\r\n\r\n oAudio.src = url;\r\n\r\n // reset some state, too\r\n if (oAudio._called_unload !== _undefined) {\r\n oAudio._called_load = false;\r\n }\r\n\r\n }\r\n\r\n if (useGlobalHTML5Audio) {\r\n\r\n // ensure URL state is trashed, also\r\n lastGlobalHTML5URL = null;\r\n\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n html5CanPlay = function(o) {\r\n\r\n /**\r\n * Try to find MIME, test and return truthiness\r\n * o = {\r\n * url: '/path/to/an.mp3',\r\n * type: 'audio/mp3'\r\n * }\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) return false;\r\n\r\n var url = (o.url || null),\r\n mime = (o.type || null),\r\n aF = sm2.audioFormats,\r\n result,\r\n offset,\r\n fileExt,\r\n item;\r\n\r\n // account for known cases like audio/mp3\r\n\r\n if (mime && sm2.html5[mime] !== _undefined) return (sm2.html5[mime] && !preferFlashCheck(mime));\r\n\r\n if (!html5Ext) {\r\n\r\n html5Ext = [];\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n html5Ext.push(item);\r\n\r\n if (aF[item].related) {\r\n html5Ext = html5Ext.concat(aF[item].related);\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n html5Ext = new RegExp('\\\\.(' + html5Ext.join('|') + ')(\\\\?.*)?$', 'i');\r\n\r\n }\r\n\r\n // TODO: Strip URL queries, etc.\r\n fileExt = (url ? url.toLowerCase().match(html5Ext) : null);\r\n\r\n if (!fileExt || !fileExt.length) {\r\n\r\n if (!mime) {\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n // audio/mp3 -> mp3, result should be known\r\n offset = mime.indexOf(';');\r\n\r\n // strip \"audio/X; codecs...\"\r\n fileExt = (offset !== -1 ? mime.substr(0, offset) : mime).substr(6);\r\n\r\n }\r\n\r\n } else {\r\n\r\n // match the raw extension name - \"mp3\", for example\r\n fileExt = fileExt[1];\r\n\r\n }\r\n\r\n if (fileExt && sm2.html5[fileExt] !== _undefined) {\r\n\r\n // result known\r\n result = (sm2.html5[fileExt] && !preferFlashCheck(fileExt));\r\n\r\n } else {\r\n\r\n mime = 'audio/' + fileExt;\r\n result = sm2.html5.canPlayType({ type: mime });\r\n\r\n sm2.html5[fileExt] = result;\r\n\r\n // sm2._wD('canPlayType, found result: ' + result);\r\n result = (result && sm2.html5[mime] && !preferFlashCheck(mime));\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n testHTML5 = function() {\r\n\r\n /**\r\n * Internal: Iterates over audioFormats, determining support eg. audio/mp3, audio/mpeg and so on\r\n * assigns results to html5[] and flash[].\r\n */\r\n\r\n if (!sm2.useHTML5Audio || !sm2.hasHTML5) {\r\n\r\n // without HTML5, we need Flash.\r\n sm2.html5.usingFlash = true;\r\n needsFlash = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // double-whammy: Opera 9.64 throws WRONG_ARGUMENTS_ERR if no parameter passed to Audio(), and Webkit + iOS happily tries to load \"null\" as a URL. :/\r\n var a = (Audio !== _undefined ? (isOpera && opera.version() < 10 ? new Audio(null) : new Audio()) : null),\r\n item, lookup, support = {}, aF, i;\r\n\r\n function cp(m) {\r\n\r\n var canPlay, j,\r\n result = false,\r\n isOK = false;\r\n\r\n if (!a || typeof a.canPlayType !== 'function') return result;\r\n\r\n if (m instanceof Array) {\r\n\r\n // iterate through all mime types, return any successes\r\n\r\n for (i = 0, j = m.length; i < j; i++) {\r\n\r\n if (sm2.html5[m[i]] || a.canPlayType(m[i]).match(sm2.html5Test)) {\r\n\r\n isOK = true;\r\n sm2.html5[m[i]] = true;\r\n\r\n // note flash support, too\r\n sm2.flash[m[i]] = !!(m[i].match(flashMIME));\r\n\r\n }\r\n\r\n }\r\n\r\n result = isOK;\r\n\r\n } else {\r\n\r\n canPlay = (a && typeof a.canPlayType === 'function' ? a.canPlayType(m) : false);\r\n result = !!(canPlay && (canPlay.match(sm2.html5Test)));\r\n\r\n }\r\n\r\n return result;\r\n\r\n }\r\n\r\n // test all registered formats + codecs\r\n\r\n aF = sm2.audioFormats;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n lookup = 'audio/' + item;\r\n\r\n support[item] = cp(aF[item].type);\r\n\r\n // write back generic type too, eg. audio/mp3\r\n support[lookup] = support[item];\r\n\r\n // assign flash\r\n if (item.match(flashMIME)) {\r\n\r\n sm2.flash[item] = true;\r\n sm2.flash[lookup] = true;\r\n\r\n } else {\r\n\r\n sm2.flash[item] = false;\r\n sm2.flash[lookup] = false;\r\n\r\n }\r\n\r\n // assign result to related formats, too\r\n\r\n if (aF[item] && aF[item].related) {\r\n\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n\r\n // eg. audio/m4a\r\n support['audio/' + aF[item].related[i]] = support[item];\r\n sm2.html5[aF[item].related[i]] = support[item];\r\n sm2.flash[aF[item].related[i]] = support[item];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n support.canPlayType = (a ? cp : null);\r\n sm2.html5 = mixin(sm2.html5, support);\r\n\r\n sm2.html5.usingFlash = featureCheck();\r\n needsFlash = sm2.html5.usingFlash;\r\n\r\n return true;\r\n\r\n };\r\n\r\n strings = {\r\n\r\n // <d>\r\n notReady: 'Unavailable - wait until onready() has fired.',\r\n notOK: 'Audio support is not available.',\r\n domError: sm + 'exception caught while appending SWF to DOM.',\r\n spcWmode: 'Removing wmode, preventing known SWF loading issue(s)',\r\n swf404: smc + 'Verify that %s is a valid path.',\r\n tryDebug: 'Try ' + sm + '.debugFlash = true for more security details (output goes to SWF.)',\r\n checkSWF: 'See SWF output for more debug info.',\r\n localFail: smc + 'Non-HTTP page (' + doc.location.protocol + ' URL?) Review Flash player security settings for this special case:\\nhttp://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html\\nMay need to add/allow path, eg. c:/sm2/ or /users/me/sm2/',\r\n waitFocus: smc + 'Special case: Waiting for SWF to load with window focus...',\r\n waitForever: smc + 'Waiting indefinitely for Flash (will recover if unblocked)...',\r\n waitSWF: smc + 'Waiting for 100% SWF load...',\r\n needFunction: smc + 'Function object expected for %s',\r\n badID: 'Sound ID \"%s\" should be a string, starting with a non-numeric character',\r\n currentObj: smc + '_debug(): Current sound objects',\r\n waitOnload: smc + 'Waiting for window.onload()',\r\n docLoaded: smc + 'Document already loaded',\r\n onload: smc + 'initComplete(): calling soundManager.onload()',\r\n onloadOK: sm + '.onload() complete',\r\n didInit: smc + 'init(): Already called?',\r\n secNote: 'Flash security note: Network/internet URLs will not load due to security restrictions. Access can be configured via Flash Player Global Security Settings Page: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html',\r\n badRemove: smc + 'Failed to remove Flash node.',\r\n shutdown: sm + '.disable(): Shutting down',\r\n queue: smc + 'Queueing %s handler',\r\n smError: 'SMSound.load(): Exception: JS-Flash communication failed, or JS error.',\r\n fbTimeout: 'No flash response, applying .' + swfCSS.swfTimedout + ' CSS...',\r\n fbLoaded: 'Flash loaded',\r\n fbHandler: smc + 'flashBlockHandler()',\r\n manURL: 'SMSound.load(): Using manually-assigned URL',\r\n onURL: sm + '.load(): current URL already assigned.',\r\n badFV: sm + '.flashVersion must be 8 or 9. \"%s\" is invalid. Reverting to %s.',\r\n as2loop: 'Note: Setting stream:false so looping can work (flash 8 limitation)',\r\n noNSLoop: 'Note: Looping not implemented for MovieStar formats',\r\n needfl9: 'Note: Switching to flash 9, required for MP4 formats.',\r\n mfTimeout: 'Setting flashLoadTimeout = 0 (infinite) for off-screen, mobile flash case',\r\n needFlash: smc + 'Fatal error: Flash is needed to play some required formats, but is not available.',\r\n gotFocus: smc + 'Got window focus.',\r\n policy: 'Enabling usePolicyFile for data access',\r\n setup: sm + '.setup(): allowed parameters: %s',\r\n setupError: sm + '.setup(): \"%s\" cannot be assigned with this method.',\r\n setupUndef: sm + '.setup(): Could not find option \"%s\"',\r\n setupLate: sm + '.setup(): url, flashVersion and html5Test property changes will not take effect until reboot().',\r\n noURL: smc + 'Flash URL required. Call soundManager.setup({url:...}) to get started.',\r\n sm2Loaded: 'SoundManager 2: Ready. ' + String.fromCharCode(10003),\r\n reset: sm + '.reset(): Removing event callbacks',\r\n mobileUA: 'Mobile UA detected, preferring HTML5 by default.',\r\n globalHTML5: 'Using singleton HTML5 Audio() pattern for this device.',\r\n ignoreMobile: 'Ignoring mobile restrictions for this device.'\r\n // </d>\r\n\r\n };\r\n\r\n str = function() {\r\n\r\n // internal string replace helper.\r\n // arguments: o [,items to replace]\r\n // <d>\r\n\r\n var args,\r\n i, j, o,\r\n sstr;\r\n\r\n // real array, please\r\n args = slice.call(arguments);\r\n\r\n // first argument\r\n o = args.shift();\r\n\r\n sstr = (strings && strings[o] ? strings[o] : '');\r\n\r\n if (sstr && args && args.length) {\r\n for (i = 0, j = args.length; i < j; i++) {\r\n sstr = sstr.replace('%s', args[i]);\r\n }\r\n }\r\n\r\n return sstr;\r\n // </d>\r\n\r\n };\r\n\r\n loopFix = function(sOpt) {\r\n\r\n // flash 8 requires stream = false for looping to work\r\n if (fV === 8 && sOpt.loops > 1 && sOpt.stream) {\r\n _wDS('as2loop');\r\n sOpt.stream = false;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n policyFix = function(sOpt, sPre) {\r\n\r\n if (sOpt && !sOpt.usePolicyFile && (sOpt.onid3 || sOpt.usePeakData || sOpt.useWaveformData || sOpt.useEQData)) {\r\n sm2._wD((sPre || '') + str('policy'));\r\n sOpt.usePolicyFile = true;\r\n }\r\n\r\n return sOpt;\r\n\r\n };\r\n\r\n complain = function(sMsg) {\r\n\r\n // <d>\r\n if (hasConsole && console.warn !== _undefined) {\r\n console.warn(sMsg);\r\n } else {\r\n sm2._wD(sMsg);\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n doNothing = function() {\r\n\r\n return false;\r\n\r\n };\r\n\r\n disableObject = function(o) {\r\n\r\n var oProp;\r\n\r\n for (oProp in o) {\r\n if (o.hasOwnProperty(oProp) && typeof o[oProp] === 'function') {\r\n o[oProp] = doNothing;\r\n }\r\n }\r\n\r\n oProp = null;\r\n\r\n };\r\n\r\n failSafely = function(bNoDisable) {\r\n\r\n // general failure exception handler\r\n\r\n if (bNoDisable === _undefined) {\r\n bNoDisable = false;\r\n }\r\n\r\n if (disabled || bNoDisable) {\r\n sm2.disable(bNoDisable);\r\n }\r\n\r\n };\r\n\r\n normalizeMovieURL = function(movieURL) {\r\n\r\n var urlParams = null, url;\r\n\r\n if (movieURL) {\r\n\r\n if (movieURL.match(/\\.swf(\\?.*)?$/i)) {\r\n\r\n urlParams = movieURL.substr(movieURL.toLowerCase().lastIndexOf('.swf?') + 4);\r\n\r\n // assume user knows what they're doing\r\n if (urlParams) return movieURL;\r\n\r\n } else if (movieURL.lastIndexOf('/') !== movieURL.length - 1) {\r\n\r\n // append trailing slash, if needed\r\n movieURL += '/';\r\n\r\n }\r\n\r\n }\r\n\r\n url = (movieURL && movieURL.lastIndexOf('/') !== -1 ? movieURL.substr(0, movieURL.lastIndexOf('/') + 1) : './') + sm2.movieURL;\r\n\r\n if (sm2.noSWFCache) {\r\n url += ('?ts=' + new Date().getTime());\r\n }\r\n\r\n return url;\r\n\r\n };\r\n\r\n setVersionInfo = function() {\r\n\r\n // short-hand for internal use\r\n\r\n fV = parseInt(sm2.flashVersion, 10);\r\n\r\n if (fV !== 8 && fV !== 9) {\r\n sm2._wD(str('badFV', fV, defaultFlashVersion));\r\n sm2.flashVersion = fV = defaultFlashVersion;\r\n }\r\n\r\n // debug flash movie, if applicable\r\n\r\n var isDebug = (sm2.debugMode || sm2.debugFlash ? '_debug.swf' : '.swf');\r\n\r\n if (sm2.useHTML5Audio && !sm2.html5Only && sm2.audioFormats.mp4.required && fV < 9) {\r\n sm2._wD(str('needfl9'));\r\n sm2.flashVersion = fV = 9;\r\n }\r\n\r\n sm2.version = sm2.versionNumber + (sm2.html5Only ? ' (HTML5-only mode)' : (fV === 9 ? ' (AS3/Flash 9)' : ' (AS2/Flash 8)'));\r\n\r\n // set up default options\r\n if (fV > 8) {\r\n\r\n // +flash 9 base options\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.flash9Options);\r\n sm2.features.buffering = true;\r\n\r\n // +moviestar support\r\n sm2.defaultOptions = mixin(sm2.defaultOptions, sm2.movieStarOptions);\r\n sm2.filePatterns.flash9 = new RegExp('\\\\.(mp3|' + netStreamTypes.join('|') + ')(\\\\?.*)?$', 'i');\r\n sm2.features.movieStar = true;\r\n\r\n } else {\r\n\r\n sm2.features.movieStar = false;\r\n\r\n }\r\n\r\n // regExp for flash canPlay(), etc.\r\n sm2.filePattern = sm2.filePatterns[(fV !== 8 ? 'flash9' : 'flash8')];\r\n\r\n // if applicable, use _debug versions of SWFs\r\n sm2.movieURL = (fV === 8 ? 'soundmanager2.swf' : 'soundmanager2_flash9.swf').replace('.swf', isDebug);\r\n\r\n sm2.features.peakData = sm2.features.waveformData = sm2.features.eqData = (fV > 8);\r\n\r\n };\r\n\r\n setPolling = function(bPolling, bHighPerformance) {\r\n\r\n if (!flash) {\r\n return;\r\n }\r\n\r\n flash._setPolling(bPolling, bHighPerformance);\r\n\r\n };\r\n\r\n initDebug = function() {\r\n\r\n // starts debug mode, creating output <div> for UAs without console object\r\n\r\n // allow force of debug mode via URL\r\n // <d>\r\n if (sm2.debugURLParam.test(wl)) {\r\n sm2.setupOptions.debugMode = sm2.debugMode = true;\r\n }\r\n\r\n if (id(sm2.debugID)) {\r\n return;\r\n }\r\n\r\n var oD, oDebug, oTarget, oToggle, tmp;\r\n\r\n if (sm2.debugMode && !id(sm2.debugID) && (!hasConsole || !sm2.useConsole || !sm2.consoleOnly)) {\r\n\r\n oD = doc.createElement('div');\r\n oD.id = sm2.debugID + '-toggle';\r\n\r\n oToggle = {\r\n position: 'fixed',\r\n bottom: '0px',\r\n right: '0px',\r\n width: '1.2em',\r\n height: '1.2em',\r\n lineHeight: '1.2em',\r\n margin: '2px',\r\n textAlign: 'center',\r\n border: '1px solid #999',\r\n cursor: 'pointer',\r\n background: '#fff',\r\n color: '#333',\r\n zIndex: 10001\r\n };\r\n\r\n oD.appendChild(doc.createTextNode('-'));\r\n oD.onclick = toggleDebug;\r\n oD.title = 'Toggle SM2 debug console';\r\n\r\n if (ua.match(/msie 6/i)) {\r\n oD.style.position = 'absolute';\r\n oD.style.cursor = 'hand';\r\n }\r\n\r\n for (tmp in oToggle) {\r\n if (oToggle.hasOwnProperty(tmp)) {\r\n oD.style[tmp] = oToggle[tmp];\r\n }\r\n }\r\n\r\n oDebug = doc.createElement('div');\r\n oDebug.id = sm2.debugID;\r\n oDebug.style.display = (sm2.debugMode ? 'block' : 'none');\r\n\r\n if (sm2.debugMode && !id(oD.id)) {\r\n try {\r\n oTarget = getDocument();\r\n oTarget.appendChild(oD);\r\n } catch(e2) {\r\n throw new Error(str('domError') + ' \\n' + e2.toString());\r\n }\r\n oTarget.appendChild(oDebug);\r\n }\r\n\r\n }\r\n\r\n oTarget = null;\r\n // </d>\r\n\r\n };\r\n\r\n idCheck = this.getSoundById;\r\n\r\n // <d>\r\n _wDS = function(o, errorLevel) {\r\n\r\n return (!o ? '' : sm2._wD(str(o), errorLevel));\r\n\r\n };\r\n\r\n toggleDebug = function() {\r\n\r\n var o = id(sm2.debugID),\r\n oT = id(sm2.debugID + '-toggle');\r\n\r\n if (!o) {\r\n return;\r\n }\r\n\r\n if (debugOpen) {\r\n // minimize\r\n oT.innerHTML = '+';\r\n o.style.display = 'none';\r\n } else {\r\n oT.innerHTML = '-';\r\n o.style.display = 'block';\r\n }\r\n\r\n debugOpen = !debugOpen;\r\n\r\n };\r\n\r\n debugTS = function(sEventType, bSuccess, sMessage) {\r\n\r\n // troubleshooter debug hooks\r\n\r\n if (window.sm2Debugger !== _undefined) {\r\n try {\r\n sm2Debugger.handleEvent(sEventType, bSuccess, sMessage);\r\n } catch(e) {\r\n // oh well\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n\r\n };\r\n // </d>\r\n\r\n getSWFCSS = function() {\r\n\r\n var css = [];\r\n\r\n if (sm2.debugMode) {\r\n css.push(swfCSS.sm2Debug);\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n css.push(swfCSS.flashDebug);\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n css.push(swfCSS.highPerf);\r\n }\r\n\r\n return css.join(' ');\r\n\r\n };\r\n\r\n flashBlockHandler = function() {\r\n\r\n // *possible* flash block situation.\r\n\r\n var name = str('fbHandler'),\r\n p = sm2.getMoviePercent(),\r\n css = swfCSS,\r\n error = {\r\n type: 'FLASHBLOCK'\r\n };\r\n\r\n if (sm2.html5Only) {\r\n // no flash, or unused\r\n return;\r\n }\r\n\r\n if (!sm2.ok()) {\r\n\r\n if (needsFlash) {\r\n // make the movie more visible, so user can fix\r\n sm2.oMC.className = getSWFCSS() + ' ' + css.swfDefault + ' ' + (p === null ? css.swfTimedout : css.swfError);\r\n sm2._wD(name + ': ' + str('fbTimeout') + (p ? ' (' + str('fbLoaded') + ')' : ''));\r\n }\r\n\r\n sm2.didFlashBlock = true;\r\n\r\n // fire onready(), complain lightly\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: error\r\n });\r\n\r\n catchError(error);\r\n\r\n } else {\r\n\r\n // SM2 loaded OK (or recovered)\r\n\r\n // <d>\r\n if (sm2.didFlashBlock) {\r\n sm2._wD(name + ': Unblocked');\r\n }\r\n // </d>\r\n\r\n if (sm2.oMC) {\r\n sm2.oMC.className = [getSWFCSS(), css.swfDefault, css.swfLoaded + (sm2.didFlashBlock ? ' ' + css.swfUnblocked : '')].join(' ');\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n addOnEvent = function(sType, oMethod, oScope) {\r\n\r\n if (on_queue[sType] === _undefined) {\r\n on_queue[sType] = [];\r\n }\r\n\r\n on_queue[sType].push({\r\n method: oMethod,\r\n scope: (oScope || null),\r\n fired: false\r\n });\r\n\r\n };\r\n\r\n processOnEvents = function(oOptions) {\r\n\r\n // if unspecified, assume OK/error\r\n\r\n if (!oOptions) {\r\n oOptions = {\r\n type: (sm2.ok() ? 'onready' : 'ontimeout')\r\n };\r\n }\r\n\r\n // not ready yet.\r\n if (!didInit && oOptions && !oOptions.ignoreInit) return false;\r\n\r\n // invalid case\r\n if (oOptions.type === 'ontimeout' && (sm2.ok() || (disabled && !oOptions.ignoreInit))) return false;\r\n\r\n var status = {\r\n success: (oOptions && oOptions.ignoreInit ? sm2.ok() : !disabled)\r\n },\r\n\r\n // queue specified by type, or none\r\n srcQueue = (oOptions && oOptions.type ? on_queue[oOptions.type] || [] : []),\r\n\r\n queue = [], i, j,\r\n args = [status],\r\n canRetry = (needsFlash && !sm2.ok());\r\n\r\n if (oOptions.error) {\r\n args[0].error = oOptions.error;\r\n }\r\n\r\n for (i = 0, j = srcQueue.length; i < j; i++) {\r\n if (srcQueue[i].fired !== true) {\r\n queue.push(srcQueue[i]);\r\n }\r\n }\r\n\r\n if (queue.length) {\r\n\r\n // sm2._wD(sm + ': Firing ' + queue.length + ' ' + oOptions.type + '() item' + (queue.length === 1 ? '' : 's'));\r\n for (i = 0, j = queue.length; i < j; i++) {\r\n\r\n if (queue[i].scope) {\r\n queue[i].method.apply(queue[i].scope, args);\r\n } else {\r\n queue[i].method.apply(this, args);\r\n }\r\n\r\n if (!canRetry) {\r\n // useFlashBlock and SWF timeout case doesn't count here.\r\n queue[i].fired = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n initUserOnload = function() {\r\n\r\n window.setTimeout(function() {\r\n\r\n if (sm2.useFlashBlock) {\r\n flashBlockHandler();\r\n }\r\n\r\n processOnEvents();\r\n\r\n // call user-defined \"onload\", scoped to window\r\n\r\n if (typeof sm2.onload === 'function') {\r\n _wDS('onload', 1);\r\n sm2.onload.apply(window);\r\n _wDS('onloadOK', 1);\r\n }\r\n\r\n if (sm2.waitForWindowLoad) {\r\n event.add(window, 'load', initUserOnload);\r\n }\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n detectFlash = function() {\r\n\r\n /**\r\n * Hat tip: Flash Detect library (BSD, (C) 2007) by Carl \"DocYes\" S. Yestrau\r\n * http://featureblend.com/javascript-flash-detection-library.html / http://featureblend.com/license.txt\r\n */\r\n\r\n // this work has already been done.\r\n if (hasFlash !== _undefined) return hasFlash;\r\n\r\n var hasPlugin = false, n = navigator, obj, type, types, AX = window.ActiveXObject;\r\n\r\n // MS Edge 14 throws an \"Unspecified Error\" because n.plugins is inaccessible due to permissions\r\n var nP;\r\n\r\n try {\r\n nP = n.plugins;\r\n } catch(e) {\r\n nP = undefined;\r\n }\r\n\r\n if (nP && nP.length) {\r\n\r\n type = 'application/x-shockwave-flash';\r\n types = n.mimeTypes;\r\n\r\n if (types && types[type] && types[type].enabledPlugin && types[type].enabledPlugin.description) {\r\n hasPlugin = true;\r\n }\r\n\r\n } else if (AX !== _undefined && !ua.match(/MSAppHost/i)) {\r\n\r\n // Windows 8 Store Apps (MSAppHost) are weird (compatibility?) and won't complain here, but will barf if Flash/ActiveX object is appended to the DOM.\r\n try {\r\n obj = new AX('ShockwaveFlash.ShockwaveFlash');\r\n } catch(e) {\r\n // oh well\r\n obj = null;\r\n }\r\n\r\n hasPlugin = (!!obj);\r\n\r\n // cleanup, because it is ActiveX after all\r\n obj = null;\r\n\r\n }\r\n\r\n hasFlash = hasPlugin;\r\n\r\n return hasPlugin;\r\n\r\n };\r\n\r\n featureCheck = function() {\r\n\r\n var flashNeeded,\r\n item,\r\n formats = sm2.audioFormats,\r\n // iPhone <= 3.1 has broken HTML5 audio(), but firmware 3.2 (original iPad) + iOS4 works.\r\n isSpecial = (is_iDevice && !!(ua.match(/os (1|2|3_0|3_1)\\s/i)));\r\n\r\n if (isSpecial) {\r\n\r\n // has Audio(), but is broken; let it load links directly.\r\n sm2.hasHTML5 = false;\r\n\r\n // ignore flash case, however\r\n sm2.html5Only = true;\r\n\r\n // hide the SWF, if present\r\n if (sm2.oMC) {\r\n sm2.oMC.style.display = 'none';\r\n }\r\n\r\n } else if (sm2.useHTML5Audio) {\r\n\r\n if (!sm2.html5 || !sm2.html5.canPlayType) {\r\n sm2._wD('SoundManager: No HTML5 Audio() support detected.');\r\n sm2.hasHTML5 = false;\r\n }\r\n\r\n // <d>\r\n if (isBadSafari) {\r\n sm2._wD(smc + 'Note: Buggy HTML5 Audio in Safari on this OS X release, see https://bugs.webkit.org/show_bug.cgi?id=32159 - ' + (!hasFlash ? ' would use flash fallback for MP3/MP4, but none detected.' : 'will use flash fallback for MP3/MP4, if available'), 1);\r\n }\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n\r\n // sort out whether flash is optional, required or can be ignored.\r\n\r\n // innocent until proven guilty.\r\n canIgnoreFlash = true;\r\n\r\n for (item in formats) {\r\n\r\n if (formats.hasOwnProperty(item)) {\r\n\r\n if (formats[item].required) {\r\n\r\n if (!sm2.html5.canPlayType(formats[item].type)) {\r\n\r\n // 100% HTML5 mode is not possible.\r\n canIgnoreFlash = false;\r\n flashNeeded = true;\r\n\r\n } else if (sm2.preferFlash && (sm2.flash[item] || sm2.flash[formats[item].type])) {\r\n\r\n // flash may be required, or preferred for this format.\r\n flashNeeded = true;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n // sanity check...\r\n if (sm2.ignoreFlash) {\r\n flashNeeded = false;\r\n canIgnoreFlash = true;\r\n }\r\n\r\n sm2.html5Only = (sm2.hasHTML5 && sm2.useHTML5Audio && !flashNeeded);\r\n\r\n return (!sm2.html5Only);\r\n\r\n };\r\n\r\n parseURL = function(url) {\r\n\r\n /**\r\n * Internal: Finds and returns the first playable URL (or failing that, the first URL.)\r\n * @param {string or array} url A single URL string, OR, an array of URL strings or {url:'/path/to/resource', type:'audio/mp3'} objects.\r\n */\r\n\r\n var i, j, urlResult = 0, result;\r\n\r\n if (url instanceof Array) {\r\n\r\n // find the first good one\r\n for (i = 0, j = url.length; i < j; i++) {\r\n\r\n if (url[i] instanceof Object) {\r\n\r\n // MIME check\r\n if (sm2.canPlayMIME(url[i].type)) {\r\n urlResult = i;\r\n break;\r\n }\r\n\r\n } else if (sm2.canPlayURL(url[i])) {\r\n\r\n // URL string check\r\n urlResult = i;\r\n break;\r\n\r\n }\r\n\r\n }\r\n\r\n // normalize to string\r\n if (url[urlResult].url) {\r\n url[urlResult] = url[urlResult].url;\r\n }\r\n\r\n result = url[urlResult];\r\n\r\n } else {\r\n\r\n // single URL case\r\n result = url;\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n\r\n startTimer = function(oSound) {\r\n\r\n /**\r\n * attach a timer to this sound, and start an interval if needed\r\n */\r\n\r\n if (!oSound._hasTimer) {\r\n\r\n oSound._hasTimer = true;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n if (h5IntervalTimer === null && h5TimerCount === 0) {\r\n\r\n h5IntervalTimer = setInterval(timerExecute, sm2.html5PollingInterval);\r\n\r\n }\r\n\r\n h5TimerCount++;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n stopTimer = function(oSound) {\r\n\r\n /**\r\n * detach a timer\r\n */\r\n\r\n if (oSound._hasTimer) {\r\n\r\n oSound._hasTimer = false;\r\n\r\n if (!mobileHTML5 && sm2.html5PollingInterval) {\r\n\r\n // interval will stop itself at next execution.\r\n\r\n h5TimerCount--;\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n timerExecute = function() {\r\n\r\n /**\r\n * manual polling for HTML5 progress events, ie., whileplaying()\r\n * (can achieve greater precision than conservative default HTML5 interval)\r\n */\r\n\r\n var i;\r\n\r\n if (h5IntervalTimer !== null && !h5TimerCount) {\r\n\r\n // no active timers, stop polling interval.\r\n\r\n clearInterval(h5IntervalTimer);\r\n\r\n h5IntervalTimer = null;\r\n\r\n return;\r\n\r\n }\r\n\r\n // check all HTML5 sounds with timers\r\n\r\n for (i = sm2.soundIDs.length - 1; i >= 0; i--) {\r\n\r\n if (sm2.sounds[sm2.soundIDs[i]].isHTML5 && sm2.sounds[sm2.soundIDs[i]]._hasTimer) {\r\n sm2.sounds[sm2.soundIDs[i]]._onTimer();\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n catchError = function(options) {\r\n\r\n options = (options !== _undefined ? options : {});\r\n\r\n if (typeof sm2.onerror === 'function') {\r\n sm2.onerror.apply(window, [{\r\n type: (options.type !== _undefined ? options.type : null)\r\n }]);\r\n }\r\n\r\n if (options.fatal !== _undefined && options.fatal) {\r\n sm2.disable();\r\n }\r\n\r\n };\r\n\r\n badSafariFix = function() {\r\n\r\n // special case: \"bad\" Safari (OS X 10.3 - 10.7) must fall back to flash for MP3/MP4\r\n if (!isBadSafari || !detectFlash()) {\r\n // doesn't apply\r\n return;\r\n }\r\n\r\n var aF = sm2.audioFormats, i, item;\r\n\r\n for (item in aF) {\r\n\r\n if (aF.hasOwnProperty(item)) {\r\n\r\n if (item === 'mp3' || item === 'mp4') {\r\n\r\n sm2._wD(sm + ': Using flash fallback for ' + item + ' format');\r\n sm2.html5[item] = false;\r\n\r\n // assign result to related formats, too\r\n if (aF[item] && aF[item].related) {\r\n for (i = aF[item].related.length - 1; i >= 0; i--) {\r\n sm2.html5[aF[item].related[i]] = false;\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Pseudo-private flash/ExternalInterface methods\r\n * ----------------------------------------------\r\n */\r\n\r\n this._setSandboxType = function(sandboxType) {\r\n\r\n // <d>\r\n // Security sandbox according to Flash plugin\r\n var sb = sm2.sandbox;\r\n\r\n sb.type = sandboxType;\r\n sb.description = sb.types[(sb.types[sandboxType] !== _undefined ? sandboxType : 'unknown')];\r\n\r\n if (sb.type === 'localWithFile') {\r\n\r\n sb.noRemote = true;\r\n sb.noLocal = false;\r\n _wDS('secNote', 2);\r\n\r\n } else if (sb.type === 'localWithNetwork') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = true;\r\n\r\n } else if (sb.type === 'localTrusted') {\r\n\r\n sb.noRemote = false;\r\n sb.noLocal = false;\r\n\r\n }\r\n // </d>\r\n\r\n };\r\n\r\n this._externalInterfaceOK = function(swfVersion) {\r\n\r\n // flash callback confirming flash loaded, EI working etc.\r\n // swfVersion: SWF build string\r\n\r\n if (sm2.swfLoaded) {\r\n return;\r\n }\r\n\r\n var e;\r\n\r\n debugTS('swf', true);\r\n debugTS('flashtojs', true);\r\n sm2.swfLoaded = true;\r\n tryInitOnFocus = false;\r\n\r\n if (isBadSafari) {\r\n badSafariFix();\r\n }\r\n\r\n // complain if JS + SWF build/version strings don't match, excluding +DEV builds\r\n // <d>\r\n if (!swfVersion || swfVersion.replace(/\\+dev/i, '') !== sm2.versionNumber.replace(/\\+dev/i, '')) {\r\n\r\n e = sm + ': Fatal: JavaScript file build \"' + sm2.versionNumber + '\" does not match Flash SWF build \"' + swfVersion + '\" at ' + sm2.url + '. Ensure both are up-to-date.';\r\n\r\n // escape flash -> JS stack so this error fires in window.\r\n setTimeout(function() {\r\n throw new Error(e);\r\n }, 0);\r\n\r\n // exit, init will fail with timeout\r\n return;\r\n\r\n }\r\n // </d>\r\n\r\n // IE needs a larger timeout\r\n setTimeout(init, isIE ? 100 : 1);\r\n\r\n };\r\n\r\n /**\r\n * Private initialization helpers\r\n * ------------------------------\r\n */\r\n\r\n createMovie = function(movieID, movieURL) {\r\n\r\n // ignore if already connected\r\n if (didAppend && appendSuccess) return false;\r\n\r\n function initMsg() {\r\n\r\n // <d>\r\n\r\n var options = [],\r\n title,\r\n msg = [],\r\n delimiter = ' + ';\r\n\r\n title = 'SoundManager ' + sm2.version + (!sm2.html5Only && sm2.useHTML5Audio ? (sm2.hasHTML5 ? ' + HTML5 audio' : ', no HTML5 audio support') : '');\r\n\r\n if (!sm2.html5Only) {\r\n\r\n if (sm2.preferFlash) {\r\n options.push('preferFlash');\r\n }\r\n\r\n if (sm2.useHighPerformance) {\r\n options.push('useHighPerformance');\r\n }\r\n\r\n if (sm2.flashPollingInterval) {\r\n options.push('flashPollingInterval (' + sm2.flashPollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (sm2.wmode) {\r\n options.push('wmode (' + sm2.wmode + ')');\r\n }\r\n\r\n if (sm2.debugFlash) {\r\n options.push('debugFlash');\r\n }\r\n\r\n if (sm2.useFlashBlock) {\r\n options.push('flashBlock');\r\n }\r\n\r\n } else if (sm2.html5PollingInterval) {\r\n options.push('html5PollingInterval (' + sm2.html5PollingInterval + 'ms)');\r\n }\r\n\r\n if (options.length) {\r\n msg = msg.concat([options.join(delimiter)]);\r\n }\r\n\r\n sm2._wD(title + (msg.length ? delimiter + msg.join(', ') : ''), 1);\r\n\r\n showSupport();\r\n\r\n // </d>\r\n\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n // 100% HTML5 mode\r\n setVersionInfo();\r\n\r\n initMsg();\r\n sm2.oMC = id(sm2.movieID);\r\n init();\r\n\r\n // prevent multiple init attempts\r\n didAppend = true;\r\n\r\n appendSuccess = true;\r\n\r\n return false;\r\n\r\n }\r\n\r\n // flash path\r\n var remoteURL = (movieURL || sm2.url),\r\n localURL = (sm2.altURL || remoteURL),\r\n swfTitle = 'JS/Flash audio component (SoundManager 2)',\r\n oTarget = getDocument(),\r\n extraClass = getSWFCSS(),\r\n isRTL = null,\r\n html = doc.getElementsByTagName('html')[0],\r\n oEmbed, oMovie, tmp, movieHTML, oEl, s, x, sClass;\r\n\r\n isRTL = (html && html.dir && html.dir.match(/rtl/i));\r\n movieID = (movieID === _undefined ? sm2.id : movieID);\r\n\r\n function param(name, value) {\r\n return '<param name=\"' + name + '\" value=\"' + value + '\" />';\r\n }\r\n\r\n // safety check for legacy (change to Flash 9 URL)\r\n setVersionInfo();\r\n sm2.url = normalizeMovieURL(overHTTP ? remoteURL : localURL);\r\n movieURL = sm2.url;\r\n\r\n sm2.wmode = (!sm2.wmode && sm2.useHighPerformance ? 'transparent' : sm2.wmode);\r\n\r\n if (sm2.wmode !== null && (ua.match(/msie 8/i) || (!isIE && !sm2.useHighPerformance)) && navigator.platform.match(/win32|win64/i)) {\r\n /**\r\n * extra-special case: movie doesn't load until scrolled into view when using wmode = anything but 'window' here\r\n * does not apply when using high performance (position:fixed means on-screen), OR infinite flash load timeout\r\n * wmode breaks IE 8 on Vista + Win7 too in some cases, as of January 2011 (?)\r\n */\r\n messages.push(strings.spcWmode);\r\n sm2.wmode = null;\r\n }\r\n\r\n oEmbed = {\r\n name: movieID,\r\n id: movieID,\r\n src: movieURL,\r\n quality: 'high',\r\n allowScriptAccess: sm2.allowScriptAccess,\r\n bgcolor: sm2.bgColor,\r\n pluginspage: http + 'www.macromedia.com/go/getflashplayer',\r\n title: swfTitle,\r\n type: 'application/x-shockwave-flash',\r\n wmode: sm2.wmode,\r\n // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html\r\n hasPriority: 'true'\r\n };\r\n\r\n if (sm2.debugFlash) {\r\n oEmbed.FlashVars = 'debug=1';\r\n }\r\n\r\n if (!sm2.wmode) {\r\n // don't write empty attribute\r\n delete oEmbed.wmode;\r\n }\r\n\r\n if (isIE) {\r\n\r\n // IE is \"special\".\r\n oMovie = doc.createElement('div');\r\n movieHTML = [\r\n '<object id=\"' + movieID + '\" data=\"' + movieURL + '\" type=\"' + oEmbed.type + '\" title=\"' + oEmbed.title + '\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0\">',\r\n param('movie', movieURL),\r\n param('AllowScriptAccess', sm2.allowScriptAccess),\r\n param('quality', oEmbed.quality),\r\n (sm2.wmode ? param('wmode', sm2.wmode) : ''),\r\n param('bgcolor', sm2.bgColor),\r\n param('hasPriority', 'true'),\r\n (sm2.debugFlash ? param('FlashVars', oEmbed.FlashVars) : ''),\r\n '</object>'\r\n ].join('');\r\n\r\n } else {\r\n\r\n oMovie = doc.createElement('embed');\r\n for (tmp in oEmbed) {\r\n if (oEmbed.hasOwnProperty(tmp)) {\r\n oMovie.setAttribute(tmp, oEmbed[tmp]);\r\n }\r\n }\r\n\r\n }\r\n\r\n initDebug();\r\n extraClass = getSWFCSS();\r\n oTarget = getDocument();\r\n\r\n if (oTarget) {\r\n\r\n sm2.oMC = (id(sm2.movieID) || doc.createElement('div'));\r\n\r\n if (!sm2.oMC.id) {\r\n\r\n sm2.oMC.id = sm2.movieID;\r\n sm2.oMC.className = swfCSS.swfDefault + ' ' + extraClass;\r\n s = null;\r\n oEl = null;\r\n\r\n if (!sm2.useFlashBlock) {\r\n if (sm2.useHighPerformance) {\r\n // on-screen at all times\r\n s = {\r\n position: 'fixed',\r\n width: '8px',\r\n height: '8px',\r\n // >= 6px for flash to run fast, >= 8px to start up under Firefox/win32 in some cases. odd? yes.\r\n bottom: '0px',\r\n left: '0px',\r\n overflow: 'hidden'\r\n };\r\n } else {\r\n // hide off-screen, lower priority\r\n s = {\r\n position: 'absolute',\r\n width: '6px',\r\n height: '6px',\r\n top: '-9999px',\r\n left: '-9999px'\r\n };\r\n if (isRTL) {\r\n s.left = Math.abs(parseInt(s.left, 10)) + 'px';\r\n }\r\n }\r\n }\r\n\r\n if (isWebkit) {\r\n // soundcloud-reported render/crash fix, safari 5\r\n sm2.oMC.style.zIndex = 10000;\r\n }\r\n\r\n if (!sm2.debugFlash) {\r\n for (x in s) {\r\n if (s.hasOwnProperty(x)) {\r\n sm2.oMC.style[x] = s[x];\r\n }\r\n }\r\n }\r\n\r\n try {\r\n\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oMovie);\r\n }\r\n\r\n oTarget.appendChild(sm2.oMC);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n } catch(e) {\r\n\r\n throw new Error(str('domError') + ' \\n' + e.toString());\r\n\r\n }\r\n\r\n } else {\r\n\r\n // SM2 container is already in the document (eg. flashblock use case)\r\n sClass = sm2.oMC.className;\r\n sm2.oMC.className = (sClass ? sClass + ' ' : swfCSS.swfDefault) + (extraClass ? ' ' + extraClass : '');\r\n sm2.oMC.appendChild(oMovie);\r\n\r\n if (isIE) {\r\n oEl = sm2.oMC.appendChild(doc.createElement('div'));\r\n oEl.className = swfCSS.swfBox;\r\n oEl.innerHTML = movieHTML;\r\n }\r\n\r\n appendSuccess = true;\r\n\r\n }\r\n\r\n }\r\n\r\n didAppend = true;\r\n\r\n initMsg();\r\n\r\n // sm2._wD(sm + ': Trying to load ' + movieURL + (!overHTTP && sm2.altURL ? ' (alternate URL)' : ''), 1);\r\n\r\n return true;\r\n\r\n };\r\n\r\n initMovie = function() {\r\n\r\n if (sm2.html5Only) {\r\n createMovie();\r\n return false;\r\n }\r\n\r\n // attempt to get, or create, movie (may already exist)\r\n if (flash) return false;\r\n\r\n if (!sm2.url) {\r\n\r\n /**\r\n * Something isn't right - we've reached init, but the soundManager url property has not been set.\r\n * User has not called setup({url: ...}), or has not set soundManager.url (legacy use case) directly before init time.\r\n * Notify and exit. If user calls setup() with a url: property, init will be restarted as in the deferred loading case.\r\n */\r\n\r\n _wDS('noURL');\r\n return false;\r\n\r\n }\r\n\r\n // inline markup case\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n if (!flash) {\r\n\r\n if (!oRemoved) {\r\n\r\n // try to create\r\n createMovie(sm2.id, sm2.url);\r\n\r\n } else {\r\n\r\n // try to re-append removed movie after reboot()\r\n if (!isIE) {\r\n sm2.oMC.appendChild(oRemoved);\r\n } else {\r\n sm2.oMC.innerHTML = oRemovedHTML;\r\n }\r\n\r\n oRemoved = null;\r\n didAppend = true;\r\n\r\n }\r\n\r\n flash = sm2.getMovie(sm2.id);\r\n\r\n }\r\n\r\n if (typeof sm2.oninitmovie === 'function') {\r\n setTimeout(sm2.oninitmovie, 1);\r\n }\r\n\r\n // <d>\r\n flushMessages();\r\n // </d>\r\n\r\n return true;\r\n\r\n };\r\n\r\n delayWaitForEI = function() {\r\n\r\n setTimeout(waitForEI, 1000);\r\n\r\n };\r\n\r\n rebootIntoHTML5 = function() {\r\n\r\n // special case: try for a reboot with preferFlash: false, if 100% HTML5 mode is possible and useFlashBlock is not enabled.\r\n\r\n window.setTimeout(function() {\r\n\r\n complain(smc + 'useFlashBlock is false, 100% HTML5 mode is possible. Rebooting with preferFlash: false...');\r\n\r\n sm2.setup({\r\n preferFlash: false\r\n }).reboot();\r\n\r\n // if for some reason you want to detect this case, use an ontimeout() callback and look for html5Only and didFlashBlock == true.\r\n sm2.didFlashBlock = true;\r\n\r\n sm2.beginDelayedInit();\r\n\r\n }, 1);\r\n\r\n };\r\n\r\n waitForEI = function() {\r\n\r\n var p,\r\n loadIncomplete = false;\r\n\r\n if (!sm2.url) {\r\n // No SWF url to load (noURL case) - exit for now. Will be retried when url is set.\r\n return;\r\n }\r\n\r\n if (waitingForEI) {\r\n return;\r\n }\r\n\r\n waitingForEI = true;\r\n event.remove(window, 'load', delayWaitForEI);\r\n\r\n if (hasFlash && tryInitOnFocus && !isFocused) {\r\n // Safari won't load flash in background tabs, only when focused.\r\n _wDS('waitFocus');\r\n return;\r\n }\r\n\r\n if (!didInit) {\r\n p = sm2.getMoviePercent();\r\n if (p > 0 && p < 100) {\r\n loadIncomplete = true;\r\n }\r\n }\r\n\r\n setTimeout(function() {\r\n\r\n p = sm2.getMoviePercent();\r\n\r\n if (loadIncomplete) {\r\n // special case: if movie *partially* loaded, retry until it's 100% before assuming failure.\r\n waitingForEI = false;\r\n sm2._wD(str('waitSWF'));\r\n window.setTimeout(delayWaitForEI, 1);\r\n return;\r\n }\r\n\r\n // <d>\r\n if (!didInit) {\r\n\r\n sm2._wD(sm + ': No Flash response within expected time. Likely causes: ' + (p === 0 ? 'SWF load failed, ' : '') + 'Flash blocked or JS-Flash security error.' + (sm2.debugFlash ? ' ' + str('checkSWF') : ''), 2);\r\n\r\n if (!overHTTP && p) {\r\n\r\n _wDS('localFail', 2);\r\n\r\n if (!sm2.debugFlash) {\r\n _wDS('tryDebug', 2);\r\n }\r\n\r\n }\r\n\r\n if (p === 0) {\r\n\r\n // if 0 (not null), probably a 404.\r\n sm2._wD(str('swf404', sm2.url), 1);\r\n\r\n }\r\n\r\n debugTS('flashtojs', false, ': Timed out' + (overHTTP ? ' (Check flash security or flash blockers)' : ' (No plugin/missing SWF?)'));\r\n\r\n }\r\n // </d>\r\n\r\n // give up / time-out, depending\r\n\r\n if (!didInit && okToDisable) {\r\n\r\n if (p === null) {\r\n\r\n // SWF failed to report load progress. Possibly blocked.\r\n\r\n if (sm2.useFlashBlock || sm2.flashLoadTimeout === 0) {\r\n\r\n if (sm2.useFlashBlock) {\r\n\r\n flashBlockHandler();\r\n\r\n }\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n // no custom flash block handling, but SWF has timed out. Will recover if user unblocks / allows SWF load.\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n _wDS('waitForever');\r\n\r\n // fire any regular registered ontimeout() listeners.\r\n processOnEvents({\r\n type: 'ontimeout',\r\n ignoreInit: true,\r\n error: {\r\n type: 'INIT_FLASHBLOCK'\r\n }\r\n });\r\n\r\n }\r\n\r\n } else if (sm2.flashLoadTimeout === 0) {\r\n\r\n // SWF loaded? Shouldn't be a blocking issue, then.\r\n\r\n _wDS('waitForever');\r\n\r\n } else if (!sm2.useFlashBlock && canIgnoreFlash) {\r\n\r\n rebootIntoHTML5();\r\n\r\n } else {\r\n\r\n failSafely(true);\r\n\r\n }\r\n\r\n }\r\n\r\n }, sm2.flashLoadTimeout);\r\n\r\n };\r\n\r\n handleFocus = function() {\r\n\r\n function cleanup() {\r\n event.remove(window, 'focus', handleFocus);\r\n }\r\n\r\n if (isFocused || !tryInitOnFocus) {\r\n // already focused, or not special Safari background tab case\r\n cleanup();\r\n return true;\r\n }\r\n\r\n okToDisable = true;\r\n isFocused = true;\r\n _wDS('gotFocus');\r\n\r\n // allow init to restart\r\n waitingForEI = false;\r\n\r\n // kick off ExternalInterface timeout, now that the SWF has started\r\n delayWaitForEI();\r\n\r\n cleanup();\r\n return true;\r\n\r\n };\r\n\r\n flushMessages = function() {\r\n\r\n // <d>\r\n\r\n // SM2 pre-init debug messages\r\n if (messages.length) {\r\n sm2._wD('SoundManager 2: ' + messages.join(' '), 1);\r\n messages = [];\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n showSupport = function() {\r\n\r\n // <d>\r\n\r\n flushMessages();\r\n\r\n var item, tests = [];\r\n\r\n if (sm2.useHTML5Audio && sm2.hasHTML5) {\r\n for (item in sm2.audioFormats) {\r\n if (sm2.audioFormats.hasOwnProperty(item)) {\r\n tests.push(item + ' = ' + sm2.html5[item] + (!sm2.html5[item] && needsFlash && sm2.flash[item] ? ' (using flash)' : (sm2.preferFlash && sm2.flash[item] && needsFlash ? ' (preferring flash)' : (!sm2.html5[item] ? ' (' + (sm2.audioFormats[item].required ? 'required, ' : '') + 'and no flash support)' : ''))));\r\n }\r\n }\r\n sm2._wD('SoundManager 2 HTML5 support: ' + tests.join(', '), 1);\r\n }\r\n\r\n // </d>\r\n\r\n };\r\n\r\n initComplete = function(bNoDisable) {\r\n\r\n if (didInit) return false;\r\n\r\n if (sm2.html5Only) {\r\n // all good.\r\n _wDS('sm2Loaded', 1);\r\n didInit = true;\r\n initUserOnload();\r\n debugTS('onload', true);\r\n return true;\r\n }\r\n\r\n var wasTimeout = (sm2.useFlashBlock && sm2.flashLoadTimeout && !sm2.getMoviePercent()),\r\n result = true,\r\n error;\r\n\r\n if (!wasTimeout) {\r\n didInit = true;\r\n }\r\n\r\n error = {\r\n type: (!hasFlash && needsFlash ? 'NO_FLASH' : 'INIT_TIMEOUT')\r\n };\r\n\r\n sm2._wD('SoundManager 2 ' + (disabled ? 'failed to load' : 'loaded') + ' (' + (disabled ? 'Flash security/load error' : 'OK') + ') ' + String.fromCharCode(disabled ? 10006 : 10003), disabled ? 2 : 1);\r\n\r\n if (disabled || bNoDisable) {\r\n\r\n if (sm2.useFlashBlock && sm2.oMC) {\r\n sm2.oMC.className = getSWFCSS() + ' ' + (sm2.getMoviePercent() === null ? swfCSS.swfTimedout : swfCSS.swfError);\r\n }\r\n\r\n processOnEvents({\r\n type: 'ontimeout',\r\n error: error,\r\n ignoreInit: true\r\n });\r\n\r\n debugTS('onload', false);\r\n catchError(error);\r\n\r\n result = false;\r\n\r\n } else {\r\n\r\n debugTS('onload', true);\r\n\r\n }\r\n\r\n if (!disabled) {\r\n\r\n if (sm2.waitForWindowLoad && !windowLoaded) {\r\n\r\n _wDS('waitOnload');\r\n event.add(window, 'load', initUserOnload);\r\n\r\n } else {\r\n\r\n // <d>\r\n if (sm2.waitForWindowLoad && windowLoaded) {\r\n _wDS('docLoaded');\r\n }\r\n // </d>\r\n\r\n initUserOnload();\r\n\r\n }\r\n\r\n }\r\n\r\n return result;\r\n\r\n };\r\n\r\n /**\r\n * apply top-level setupOptions object as local properties, eg., this.setupOptions.flashVersion -> this.flashVersion (soundManager.flashVersion)\r\n * this maintains backward compatibility, and allows properties to be defined separately for use by soundManager.setup().\r\n */\r\n\r\n setProperties = function() {\r\n\r\n var i,\r\n o = sm2.setupOptions;\r\n\r\n for (i in o) {\r\n\r\n if (o.hasOwnProperty(i)) {\r\n\r\n // assign local property if not already defined\r\n\r\n if (sm2[i] === _undefined) {\r\n\r\n sm2[i] = o[i];\r\n\r\n } else if (sm2[i] !== o[i]) {\r\n\r\n // legacy support: write manually-assigned property (eg., soundManager.url) back to setupOptions to keep things in sync\r\n sm2.setupOptions[i] = sm2[i];\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n };\r\n\r\n\r\n init = function() {\r\n\r\n // called after onload()\r\n\r\n if (didInit) {\r\n _wDS('didInit');\r\n return false;\r\n }\r\n\r\n function cleanup() {\r\n event.remove(window, 'load', sm2.beginDelayedInit);\r\n }\r\n\r\n if (sm2.html5Only) {\r\n\r\n if (!didInit) {\r\n // we don't need no steenking flash!\r\n cleanup();\r\n sm2.enabled = true;\r\n initComplete();\r\n }\r\n\r\n return true;\r\n\r\n }\r\n\r\n // flash path\r\n initMovie();\r\n\r\n try {\r\n\r\n // attempt to talk to Flash\r\n flash._externalInterfaceTest(false);\r\n\r\n /**\r\n * Apply user-specified polling interval, OR, if \"high performance\" set, faster vs. default polling\r\n * (determines frequency of whileloading/whileplaying callbacks, effectively driving UI framerates)\r\n */\r\n setPolling(true, (sm2.flashPollingInterval || (sm2.useHighPerformance ? 10 : 50)));\r\n\r\n if (!sm2.debugMode) {\r\n // stop the SWF from making debug output calls to JS\r\n flash._disableDebug();\r\n }\r\n\r\n sm2.enabled = true;\r\n debugTS('jstoflash', true);\r\n\r\n if (!sm2.html5Only) {\r\n // prevent browser from showing cached page state (or rather, restoring \"suspended\" page state) via back button, because flash may be dead\r\n // http://www.webkit.org/blog/516/webkit-page-cache-ii-the-unload-event/\r\n event.add(window, 'unload', doNothing);\r\n }\r\n\r\n } catch(e) {\r\n\r\n sm2._wD('js/flash exception: ' + e.toString());\r\n\r\n debugTS('jstoflash', false);\r\n\r\n catchError({\r\n type: 'JS_TO_FLASH_EXCEPTION',\r\n fatal: true\r\n });\r\n\r\n // don't disable, for reboot()\r\n failSafely(true);\r\n\r\n initComplete();\r\n\r\n return false;\r\n\r\n }\r\n\r\n initComplete();\r\n\r\n // disconnect events\r\n cleanup();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoaded = function() {\r\n\r\n if (didDCLoaded) return false;\r\n\r\n didDCLoaded = true;\r\n\r\n // assign top-level soundManager properties eg. soundManager.url\r\n setProperties();\r\n\r\n initDebug();\r\n\r\n if (!hasFlash && sm2.hasHTML5) {\r\n\r\n sm2._wD('SoundManager 2: No Flash detected' + (!sm2.useHTML5Audio ? ', enabling HTML5.' : '. Trying HTML5-only mode.'), 1);\r\n\r\n sm2.setup({\r\n useHTML5Audio: true,\r\n // make sure we aren't preferring flash, either\r\n // TODO: preferFlash should not matter if flash is not installed. Currently, stuff breaks without the below tweak.\r\n preferFlash: false\r\n });\r\n\r\n }\r\n\r\n testHTML5();\r\n\r\n if (!hasFlash && needsFlash) {\r\n\r\n messages.push(strings.needFlash);\r\n\r\n // TODO: Fatal here vs. timeout approach, etc.\r\n // hack: fail sooner.\r\n sm2.setup({\r\n flashLoadTimeout: 1\r\n });\r\n\r\n }\r\n\r\n if (doc.removeEventListener) {\r\n doc.removeEventListener('DOMContentLoaded', domContentLoaded, false);\r\n }\r\n\r\n initMovie();\r\n\r\n return true;\r\n\r\n };\r\n\r\n domContentLoadedIE = function() {\r\n\r\n if (doc.readyState === 'complete') {\r\n domContentLoaded();\r\n doc.detachEvent('onreadystatechange', domContentLoadedIE);\r\n }\r\n\r\n return true;\r\n\r\n };\r\n\r\n winOnLoad = function() {\r\n\r\n // catch edge case of initComplete() firing after window.load()\r\n windowLoaded = true;\r\n\r\n // catch case where DOMContentLoaded has been sent, but we're still in doc.readyState = 'interactive'\r\n domContentLoaded();\r\n\r\n event.remove(window, 'load', winOnLoad);\r\n\r\n };\r\n\r\n // sniff up-front\r\n detectFlash();\r\n\r\n // focus and window load, init (primarily flash-driven)\r\n event.add(window, 'focus', handleFocus);\r\n event.add(window, 'load', delayWaitForEI);\r\n event.add(window, 'load', winOnLoad);\r\n\r\n if (doc.addEventListener) {\r\n\r\n doc.addEventListener('DOMContentLoaded', domContentLoaded, false);\r\n\r\n } else if (doc.attachEvent) {\r\n\r\n doc.attachEvent('onreadystatechange', domContentLoadedIE);\r\n\r\n } else {\r\n\r\n // no add/attachevent support - safe to assume no JS -> Flash either\r\n debugTS('onload', false);\r\n catchError({\r\n type: 'NO_DOM2_EVENTS',\r\n fatal: true\r\n });\r\n\r\n }\r\n\r\n} // SoundManager()\r\n\r\n// SM2_DEFER details: http://www.schillmania.com/projects/soundmanager2/doc/getstarted/#lazy-loading\r\n\r\nif (window.SM2_DEFER === _undefined || !SM2_DEFER) {\r\n soundManager = new SoundManager();\r\n}\r\n\r\n/**\r\n * SoundManager public interfaces\r\n * ------------------------------\r\n */\r\n\r\nif (typeof module === 'object' && module && typeof module.exports === 'object') {\r\n\r\n /**\r\n * commonJS module\r\n */\r\n\r\n module.exports.SoundManager = SoundManager;\r\n module.exports.soundManager = soundManager;\r\n\r\n} else if (typeof define === 'function' && define.amd) {\r\n\r\n /**\r\n * AMD - requireJS\r\n * basic usage:\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance().setup({\r\n * url: '/swf/',\r\n * onready: function() { ... }\r\n * })\r\n * });\r\n *\r\n * SM2_DEFER usage:\r\n * window.SM2_DEFER = true;\r\n * require([\"/path/to/soundmanager2.js\"], function(SoundManager) {\r\n * SoundManager.getInstance(function() {\r\n * var soundManager = new SoundManager.constructor();\r\n * soundManager.setup({\r\n * url: '/swf/',\r\n * ...\r\n * });\r\n * ...\r\n * soundManager.beginDelayedInit();\r\n * return soundManager;\r\n * })\r\n * });\r\n */\r\n\r\n define(function() {\r\n /**\r\n * Retrieve the global instance of SoundManager.\r\n * If a global instance does not exist it can be created using a callback.\r\n *\r\n * @param {Function} smBuilder Optional: Callback used to create a new SoundManager instance\r\n * @return {SoundManager} The global SoundManager instance\r\n */\r\n function getInstance(smBuilder) {\r\n if (!window.soundManager && smBuilder instanceof Function) {\r\n var instance = smBuilder(SoundManager);\r\n if (instance instanceof SoundManager) {\r\n window.soundManager = instance;\r\n }\r\n }\r\n return window.soundManager;\r\n }\r\n return {\r\n constructor: SoundManager,\r\n getInstance: getInstance\r\n };\r\n });\r\n\r\n}\r\n\r\n// standard browser case\r\n\r\n// constructor\r\nwindow.SoundManager = SoundManager;\r\n\r\n/**\r\n * note: SM2 requires a window global due to Flash, which makes calls to window.soundManager.\r\n * Flash may not always be needed, but this is not known until async init and SM2 may even \"reboot\" into Flash mode.\r\n */\r\n\r\n// public API, flash callbacks etc.\r\nwindow.soundManager = soundManager;\r\n\r\n}(window));\r\n","'use strict';\nvar $ = require('../internals/export');\nvar $entries = require('../internals/object-to-array').entries;\n\n// `Object.entries` method\n// https://tc39.es/ecma262/#sec-object.entries\n$({ target: 'Object', stat: true }, {\n entries: function entries(O) {\n return $entries(O);\n }\n});\n"],"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","return","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","catch","delegateYield","asyncGeneratorStep","gen","reject","_next","_throw","key","info","error","_defineProperties","target","props","descriptor","input","hint","prim","toPrimitive","undefined","res","String","_toPrimitive","PageChunk","leafIndex","chunkIndex","text","lineRects","instance","Constructor","_classCallCheck","this","staticProps","fn","_fetch","_callee","server","bookPath","chunks","_context","$","ajax","url","concat","dataType","cache","data","path","page","_fromTextWrapperResponse","self","args","arguments","apply","err","_x","_x2","_x3","chunksResponse","map","correctedLineRects","_fixChunkRects","correctedText","_removeDanglingHyphens","rects","_rects","_slicedToArray","firstRect","secondRect","_firstRect","left","bottom","width","secondHeight","secondWidth","secondRight","replace","PageChunkIterator","pageCount","start","opts","assign","DEFAULT_OPTS","_cursor","chunk","_bufferedPages","_bufferingPages","_cursorLock","protoProps","_nextUncontrolled2","_this","_nextUncontrolled","_this2","_decrementUncontrolled","AT_END","_recenterBuffer","_fetchPageChunks","_this3","cursorChangePromise","prevPageChunks","index","Math","max","pageBufferSize","end","min","_removePageFromBuffer","_this4","_fetchPageChunksDirect","fetch","isAndroid","userAgent","navigator","test","COLUMN_TO_LANG_INDEX","searchForISO6391","language","columnsToSearch","langs","colI","column","split","x","toLowerCase","indexOf","hasLocalStorage","window","localStorage","_asyncToGenerator","_toPropertyKey","AbstractTTSEngine","options","obj","voice","getBestBookVoice","getVoices","bookLanguage","playing","paused","_chunkIterator","activeSound","playbackRate","events","on","updateBestVoice","trigger","_step","_jumpBackward","numLeafs","onLoadingStart","step","fireEvent","pause","resume","all","decrement","voiceURI","off","find","setItem","setVoice","newRate","setPlaybackRate","_callee2","sound","playPromise","_context2","onDone","createSound","rate","load","onLoadingComplete","beforeChunkPlay","playSound","afterChunkPlay","loaded","play","voices","userLanguages","languages","bookLangVoices","filter","lang","startsWith","matchingUserLangs","getMatchingStoredVoice","getMatchingVoice","default","storedVoice","getItem","_step2","_iterator","_createForOfIteratorHelper","_ret","_loop","matchingVoices","_createClass","_get","Reflect","get","bind","property","receiver","base","object","_getPrototypeOf","_superPropBase","desc","getOwnPropertyDescriptor","_setPrototypeOf","FestivalTTSEngine","_AbstractTTSEngine","subClass","superClass","_inherits","_iOSCaptureUserIntentHack","Derived","hasNativeReflectConstruct","_super","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","result","Super","NewTarget","ReferenceError","_assertThisInitialized","_possibleConstructorReturn","_$$browser","audioFormat","browser","mozilla","localService","soundManager","setup","debugMode","preferFlash","useHTML5Audio","flashVersion","promise","match","iOSCaptureUserIntentHack","FestivalTTSSound","getSoundUrl","dataString","encodeURIComponent","SILENCE_1MS","onfinish","destruct","supported","soundUrl","_finishResolver","_play","onload","_onresume","onresume","sleep","_callee3","_context3","mp3","ogg","super_","WebTTSEngine","speechSynthesis","addEventListener","audio","Audio","SILENCE_6S_MP3","loop","src","mediaSession","metadata","MediaMetadata","title","br","bookTitle","artist","m","label","artwork","thumbnail","setActionHandler","jumpBackward","jumpForward","unshift","WebTTSSound","started","stopped","utterance","_lastEvents","boundary","_charIndex","_finishPromise","_chromePausingBugFix2","_resume","_pause","_finish","_reload","_this$voice","SpeechSynthesisUtterance","location","toString","console","log","ev","dispatchEvent","CustomEvent","wasPaused","recentEvent","charIndex","cancel","speak","isLocalVoice","isChrome","_chromePausingBugFix","endPromise","race","promisifyEvent","Event","pausePromise","pauseMightNotWork","timeoutPromise","isFirefox","_callee4","resumeMightNotWork","resumeMightNotFire","resumePromise","_context4","reload","_callee5","_context5","t0","en","jQuery","extend","BookReader","defaultOptions","enableTtsPlugin","_ttsBoxesByIndex","TTSEngine","isSupported","engineName","festival","web","ttsEngine","showProgressPopup","removeProgressPopup","ttsStop","ttsBeforeChunkPlay","ttsSendChunkFinishedAnalyticsEvent","init","eventNames","PostInit","click","ttsToggle","ttsStart","_createPageContainer","pageContainer","pageIndex","renderBoxesInPageContainerLayer","$container","buildMobileDrawerElement","$el","after","imagesBaseURL","initNavbar","refs","$BRReadAloudToolbar","prepend","renderVoiceOption","join","voiceSortOrder","b","localeCompare","renderVoicesMenu","voicesMenu","empty","bookLanguages","sort","otherLanguages","append","val","show","hide","ttsUpdateState","ttsPlayPause","ttsJumpForward","ttsJumpBackward","$rateSelector","parseFloat","tooltips","insertBefore","closest","autoStop","startTTSEngine","constModeThumb","mode","switchMode","constMode1up","addClass","ttsSendAnalyticsEvent","currentIndex","book","getNumLeafs","isPlaying","toggleClass","togglePlayPause","removeClass","ttsRemoveHilites","_ref","ttsMaybeFlipToIndex","ttsHighlightChunk","ttsScrollToChunk","_ref2","constMode2up","jumpToIndex","_modes","mode2Up","mode2UpLit","_ref3","_ref4","_Object$entries$_i","_Object$entries","_i","pageIndexString","boxes","getPage","getActivePageContainerElementsForIndex","container","entries","_$$last","last","scrollIntoView","block","isFullscreenActive","inline","behavior","getActivePageContainerElements","remove","action","archiveAnalyticsSendEvent","extraValues","mediaLanguage","exports","uaMatch","ua","exec","platform_match","matched","version","versionNumber","platform","parseInt","android","bb","blackberry","ipad","iphone","ipod","kindle","playbook","silk","mobile","cros","mac","linux","win","desktop","chrome","opr","safari","webkit","rv","iemobile","ie","edge","msedge","opera","jQBrowser","factory","_undefined","document","SoundManager","smURL","smID","setupOptions","debugFlash","useConsole","consoleOnly","waitForWindowLoad","bgColor","useHighPerformance","flashPollingInterval","html5PollingInterval","flashLoadTimeout","wmode","allowScriptAccess","useFlashBlock","forceUseGlobalHTML5Audio","ignoreMobileRestrictions","html5Test","noSWFCache","idPrefix","autoLoad","autoPlay","from","loops","onid3","onerror","whileloading","onplay","onpause","whileplaying","onposition","onstop","multiShot","multiShotEvents","position","pan","stream","to","usePolicyFile","volume","flash9Options","onfailure","isMovieStar","usePeakData","useWaveformData","useEQData","onbufferchange","ondataerror","movieStarOptions","bufferTime","serverURL","onconnect","duration","audioFormats","required","mp4","related","opus","wav","flac","movieID","id","debugID","debugURLParam","movieURL","altURL","swfLoaded","enabled","oMC","sounds","soundIDs","muted","didFlashBlock","filePattern","filePatterns","flash8","flash9","features","buffering","peakData","waveformData","eqData","movieStar","sandbox","types","remote","localWithFile","localWithNetwork","localTrusted","description","noRemote","noLocal","html5","usingFlash","flash","html5Only","ignoreFlash","SMSound","doNothing","setProperties","fV","debugTS","_wDS","initComplete","mixin","extraOptions","addOnEvent","processOnEvents","initUserOnload","delayWaitForEI","waitForEI","rebootIntoHTML5","setVersionInfo","handleFocus","strings","initMovie","domContentLoaded","winOnLoad","didDCLoaded","getDocument","createMovie","catchError","setPolling","initDebug","disableObject","failSafely","normalizeMovieURL","str","flashBlockHandler","getSWFCSS","swfCSS","toggleDebug","loopFix","policyFix","complain","idCheck","startTimer","stopTimer","timerExecute","parseURL","canIgnoreFlash","featureCheck","html5OK","html5CanPlay","html5ErrorCodes","html5Ext","html5Unload","domContentLoadedIE","testHTML5","event","lastGlobalHTML5URL","hasFlash","detectFlash","badSafariFix","html5_events","showSupport","flushMessages","wrapCallback","didSetup","sm2","globalHTML5Audio","sm","smc","wl","href","doc","on_queue","debugOpen","didAppend","appendSuccess","didInit","disabled","windowLoaded","wdCount","debugLevels","oRemoved","oRemovedHTML","waitingForEI","initPending","h5TimerCount","h5IntervalTimer","messages","needsFlash","Array","useGlobalHTML5Audio","idCounter","msecScale","is_iDevice","isIE","isWebkit","isSafari","isOpera","mobileHTML5","isBadSafari","hasConsole","isFocused","hasFocus","tryInitOnFocus","okToDisable","flashMIME","emptyURL","overHTTP","protocol","http","netStreamMimeTypes","netStreamTypes","netStreamPattern","RegExp","preferFlashCheck","kind","html5_event","oFn","_s","_a","_wD","h5","mimePattern","useAltURL","swfBox","swfDefault","swfError","swfTimedout","swfUnblocked","sm2Debug","highPerf","flashDebug","hasHTML5","canPlayType","noURL","ok","globalHTML5","ignoreMobile","mobileUA","beginDelayedInit","readyState","setTimeout","getMovie","movie_id","oOptions","_url","cs","cs_string","oSound","make","_setup_html5","_createSound","connected","destroySound","sID","_bFromSound","oS","_iO","unload","splice","onPosition","nPosition","oMethod","oScope","clearOnPosition","overloaded","allowOverride","setPosition","nMsecOffset","stopAll","pauseAll","resumeAll","togglePause","setPan","nPan","setVolume","nVol","j","mute","muteAll","unmute","unmuteAll","toggleMute","getMemoryUse","ram","_getMemoryUse","disable","bNoDisable","canPlayMIME","sMIME","canPlayURL","sURL","canPlayLink","oLink","getSoundById","_suppressDebug","onready","sType","ontimeout","_writeDebug","sText","sTypeOrObject","oItem","createElement","className","appendChild","createTextNode","style","fontWeight","color","firstChild","alert","_debug","reboot","resetEvents","excludeInit","k","innerHTML","parentNode","removeChild","fired","getMoviePercent","PercentLoaded","resetProperties","add_html5_events","remove_html5_events","stop_html5_timer","start_html5_timer","attachOnPosition","detachOnPosition","applyFromTo","lastHTML5State","urlOmitted","onplay_called","onPositionItems","onPositionFired","lastURL","time","instanceOptions","isHTML5","id3","playState","_called_load","_html5_canplay","autobuffer","preload","_load","fatal","_unload","_bFromSM","_destroySound","_updatePlayState","fN","audioClone","onended","oncanplay","startOK","getAutoPlay","setAutoPlay","substr","lastIndexOf","instanceCount","_oncanplay","_onfinish","currentTime","add","_start","onplayerror","bAll","originalPosition","_onbufferchange","_resetOnPosition","_onTimer","_stop","_setAutoPlay","normalizedRate","message","position1K","offset","toFixed","_setPosition","_bCallFlash","bInstanceOnly","_setPan","_bInstanceOnly","_setVolume","hasIO","scope","_processOnPosition","item","op","retainPosition","_hasTimer","bytesLoaded","bytesTotal","durationEstimate","buffered","right","failures","isBuffering","bForce","isNew","_get_html5_duration","_whileplaying","Infinity","_apply_loop","nLoops","sameURL","dURL","decodeURI","_added_events","oEvt","removeEventListener","_onload","nSuccess","loadOK","_onerror","errorCode","nIsBuffering","_onsuspend","onsuspend","_onfailure","msg","level","code","_onwarning","onwarning","io_onfinish","_whileloading","nBytesLoaded","nBytesTotal","nDuration","nBufferLength","floor","bufferLength","oPeakData","oWaveformDataLeft","oWaveformDataRight","oEQData","eqLeft","leftPeak","rightPeak","leftEQ","rightEQ","_oncaptiondata","oData","captiondata","oncaptiondata","_onmetadata","oMDProps","oMDData","onmetadata","_onid3","oID3Props","oID3Data","_onconnect","bSuccess","_ondataerror","sError","body","getElementsByTagName","getElementById","oMain","oAdd","o2","o1","callback","oParent","hasParent","bonusOptions","Function","old","evt","getArgs","oArgs","len","element","shift","abort","canplay","ee","canplaythrough","durationchange","ended","loadeddata","_loaded","loadedmetadata","loadstart","fromCharCode","progress","progStr","isProgress","ranges","total","ratechange","suspend","stalled","timeupdate","waiting","iO","oAudio","_called_unload","fileExt","mime","aF","lookup","support","cp","canPlay","isOK","notReady","notOK","domError","spcWmode","swf404","tryDebug","checkSWF","localFail","waitFocus","waitForever","waitSWF","needFunction","badID","currentObj","waitOnload","docLoaded","onloadOK","secNote","badRemove","shutdown","queue","smError","fbTimeout","fbLoaded","fbHandler","manURL","onURL","badFV","as2loop","noNSLoop","needfl9","mfTimeout","needFlash","gotFocus","policy","setupError","setupUndef","setupLate","sm2Loaded","sstr","sOpt","sPre","sMsg","warn","oProp","Date","getTime","isDebug","bPolling","bHighPerformance","_setPolling","oD","oDebug","oTarget","oToggle","tmp","height","lineHeight","margin","textAlign","border","cursor","background","zIndex","onclick","display","e2","errorLevel","oT","sEventType","sMessage","sm2Debugger","handleEvent","css","ignoreInit","status","success","srcQueue","canRetry","nP","hasPlugin","AX","ActiveXObject","plugins","mimeTypes","enabledPlugin","flashNeeded","formats","urlResult","setInterval","clearInterval","_setSandboxType","sandboxType","sb","_externalInterfaceOK","swfVersion","initMsg","isRTL","oEmbed","oMovie","movieHTML","oEl","sClass","remoteURL","localURL","extraClass","html","param","dir","quality","bgcolor","pluginspage","hasPriority","FlashVars","setAttribute","overflow","top","abs","oninitmovie","loadIncomplete","cleanup","tests","_externalInterfaceTest","_disableDebug","detachEvent","attachEvent","SM2_DEFER","module","getInstance","smBuilder","$entries","stat","O"],"sourceRoot":""}
|