diff --git a/dist/amplitude.js b/dist/amplitude.js index 55e521d9..c441e305 100644 --- a/dist/amplitude.js +++ b/dist/amplitude.js @@ -13416,7 +13416,7 @@ module.exports = exports["default"]; /* 59 */ /***/ (function(module, exports) { -module.exports = {"name":"amplitudejs","version":"5.3.1","description":"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs","main":"dist/amplitude.js","devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0","husky":"^1.3.1","jest":"^23.6.0","prettier":"1.15.1","pretty-quick":"^1.11.1","watch":"^1.0.2","webpack":"^2.7.0"},"directories":{"doc":"docs"},"files":["dist"],"funding":{"type":"opencollective","url":"https://opencollective.com/amplitudejs"},"scripts":{"build":"node_modules/.bin/webpack","prettier":"npx pretty-quick","preversion":"npx pretty-quick && npm run test","postversion":"git push && git push --tags","test":"jest","version":"npm run build && git add -A dist"},"repository":{"type":"git","url":"git+https://github.com/521dimensions/amplitudejs.git"},"keywords":["webaudio","html5","javascript","audio-player"],"author":"521 Dimensions (https://521dimensions.com)","license":"MIT","bugs":{"url":"https://github.com/521dimensions/amplitudejs/issues"},"homepage":"https://github.com/521dimensions/amplitudejs#readme"} +module.exports = {"name":"amplitudejs","version":"5.3.2","description":"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs","main":"dist/amplitude.js","devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0","husky":"^1.3.1","jest":"^23.6.0","prettier":"1.15.1","pretty-quick":"^1.11.1","watch":"^1.0.2","webpack":"^2.7.0"},"directories":{"doc":"docs"},"files":["dist"],"funding":{"type":"opencollective","url":"https://opencollective.com/amplitudejs"},"scripts":{"build":"node_modules/.bin/webpack","prettier":"npx pretty-quick","preversion":"npx pretty-quick && npm run test","postversion":"git push && git push --tags","test":"jest","version":"npm run build && git add -A dist"},"repository":{"type":"git","url":"git+https://github.com/521dimensions/amplitudejs.git"},"keywords":["webaudio","html5","javascript","audio-player"],"author":"521 Dimensions (https://521dimensions.com)","license":"MIT","bugs":{"url":"https://github.com/521dimensions/amplitudejs/issues"},"homepage":"https://github.com/521dimensions/amplitudejs#readme"} /***/ }) /******/ ]); diff --git a/dist/amplitude.js.map b/dist/amplitude.js.map index 56294a3d..6cc663b0 100644 --- a/dist/amplitude.js.map +++ b/dist/amplitude.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 79d4f9aa69f6e1e680bd","webpack:///./src/config.js","webpack:///./src/core/core.js","webpack:///./src/visual/playPauseElements.js","webpack:///./src/utilities/audioNavigation.js","webpack:///./src/utilities/debug.js","webpack:///./src/utilities/checks.js","webpack:///./src/utilities/configState.js","webpack:///./src/visual/metaDataElements.js","webpack:///./src/visual/repeatElements.js","webpack:///./src/utilities/callbacks.js","webpack:///./src/visual/muteElements.js","webpack:///./src/visual/volumeSliderElements.js","webpack:///./src/utilities/repeater.js","webpack:///./src/utilities/shuffler.js","webpack:///./src/visual/songSliderElements.js","webpack:///./src/visual/timeElements.js","webpack:///./src/fx/visualizations.js","webpack:///./src/soundcloud/soundcloud.js","webpack:///./src/visual/playbackSpeedElements.js","webpack:///./src/visual/shuffleElements.js","webpack:///./src/visual/songPlayedProgressElements.js","webpack:///./src/init/init.js","webpack:///./src/fx/waveform.js","webpack:///./src/utilities/time.js","webpack:///./src/visual/bufferedProgressElements.js","webpack:///./src/events/ended.js","webpack:///./src/events/events.js","webpack:///./src/events/keydown.js","webpack:///./src/events/mute.js","webpack:///./src/events/next.js","webpack:///./src/events/pause.js","webpack:///./src/events/play.js","webpack:///./src/events/playPause.js","webpack:///./src/events/playbackSpeed.js","webpack:///./src/events/prev.js","webpack:///./src/events/progress.js","webpack:///./src/events/repeat.js","webpack:///./src/events/repeatSong.js","webpack:///./src/events/shuffle.js","webpack:///./src/events/skipTo.js","webpack:///./src/events/songSlider.js","webpack:///./src/events/stop.js","webpack:///./src/events/timeUpdate.js","webpack:///./src/events/volumeDown.js","webpack:///./src/events/volumeSlider.js","webpack:///./src/events/volumeUp.js","webpack:///./src/fx/fx.js","webpack:///./src/index.js","webpack:///./src/init/playlists.js","webpack:///./src/visual/containerElements.js","webpack:///./src/visual/time/currentHourElements.js","webpack:///./src/visual/time/currentMinuteElements.js","webpack:///./src/visual/time/currentSecondElements.js","webpack:///./src/visual/time/currentTimeElements.js","webpack:///./src/visual/time/durationCountDownTimeElements.js","webpack:///./src/visual/time/durationHourElements.js","webpack:///./src/visual/time/durationMinuteElements.js","webpack:///./src/visual/time/durationSecondElements.js","webpack:///./src/visual/time/durationTimeElements.js","webpack:///./package.json"],"names":["module","exports","version","audio","Audio","active_metadata","active_album","active_index","active_playlist","playback_speed","callbacks","songs","playlists","start_song","starting_playlist","starting_playlist_song","repeat","repeat_song","shuffle_list","shuffle_on","default_album_art","default_playlist_art","debug","volume","pre_mute_volume","volume_increment","volume_decrement","soundcloud_client","soundcloud_use_art","soundcloud_song_count","soundcloud_songs_ready","is_touch_moving","buffered","bindings","continue_next","delay","player_state","web_audio_api_available","context","source","analyser","visualizations","available","active","backup","waveforms","sample_rate","built","Core","play","Visualizations","stop","run","config","live","reconnectStream","test","navigator","userAgent","paused","playPromise","undefined","then","catch","playbackRate","ConfigState","setPlayerState","pause","disconnectStream","currentTime","Callbacks","setVolume","volumeLevel","muted","setSongLocation","songPercentage","duration","skipToLocation","seconds","addEventListener","Debug","writeMessage","once","src","load","url","setPlaybackSpeed","playbackSpeed","PlayPauseElements","sync","syncGlobal","syncPlaylist","syncSong","syncSongInPlaylist","state","playPauseElements","document","querySelectorAll","i","length","playlist","getAttribute","song","setElementPlay","setElementPause","playlistPlayPauseElements","songPlayPauseElements","activePlaylistIndex","songInPlaylistPlayPauseElements","syncToPause","element","classList","add","remove","AudioNavigation","setNext","songEnded","nextIndex","nextSong","endOfList","index","parseInt","changeSong","setNextPlaylist","shuffle","setActivePlaylist","changeSongPlaylist","setPrevious","previousIndex","previousSong","setPreviousPlaylist","direct","prepareSongChange","album","afterSongChange","SongSliderElements","resetElements","SongPlayedProgressElements","TimeElements","resetCurrentTimes","Checks","newAlbum","MetaDataElements","displayMetaData","ContainerElements","setActive","resetDurationTimes","message","console","log","newSong","songIndex","newPlaylist","isURL","pattern","isInt","int","isNaN","Number","resetConfig","imageMetaDataKeys","songInfoElements","info","val","indexOf","setAttribute","innerHTML","displayPlaylistMetaData","playlistInfoElements","setFirstSongInPlaylist","elementPlaylist","syncMetaData","RepeatElements","syncRepeat","repeatClasses","getElementsByClassName","syncRepeatPlaylist","repeatButtons","syncRepeatSong","repeatSongClasses","initialize","callbackName","callbackFunction","error","MuteElements","setMuted","muteClasses","VolumeSliderElements","volumeSliders","value","Repeater","setRepeat","setRepeatPlaylist","setRepeatSong","Shuffler","setShuffle","shuffleSongs","toggleShuffle","setShufflePlaylist","shufflePlaylistSongs","toggleShufflePlaylist","shuffleTemp","Array","randNum","Math","floor","random","shuffleSwap","shuffleList","original","temp","location","syncMain","mainSongSliders","playlistSongSliders","playlistAttribute","songAttribute","songSliders","songInPlaylistSliders","CurrentTimeElements","resetTimes","CurrentHourElements","CurrentMinuteElements","CurrentSecondElements","syncCurrentTimes","hours","minutes","DurationCountDownTimeElements","DurationHourElements","DurationMinuteElements","DurationSecondElements","DurationTimeElements","syncDurationTimes","songDuration","visualizationElements","Object","keys","runGlobalVisualization","runPlaylistVisualization","runSongVisualization","runSongInPlaylistVisualization","displayBackups","globalVisualizationIndex","visualization","activeSongVisualizationIndex","addToActiveVisualizations","firstVisualization","activePlaylistVisualizationIndex","key","setPreferences","startVisualization","push","stopVisualization","register","preferences","newVisualization","getID","x","displayGlobalBackup","displayPlaylistBackup","displaySongBackup","displaySongInPlaylistBackup","style","backgroundImage","cover_art_url","SoundCloud","tempUserConfig","loadSoundCloud","userConfig","head","getElementsByTagName","script","createElement","type","onreadystatechange","initSoundcloud","onload","appendChild","SC","client_id","getStreamableURLs","soundcloud_regex","match","resolveStreamable","resolveIndividualStreamableURL","addToShuffleList","get","sound","streamable","stream_url","artwork_url","soundcloud_data","AmplitudeHelpers","writeDebugMessage","name","artist","AmplitudeInitializer","setConfig","isSoundCloudURL","PlaybackSpeedElements","playbackSpeedClasses","ShuffleElements","shuffleButtons","songPlayedPercentage","percentage","songPlayedProgressBars","max","Initializer","ready","Events","setArt","Fx","webAudioAPIAvailable","determineUsingAnyFX","configureWebAudioAPI","documentElement","resume","WaveForm","init","object","params","initializeDefaultLiveSettings","initializeDefaultSongIndexes","rebindDisplay","countPlaylists","PlaylistsInitializer","preload","initializeElements","size","hasOwnProperty","buffer","sampleRate","peaks","svg","createElementNS","g","path","build","abs","split","reduce","a","b","charCodeAt","req","XMLHttpRequest","open","responseType","e","readyState","status","decodeAudioData","response","bufferedAudio","getPeaks","process","send","displayWaveForms","totalPeaks","d","peakNumber","shift","sampleSize","sampleStep","numberOfChannels","mergedPeaks","channelNumber","channelData","getChannelData","start","end","min","sampleIndex","waveformElements","displayGlobalWaveform","displayPlaylistWaveform","displaySongWaveform","displaySongInPlaylistWaveform","waveformPath","querySelector","determineIfUsingWaveforms","Time","computeCurrentTimes","currentSeconds","currentMinutes","currentHours","computeSongDuration","songDurationSeconds","songDurationMinutes","songDurationHours","toString","computeSongCompletionPercentage","setCurrentTime","time","isFinite","BufferedProgressElements","songBufferedProgressBars","parseFloat","songBufferedProgressBarsPlaylist","songBufferedProgressBarsSongs","songBufferedProgressBarsSongsInPlaylist","reset","Ended","handle","setTimeout","bindTimeUpdate","bindKeyDownEventHandlers","bindSongEnded","bindProgress","bindPlay","bindPause","bindPlayPause","bindStop","bindMute","bindVolumeUp","bindVolumeDown","bindSongSlider","bindVolumeSlider","bindNext","bindPrev","bindShuffle","bindRepeat","bindRepeatSong","bindPlaybackSpeed","bindSkipTo","bindCanPlayThrough","removeEventListener","TimeUpdate","KeyDown","Progress","play_classes","Play","pause_classes","Pause","play_pause_classes","PlayPause","stop_classes","Stop","mute_classes","Mute","volume_up_classes","VolumeUp","volume_down_classes","VolumeDown","ua","window","msie","song_sliders","SongSlider","volume_sliders","VolumeSlider","next_classes","Next","prev_classes","Prev","shuffle_classes","Shuffle","repeat_classes","Repeat","repeat_song_classes","RepeatSong","playback_speed_classes","PlaybackSpeed","skipToClasses","SkipTo","event","runKeyEvent","which","runPlayPauseKeyDownEvent","runNextKeyDownEvent","runPrevKeyDownEvent","runStopKeyDownEvent","runShuffleKeyDownEvent","runRepeatKeyDownEvent","handleGlobalNext","handlePlaylistNext","songIndexAttribute","handleGlobalPause","handlePlaylistPause","handleSongPause","handleSongInPlaylistPause","handleGlobalPlay","handlePlaylistPlay","handleSongPlay","handleSongInPlaylistPlay","handleGlobalPlayPause","handlePlaylistPlayPause","handleSongPlayPause","handleSongInPlaylistPlayPause","handleGlobalPrev","handlePlaylistPrev","bufferedEnd","handleGlobalRepeat","handlePlaylistRepeat","handleGlobalShuffle","handlePlaylistShuffle","handleSkipToSong","handleSkipToPlaylist","locationPercentage","computedTime","handleGlobalSongSlider","handlePlaylistSongSlider","handleSongSongSlider","handleSongInPlaylistSongSlider","computeBufferedTime","updateTimeInformation","runTimeCallbacks","songCompletionPercentage","time_callbacks","browserContext","AudioContext","webkitAudioContext","mozAudioContext","oAudioContext","msAudioContext","createAnalyser","crossOrigin","createMediaElementSource","connect","destination","Amplitude","getConfig","bindNewElements","getActivePlaylist","getPlaybackSpeed","speed","getRepeat","getRepeatPlaylist","playlistKey","getShuffle","getShufflePlaylist","repeatState","getDefaultAlbumArt","getDefaultPlaylistArt","setDefaultAlbumArt","setDefaultPlaylistArt","default_plalist_art","getSongPlayedPercentage","getSongPlayedSeconds","getSongDuration","setSongPlayedPercentage","setDebug","getActiveSongMetadata","getActivePlaylistMetadata","getSongAtIndex","getSongAtPlaylistIndex","addSong","prependSong","unshift","addSongToPlaylist","addPlaylist","data","ignoredKeys","dataKey","removeSong","splice","removeSongFromPlaylist","playNow","playSongAtIndex","playPlaylistSongAtIndex","getAudio","getAnalyser","next","nextData","prev","prevData","getSongs","getSongsInPlaylist","getSongsState","getSongsStatePlaylist","getActiveIndex","getVersion","getBuffered","skipTo","setSongMetaData","metaData","setPlaylistMetaData","setDelay","getDelay","getPlayerState","registerVisualization","setPlaylistVisualization","visualizationKey","setSongVisualization","setSongInPlaylistVisualization","setGlobalVisualization","getVolume","copySongsToPlaylists","grabSoundCloudData","initializePlaylistActiveIndexes","initializePlaylistShuffleStatuses","initializePlaylistsRepeatStatuses","initializePlaylistShuffleLists","initializeFirstSongInPlaylistMetaData","songContainers","activeIndex","hasAttribute","currentHourSelectors","currentHourPlaylistSelectors","currentHourSongSelectors","currentHourPlaylistSongSelectors","hourSelectors","currentMinuteSelectors","currentMinutePlaylistSelectors","currentMinuteSongSelectors","currentMinutePlaylistSongSelectors","minuteSelectors","currentSecondSelectors","currentSecondPlaylistSelectors","currentSecondSongSelectors","currentSecondPlaylistSongSelectors","secondSelectors","currentTimeSelectors","timeText","timeSelectors","countDownTime","timeRemaining","computeTimeRemaining","durationTimeRemainingSelectors","totalCurrentSeconds","totalDurationSeconds","timeRemainingTotalSeconds","remainingHours","remainingMinutes","remainingSeconds","durationHourSelectors","durationMinuteSelectors","durationSecondSelectors","durationTime","durationText","computeDurationText","durationTimeSelectors"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA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AK,IAAIT,IAAI,CAAb,EAAgBA,IAAIqhB,sBAAsBphB,MAA1C,EAAkDD,GAAlD,EAAuD;AACrDqhB,4BAAsBrhB,CAAtB,EAAyBoE,SAAzB,GAAqC+c,YAArC;AACD;AACF;;AAED;;;AAGA,WAASzZ,UAAT,GAAsB;AACpB,QAAI2Z,wBAAwBvhB,SAASC,gBAAT,CAC1B,0BAD0B,CAA5B;;AAIA,SAAK,IAAIC,IAAI,CAAb,EAAgBA,IAAIqhB,sBAAsBphB,MAA1C,EAAkDD,GAAlD,EAAuD;AACrDqhB,4BAAsBrhB,CAAtB,EAAyBoE,SAAzB,GAAqC,OAArC;AACD;AACF;;AAED;;;;;AAKA,WAASgd,mBAAT,CAA6BF,YAA7B,EAA2C;AACzC,QAAIC,eAAe,OAAnB;;AAEA,QAAI,CAACxd,MAAMud,aAAalZ,OAAnB,CAAD,IAAgC,CAACrE,MAAMud,aAAatiB,OAAnB,CAArC,EAAkE;AAChEuiB,qBAAeD,aAAalZ,OAAb,GAAuB,GAAvB,GAA6BkZ,aAAatiB,OAAzD;AACA,UAAI,CAAC+E,MAAMud,aAAanZ,KAAnB,CAAD,IAA8BmZ,aAAanZ,KAAb,GAAqB,CAAvD,EAA0D;AACxDoZ,uBAAeD,aAAanZ,KAAb,GAAqB,GAArB,GAA2BoZ,YAA1C;AACD;AACF;;AAED,WAAOA,YAAP;AACD;;AAED;;;AAGA,SAAO;AACL5hB,UAAMA,IADD;AAELmI,gBAAYA;AAFP,GAAP;AAID,CArJ0B,EAA3B,C,CAXA;;;;kBAkKeW,oB;;;;;;;AClKf,kBAAkB,mTAAmT,uQAAuQ,gBAAgB,aAAa,6BAA6B,uEAAuE,YAAY,yNAAyN,eAAe,0EAA0E,2IAA2I,4DAA4D,kE","file":"amplitude.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Amplitude\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Amplitude\"] = factory();\n\telse\n\t\troot[\"Amplitude\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 47);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 79d4f9aa69f6e1e680bd","/**\n * These variables make Amplitude run. The config is the most important\n * containing active settings and parameters.\n *\n * The config JSON is the global settings for ALL of Amplitude functions.\n * This is global and contains all of the user preferences. The default\n * settings are set, and the user overwrites them when they initialize\n * Amplitude.\n *\n * @module config\n * @type {object}\n * @property {string} \tconfig.version \t\t\t\t- The current version of AmplitudeJS.\n * @property {object} \tconfig.audio \t\t \t\t\t\t\t\t\t\t-\tHandles all of the audio.\n * @property {object} \tconfig.active_metadata\t\t\t\t\t- Contains the active metadata for the song.\n * @property {string} \tconfig.active_album\t\t\t\t\t\t\t- Holds the active album name. Used to check and see if the album changed and run the album changed callback.\n * @property {number} \tconfig.active_index\t\t\t\t\t\t\t- Contains the index of the actively playing song.\n * @property {string} \tconfig.active_playlist\t\t\t\t\t- Contains the key to the active playlist index.\n * @property {number} \tconfig.playback_speed\t\t\t\t\t\t- Sets the initial playback speed of the song. The values for this can be 1.0, 1.5, 2.0\n * @property {object} \tconfig.callbacks\t\t\t\t\t\t\t\t- The user can pass a JSON object with a key => value store of callbacks to be run at certain events.\n * @property {array} \t\tconfig.songs\t\t\t\t\t\t\t\t\t\t- Contains all of the songs the user has passed to Amplitude to use.\n * @property {object} \tconfig.playlists\t\t\t\t\t\t\t\t- Contains all of the playlists the user created.\n * @property {object} \tconfig.start_song \t\t\t\t\t\t\t- The index of the song that AmplitudeJS should start with.\n * @property {string} \tconfig.starting_playlist \t\t\t\t- The starting playlist the player will intiialize to.\n * @property {string} \tconfig.starting_playlist_song \t- The index of the song in the playlist that should be started.\n * @property {boolean} \tconfig.repeat \t\t\t\t\t\t\t\t\t- When repeat is on, when the song ends the song will replay itself.\n * @property {object} \tconfig.shuffle_list\t\t\t\t\t\t\t- When shuffled, gets populated with the songs the user provided in a random order.\n * @property {boolean} \tconfig.shuffle_on\t\t\t\t\t\t\t\t- When on, gets set to true so when traversing through songs, AmplitudeJS knows whether or not to use the songs object or the shuffle_list\n * @property {string}\t\tconfig.default_album_art \t\t\t\t- The user can set default album art to be displayed if the song they set doesn't contain album art.\n * @property {string} \tconfig.default_playlist_art \t\t- The user can set default playlist art to be displayed if the playlist they are setting meta data for doesn't contain an art picture.\n * @property {boolean} \tconfig.debug\t\t\t\t\t\t\t\t\t\t- When set to true, AmplitudeJS will print to the console any errors providing helpful feedback to the user.\n * @property {number} \tconfig.volume \t\t\t\t\t\t\t\t\t- The user can set the initial volume to a number between 0 and 1 over-riding the default of .5\n * @property {number} \tconfig.pre_mute_volume \t\t\t\t\t- This is set on mute so that when a user un-mutes AmplitudeJS knows what to restore the volume to.\n * @property {number}\t\tconfig.volume_increment \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should increase when the user presses the volume up button.\n * @property {number}\t\tconfig.volume_decrement \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should decrease when the user presses the volume down button.\n * @property {string} \tconfig.soundcloud_client \t\t\t\t- When using SoundCloud, the user will have to provide their API Client ID\n * @property {boolean} \tconfig.soundcloud_use_art \t\t\t- The user can set this to true and AmplitudeJS will use the album art for the song returned from the Soundcloud API\n * @property {number} \tconfig.soundcloud_song_count \t\t- Used on config to count how many songs are from Soundcloud and compare it to how many are ready for when to move to the rest of the configuration\n * @property {number} \tconfig.soundcloud_songs_ready \t- Used on config to count how many songs are ready so when we get all of the data from the SoundCloud API that we need this should match the SoundCloud song count meaning we can move to the rest of the config.\n * @property {integer}\tconfig.is_touch_moving \t\t\t\t\t- Flag for if the user is moving the screen.\n * @property {boolean}\tconfig.buffered\t\t\t\t\t\t\t\t\t- How much of the song is buffered.\n * @property {object} \tconfig.bindings\t\t\t\t\t\t\t\t\t- Array of bindings to certain key events.\n * @property {boolean} \tconfig.continue_next \t\t\t\t\t\t- Determines when a song ends, we should continue to the next song.\n * @property {number} config.delay \t\t\t\t\t\t\t\t\t\t- Sets the delay between songs in MS.\n * @property {boolean} config.use_web_audio_api \t\t\t\t- Flag that determines if the user wants to use Web Audio API Components.\n * @property {boolean} config.web_audio_api_available - Flag that determines if the Web Audio API is available.\n * @property {object} \tconfig.context \t\t\t\t\t\t\t\t\t- Web Audio API Context\n * @property {object}\t\tconfig.source \t\t\t\t\t\t\t\t\t- Web Audio API Source\n * @property {object} \tconfig.analyser \t\t\t\t\t\t\t\t- Web Audio API Analyser\n * @property {string}\t\tconfig.player_state \t\t\t\t\t\t- The current state of the player.\n */\nimport { version } from \"../package.json\";\n\nmodule.exports = {\n version: version,\n\n audio: new Audio(),\n\n active_metadata: {},\n\n active_album: \"\",\n\n active_index: 0,\n\n active_playlist: null,\n\n playback_speed: 1.0,\n\n callbacks: {},\n\n songs: [],\n\n playlists: {},\n\n start_song: \"\",\n\n starting_playlist: \"\",\n\n starting_playlist_song: \"\",\n\n repeat: false,\n\n repeat_song: false,\n\n shuffle_list: {},\n\n shuffle_on: false,\n\n default_album_art: \"\",\n\n default_playlist_art: \"\",\n\n debug: false,\n\n volume: 0.5,\n\n pre_mute_volume: 0.5,\n\n volume_increment: 5,\n\n volume_decrement: 5,\n\n soundcloud_client: \"\",\n\n soundcloud_use_art: false,\n\n soundcloud_song_count: 0,\n\n soundcloud_songs_ready: 0,\n\n is_touch_moving: false,\n\n buffered: 0,\n\n bindings: {},\n\n continue_next: true,\n\n delay: 0,\n\n player_state: \"stopped\",\n\n web_audio_api_available: false,\n\n context: null,\n\n source: null,\n\n analyser: null,\n\n visualizations: {\n available: [],\n\n active: [],\n\n backup: \"\"\n },\n\n waveforms: {\n sample_rate: 100,\n\n built: []\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/config.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Checks module.\n * @module utilities/checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Audio Navigation module.\n * @module utilities/audioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Play/Pause Visual Elements module.\n * @module visual/playPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Meta Data Visual Elements module.\n * @module visual/metaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports AmplitudeJS Callback Utility\n * @module utilities/callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Import the Visualizations from the FX module.\n * @module fx/visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * Import the Config State module.\n * @module utilities/configState\n */\n import ConfigState from \"../utilities/configState.js\";\n\n/**\n * Interacts directly with native functions of the Audio element. Logic\n * leading up to these methods are handled by click handlers which call\n * helpers and visual synchronizers. These are the core functions of AmplitudeJS.\n * Every other function that leads to these prepare the information to be\n * acted upon by these functions.\n *\n * @module core/Core\n */\nlet Core = (function() {\n /**\n * Plays the active song. If the current song is live, it reconnects\n * the stream before playing.\n *\n * Public Accessor: Amplitude.play()\n *\n * @access public\n */\n function play() {\n Visualizations.stop();\n Visualizations.run();\n\n /*\n\t\t\tIf the audio is live we re-conenct the stream.\n\t\t*/\n if (config.active_metadata.live) {\n reconnectStream();\n }\n\n /*\n\t\t\tMobile remote sources need to be reconnected on play. I think this is\n\t\t\tbecause mobile browsers are optimized not to load all resources\n\t\t\tfor speed reasons. We only do this if mobile and the paused button\n\t\t\tis not clicked. If the pause button was clicked then we don't reconnect\n\t\t\tor the user will lose their place in the stream.\n\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n ) &&\n !config.paused\n ) {\n reconnectStream();\n }\n\n /*\n\t\t\tPlay the song and set the playback rate to the playback\n\t\t\tspeed.\n */\n let playPromise = config.audio.play();\n\n if (playPromise !== undefined) {\n playPromise.then(_ => {}).catch(error => {});\n }\n config.audio.play();\n config.audio.playbackRate = config.playback_speed;\n \n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n }\n\n /**\n * Pauses the active song. If it's live, it disconnects the stream.\n *\n * Public Accessor: Amplitude.pause()\n *\n * @access public\n */\n function pause() {\n Visualizations.stop();\n\n /*\n\t\t\tPause the active song.\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tFlag that pause button was clicked.\n\t\t*/\n config.paused = true;\n \n \n /*\n\t\t\tIf the song is live, we disconnect the stream so we aren't\n\t\t\tsaving it to memory.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n \n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n }\n\n /**\n * Stops the active song by setting the current song time to 0.\n * When the user resumes, it will be from the beginning.\n * If it's a live stream it disconnects.\n *\n * Public Accessor: Amplitude.stop()\n *\n * @access public\n */\n function stop() {\n Visualizations.stop();\n\n /*\n\t\t\tSet the current time of the song to 0 which will reset the song.\n\t\t*/\n if (config.audio.currentTime != 0) {\n config.audio.currentTime = 0;\n }\n\n /*\n\t\t\tRun pause so the song will stop\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tIf the song is live, disconnect the stream.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n\n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n \n /*\n\t\t\tRun the stop callback\n\t\t*/\n Callbacks.run(\"stop\");\n }\n\n /**\n * Sets the song volume.\n *\n * Public Accessor: Amplitude.setVolume( volumeLevel )\n *\n * @access public\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume(volumeLevel) {\n /*\n\t\t\tIf the volume is set to mute somewhere else, we sync the display.\n\t\t*/\n if (volumeLevel == 0) {\n config.audio.muted = true;\n } else {\n config.audio.muted = false;\n }\n\n /*\n\t\t\tSets the volume in the config so we can reference it later on.\n\t\t*/\n config.volume = volumeLevel;\n\n /*\n\t\t\tSet the volume of the active song.\n\t\t*/\n config.audio.volume = volumeLevel / 100;\n }\n\n /**\n * Sets the song percentage. If it's a live song, we ignore this because\n * we can't skip ahead. This is an issue if you have a playlist with\n * a live source.\n *\n * Public Accessor: Amplitude.setSongLocation( songPercentage )\n *\n * @access public\n * @param {number} songPercentage - A number between 1 and 100 as a percentage of song completion.\n */\n function setSongLocation(songPercentage) {\n /*\n\t\t\tAs long as the song is not live, we can set the current time of the\n\t\t\tsong to the percentage the user passed in.\n\t\t*/\n if (!config.active_metadata.live) {\n config.audio.currentTime = config.audio.duration * (songPercentage / 100);\n }\n }\n\n /**\n * Skips to a location in a song\n *\n * Public Accessor: Amplitude.skipToLocation( seconds )\n *\n * @access public\n * @param {number} seconds - An integer containing the seconds to skip to\n */\n function skipToLocation(seconds) {\n /*\n\t\t\tWhen the active song can be played through, we can check to\n\t\t\tsee if the seconds will work. We only bind the event handler\n\t\t\tonce and remove it once it's fired.\n\t\t*/\n config.audio.addEventListener(\n \"canplaythrough\",\n function() {\n /*\n\t\t\t\tIf the active song duration is greater than or equal to the\n\t\t\t\tamount of seconds the user wants to skip to and the seconds\n\t\t\t\tis greater than 0, we skip to the seconds defined.\n\t\t\t*/\n if (config.audio.duration >= seconds && seconds > 0) {\n config.audio.currentTime = seconds;\n } else {\n Debug.writeMessage(\n \"Amplitude can't skip to a location greater than the duration of the audio or less than 0\"\n );\n }\n },\n { once: true }\n );\n }\n\n /**\n * Disconnects the live stream\n *\n * Public Accessor: Amplitude.disconnectStream()\n *\n * @access public\n */\n function disconnectStream() {\n config.audio.src = \"\";\n config.audio.load();\n }\n\n /**\n * Reconnects the live stream\n *\n * Public Accessor: Amplitude.reconnectStream()\n *\n * @access public\\\n */\n function reconnectStream() {\n config.audio.src = config.active_metadata.url;\n config.audio.load();\n }\n\n /**\n * Sets the playback speed for the song.\n *\n * @param {number} playbackSpeed The speed we want the song to play back at.\n */\n function setPlaybackSpeed(playbackSpeed) {\n /*\n\t\t\tSet the config playback speed.\n\t\t*/\n config.playback_speed = playbackSpeed;\n\n /*\n\t\t\tSet the active song playback rate.\n\t\t*/\n config.audio.playbackRate = config.playback_speed;\n }\n\n /*\n\t\tReturn publically facing functions\n\t*/\n return {\n play: play,\n pause: pause,\n stop: stop,\n setVolume: setVolume,\n setSongLocation: setSongLocation,\n skipToLocation: skipToLocation,\n disconnectStream: disconnectStream,\n reconnectStream: reconnectStream,\n setPlaybackSpeed: setPlaybackSpeed\n };\n})();\n\nexport default Core;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/core.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nlet PlayPauseElements = (function() {\n /**\n * Syncs all play pause elements.\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Syncs the global play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncGlobal() {\n /*\n Get the active song state.\n */\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all play pause buttons.\n */\n const playPauseElements = document.querySelectorAll(\n \".amplitude-play-pause\"\n );\n\n /*\n Iterate over all of the play pause elements syncing the\n display visually.\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = playPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = playPauseElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the main playlist play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the main playlist play pause elements\n */\n const playlistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over the play pause elements, syncing the state accordingly.\n */\n for (let i = 0; i < playlistPlayPauseElements.length; i++) {\n /*\n Grab the song attributes from the element.\n */\n let song = playlistPlayPauseElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n We want only the play pause elements for the main on a\n playlist nothing else. We have another method for the\n song in playlist play pause method.\n */\n if (song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playlistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playlistPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncSong() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index that matches the active index attribute.\n */\n let songPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n Iterate over all of the song play pause elements\n */\n for (let i = 0; i < songPlayPauseElements.length; i++) {\n /*\n Grab the playlist attributes from the element.\n */\n let playlist = songPlayPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n We want only the song play pause buttons, not ones scoped in a playlist.\n */\n if (playlist == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist play pause buttons to the state of\n * the active song.\n *\n * @access public\n */\n function syncSongInPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index attribute. Some have amplitude-playlist which\n means they are individual songs within a playlist.\n */\n let songInPlaylistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over all of the individual play pause elements for songs inspect\n a playlist.\n */\n for (let i = 0; i < songInPlaylistPlayPauseElements.length; i++) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songInPlaylistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songInPlaylistPlayPauseElements[i]);\n break;\n }\n }\n }\n\n /**\n * Sets all of the play pause buttons to paused.\n *\n * @access public\n */\n function syncToPause() {\n /*\n Gets all of the play pause elements\n */\n let playPauseElements = document.querySelectorAll(\".amplitude-play-pause\");\n\n /*\n Sets all of the elements to pause\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n setElementPause(playPauseElements[i]);\n }\n }\n\n /**\n * Sets an element to be playing by removing the 'amplitude-paused' class\n * and adding the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the playing class added.\n */\n function setElementPlay(element) {\n element.classList.add(\"amplitude-playing\");\n element.classList.remove(\"amplitude-paused\");\n }\n\n /**\n * Sets an element to be paused by adding the 'amplitude-paused' class\n * and removing the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the paused class added.\n */\n function setElementPause(element) {\n element.classList.remove(\"amplitude-playing\");\n element.classList.add(\"amplitude-paused\");\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncGlobal: syncGlobal,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n syncToPause: syncToPause\n };\n})();\n\nexport default PlayPauseElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playPauseElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Core Module\n *\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Callbacks Module\n *\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Checks Module\n *\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Play Pause Elements Module\n *\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Song Slider Elements Module\n *\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements Module\n *\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time Elements Module\n *\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Meta Data Elements Module\n *\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Container Elements Module\n *\n * @module visual/ContainerElements\n */\nimport ContainerElements from \"../visual/containerElements.js\";\n\n/**\n * AmplitudeJS Audio Navigation Utility.\n *\n * @module utilities/AudioNavigation\n */\nlet AudioNavigation = (function() {\n /**\n * Sets the next song\n *\n * @access public\n * @param {boolean} [songEnded=false] If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNext(songEnded = false) {\n /*\n Initializes the next index variable. This will be the\n index of the song that is next.\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n Determines if we are repeating the song or not. If we are repeating,\n the next song will be the same song index.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n nextIndex = config.shuffle_list[config.active_index].index;\n nextSong = config.shuffle_list[nextIndex];\n } else {\n nextIndex = config.active_index;\n nextSong = config.songs[nextIndex];\n }\n } else {\n /*\n If the shuffle is on, we use the shuffled list of\n songs to determine our next song.\n */\n if (config.shuffle_on) {\n /*\n If the active shuffle index + 1 is less than the length, then\n we use the next shuffle otherwise we go to the beginning\n of the shuffle list.\n */\n if (parseInt(config.active_index) + 1 < config.shuffle_list.length) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = parseInt(config.active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n nextSong = config.shuffle_list[nextIndex];\n } else {\n /*\n If the active index + 1 is less than the length of the songs, then\n we use the next song otherwise we go to the beginning of the\n song list.\n */\n if (parseInt(config.active_index) + 1 < config.songs.length) {\n nextIndex = parseInt(config.active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next index.\n */\n nextSong = config.songs[nextIndex];\n }\n }\n\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(nextSong, nextIndex);\n\n /*\n \t\tIf it's the end of the list and repeat is not on, do nothing.\n \t*/\n if (endOfList && !config.repeat) {\n } else {\n /*\n \t\t\tIf the song has ended and repeat is on, play the song.\n \t\t*/\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the next song in a playlist\n *\n * @param {string} playlist - The playlist being shuffled\n * @param {boolean} [songEnded=false] - If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNextPlaylist(playlist, songEnded = false) {\n /*\n Initializes the next index\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n } else {\n /*\n If the playlist is shuffled we get the next index of the playlist.\n */\n if (config.playlists[playlist].shuffle) {\n /*\n If the active shuffle index + 1 is less than the length of the shuffle list,\n then we use the next shuffle otherwise we go to the beginning of the shuffle list.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].shuffle_list.length\n ) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = config.playlists[playlist].active_index + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n /*\n If the active index +1 is less than the length of the songs in the playlist,\n then we use the next song otherwise we go to the beginning of the playlist.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].songs.length\n ) {\n nextIndex = parseInt(config.playlists[playlist].active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next song.\n */\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, nextSong, nextIndex);\n\n /*\n If it's the end of the playlist and we aren't repeating, do nothing.\n */\n if (endOfList && !config.repeat) {\n } else {\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous song on the global songs array.\n *\n * @access private\n */\n function setPrevious() {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the config is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n previousIndex = config.active_index;\n previousSong = config.shuffle_list[previousIndex];\n } else {\n previousIndex = config.active_index;\n previousSong = config.songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.active_index) - 1 >= 0) {\n previousIndex = parseInt(config.active_index - 1);\n } else {\n previousIndex = parseInt(config.songs.length - 1);\n }\n\n /*\n If the config is shuffled, we grab the song from the shuffle list\n */\n if (config.shuffle_on) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.songs[previousIndex];\n }\n }\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(previousSong, previousIndex);\n\n /*\n Play the newest song.\n */\n Core.play();\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous playlist song.\n *\n * @access private\n *\n * @prop {string} playlist - The playlist we are navigating in.\n */\n function setPreviousPlaylist(playlist) {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.playlists[playlist].active_index) - 1 >= 0) {\n previousIndex = parseInt(config.playlists[playlist].active_index - 1);\n } else {\n previousIndex = parseInt(config.playlists[playlist].songs.length - 1);\n }\n\n /*\n If the playlist is shuffled, we grab the song from the shuffle list\n */\n if (config.playlists[playlist].shuffle) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, previousSong, previousIndex);\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Change song in the songs array.\n *\n * @access private\n * @prop {object} song - The song we are changing to.\n * @prop {number} index - The index we are changing to.\n * @prop {boolean} direct - Determines if it was a direct click on the song.\n * We then don't care if shuffle is on or not.\n */\n function changeSong(song, index, direct = false) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n\n config.active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange(direct);\n }\n\n /**\n * Handles a song change in the playlist\n *\n * @access private\n * @prop {string} playlist - The playlist we are changing the song on.\n * @prop {object} song - The song we are changing to in the playlist.\n * @prop {number} index - The inded of the song we are changing to in the playlist.\n * @prop {boolean} direct - Determines if it was a direct click on the song. We\n * then don't care if shuffle is on or not\n */\n function changeSongPlaylist(playlist, song, index, direct = false) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n config.active_index = null;\n\n config.playlists[playlist].active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange(direct);\n }\n\n /**\n * Prepares a song change\n *\n * @access private\n * @prop {object} song - The song we change to.\n */\n function prepareSongChange(song) {\n /*\n Stop the current song.\n */\n Core.stop();\n\n /*\n Sync all of the elements to a stopped song.\n */\n PlayPauseElements.syncToPause();\n SongSliderElements.resetElements();\n SongPlayedProgressElements.resetElements();\n TimeElements.resetCurrentTimes();\n\n /*\n If an album changes, fire an album change.\n */\n if (Checks.newAlbum(song)) {\n Callbacks.run(\"album_change\");\n }\n }\n\n /**\n * Updates data on the display after a song has changed.\n *\n * @prop {boolean} direct - Determines if it was a direct click on the song.\n * We then don't care if shuffle is on or not.\n *\n * @access private\n */\n function afterSongChange(direct) {\n MetaDataElements.displayMetaData();\n ContainerElements.setActive(direct);\n TimeElements.resetDurationTimes();\n\n /*\n Run the song change callback.\n */\n Callbacks.run(\"song_change\");\n }\n\n /**\n * Sets the active playlist\n *\n * @access public\n * @param {string} playlist - The string of the playlist being set to active.\n */\n function setActivePlaylist(playlist) {\n /*\n If the active playlist is different than the playlist being set,\n we run the `playlist_changed` callback.\n */\n if (config.active_playlist != playlist) {\n Callbacks.run(\"playlist_changed\");\n /*\n Set the active playlist to the playlist parameter. Only need to\n set if it's different.\n */\n config.active_playlist = playlist;\n\n if (playlist != null) {\n config.playlists[playlist].active_index = 0;\n }\n }\n }\n\n /*\n Return the publically facing methods\n */\n return {\n setNext: setNext,\n setNextPlaylist: setNextPlaylist,\n setPrevious: setPrevious,\n setPreviousPlaylist: setPreviousPlaylist,\n changeSong: changeSong,\n changeSongPlaylist: changeSongPlaylist,\n setActivePlaylist: setActivePlaylist\n };\n})();\n\nexport default AudioNavigation;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/audioNavigation.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the debugging of AmplitudeJS\n * @module utilities/Debug\n */\nlet Debug = (function() {\n /**\n * Writes out debug message to the console if enabled.\n *\n * Public Accessor: Debug.writeMessage( message )\n *\n * @access public\n * @param {string} message - The string that gets printed to alert the user of a debugging error.\n */\n function writeMessage(message) {\n /*\n If the user has flagged AmplitudeJS to debug, we print out a message\n to the console.\n */\n if (config.debug) {\n console.log(message);\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n writeMessage: writeMessage\n };\n})();\n\nexport default Debug;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/debug.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Checks Module. Checks for new songs, albums, and playlists\n *\n * @module utilities/Checks\n */\nlet Checks = (function() {\n /**\n * Checks to see if the new song to be played is different than the song\n * that is currently playing. To be true, the user would have selected\n * play on a new song with a new index. To be false, the user would have\n * clicked play/pause on the song that was playing.\n *\n * Public Accessor: Checks.newSong( playlist, songIndex )\n * @access public\n * @param {string} playlist - The playlist we are checking the new song for. Could be null\n * @param {number} songIndex - The index of the new song to be played.\n * @returns {boolean} True if we are setting a new song, false if we are not setting a new song.\n */\n function newSong(playlist, songIndex) {\n /*\n If the playlists don't match, then it's definitely a new song.\n */\n if (config.active_playlist != playlist) {\n return true;\n } else {\n /*\n If we aren't in a playlist, we check the active index.\n */\n if (config.active_playlist == null && playlist == null) {\n /*\n If the active indexes don't match, then it's a new song.\n */\n if (config.active_index != songIndex) {\n return true;\n } else {\n return false;\n }\n } else {\n /*\n If we are in a playlist, then we check to see if the\n new song index matches the active index.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index != songIndex\n ) {\n return true;\n } else {\n return false;\n }\n }\n }\n }\n\n /**\n * Checks to see if there is a new album\n *\n * Public Accessor: Checks.newAlbum( album )\n *\n * @access public\n * @param {string} album - Checks to see if the new song will have a new album.\n * @returns {boolean} True if there is a new album, false if there is not a new ablum.\n */\n function newAlbum(album) {\n if (config.active_album != album) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Checks to see if there is a new playlist\n *\n * Public Accessor: Checks.newPlaylist( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist passed in to check against the active playlist.\n * @returns {boolean} True if there is a new playlist, false if there is not a new playlist.\n */\n function newPlaylist(playlist) {\n if (config.active_playlist != playlist) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Determines if the string passed in is a URL or not\n *\n * Public Accessor: AmplitudeHelpers.isURL( url )\n *\n * @access public\n * @param {string} url - The string we are testing to see if it's a URL.\n * @returns {boolean} True if the string is a url, false if it is not.\n */\n function isURL(url) {\n /*\n\t\t\tTest the string against the URL pattern and return if it matches\n\t\t*/\n let pattern = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\n\n return pattern.test(url);\n }\n\n /**\n * Determines if what is passed in is an integer or not.\n *\n * Public Accessor: AmplitudeHelpers.isInt( int )\n *\n * @access public\n * @param {string|number} int - The variable we are testing to see is an integer or not.\n * @returns {boolean} If the variable is an integer or not.\n */\n function isInt(int) {\n return (\n !isNaN(int) && parseInt(Number(int)) == int && !isNaN(parseInt(int, 10))\n );\n }\n\n /**\n * Returns public facing methods\n */\n return {\n newSong: newSong,\n newAlbum: newAlbum,\n newPlaylist: newPlaylist,\n isURL: isURL,\n isInt: isInt\n };\n})();\n\nexport default Checks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/checks.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the state of the config object.\n *\n * @module utilities/ConfigState\n */\nlet ConfigState = (function() {\n /**\n * Resets the config to the default state. This is called on initialize\n * to ensure the user's config is what matters.\n *\n * Public Accessor: AmplitudeHelpers.resetConfig()\n *\n * @access public\n */\n function resetConfig() {\n config.audio = new Audio();\n config.active_metadata = {};\n config.active_album = \"\";\n config.active_index = 0;\n config.active_playlist = null;\n config.playback_speed = 1.0;\n config.callbacks = {};\n config.songs = [];\n config.playlists = {};\n config.start_song = \"\";\n config.starting_playlist = \"\";\n config.starting_playlist_song = \"\";\n config.repeat = false;\n config.shuffle_list = {};\n config.shuffle_on = false;\n config.default_album_art = \"\";\n config.default_playlist_art = \"\";\n config.debug = false;\n config.volume = 0.5;\n config.pre_mute_volume = 0.5;\n config.volume_increment = 5;\n config.volume_decrement = 5;\n config.soundcloud_client = \"\";\n config.soundcloud_use_art = false;\n config.soundcloud_song_count = 0;\n config.soundcloud_songs_ready = 0;\n config.continue_next = true;\n }\n\n /**\n * Sets the state of the player.\n */\n function setPlayerState() {\n /*\n If paused and the current time is 0 the player is stopped.\n */\n if (config.audio.paused && config.audio.currentTime == 0) {\n config.player_state = \"stopped\";\n }\n\n /*\n If paused and the current time is greater than 0 the player is\n paused.\n */\n if (config.audio.paused && config.audio.currentTime > 0) {\n config.player_state = \"paused\";\n }\n\n /*\n If playing, the current state is playing.\n */\n if (!config.audio.paused) {\n config.player_state = \"playing\";\n }\n }\n\n /*\n\t\tReturns the public facing methods\n\t*/\n return {\n resetConfig: resetConfig,\n setPlayerState: setPlayerState\n };\n})();\n\nexport default ConfigState;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/configState.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * These methods help display the audio's meta data\n *\n * @module visual/MetaDataElements\n */\nlet MetaDataElements = (function() {\n /**\n * Displays the active song's metadata. This is called after a song has\n * been changed. This method takes the active song and displays the\n * metadata. So once the new active song is set, we update all of the\n * screen elements.\n *\n * @access public\n */\n function displayMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t\tGet all of the song info elements\n\t\t*/\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t\tIterate over all of the song info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n\t\t\t\tGrab the playlist and song index.\n\t\t\t*/\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tEnsure that we don't set any individual elements now. We set this with the\n\t\t\t\tsync meta data method. The reason we don't set them here is because\n\t\t\t\tall individual songs would get the now playing artwork. If the playlists\n\t\t\t\tmatch or the element is a main element meaning it doesn't\n\t\t\t\tbelong to a playlist or a song, then we set the song info.\n\t\t\t*/\n if (\n songIndex == null &&\n (config.active_playlist == playlist ||\n (playlist == null && songIndex == null))\n ) {\n /*\n\t\t\t\t\tIf the active metadata has the key, then we set it,\n\t\t\t\t\totherwise we clear it. If it's an image element then\n\t\t\t\t\twe default it to the default info if needed.\n\t\t\t\t*/\n let val = (config.active_metadata[info] != undefined) ? config.active_metadata[info] : null;\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n val = val || \"\"\n songInfoElements[i].innerHTML = val;\n }\n }\n }\n }\n\n /**\n * Displays the playlist meta data.\n */\n function displayPlaylistMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\"image_url\"];\n\n /*\n\t\t\tGet all of the playlist info elements\n\t\t*/\n let playlistInfoElements = document.querySelectorAll(\n \"[data-amplitude-playlist-info]\"\n );\n\n /*\n\t\t\tIterate over all of the playlist info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < playlistInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist-info\"\n );\n let playlist = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (config.playlists[playlist][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist][info]\n );\n } else {\n playlistInfoElements[i].innerHTML = config.playlists[playlist][info];\n }\n } else {\n /*\n\t\t\t\t\tWe look for the default album art because\n\t\t\t\t\tthe actual key didn't exist. If the default album\n\t\t\t\t\tart doesn't exist then we set the src attribute\n\t\t\t\t\tto null.\n\t\t\t\t*/\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (config.default_playlist_art != \"\") {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.default_playlist_art\n );\n } else {\n playlistInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n playlistInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n\n /**\n * Sets the first song in the playlist. This is used to fill in the meta\n * data in the playlist\n *\n * @param {object} song \t\t\t- The song we are setting to be the first song in the playlist\n * @param {string} playlist \t- Key of the playlist we are setting the first song in\n */\n function setFirstSongInPlaylist(song, playlist) {\n /*\n Define the image meta data keys. These are managed separately\n since we aren't actually changing the inner HTML of these elements.\n */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n Get all of the song info elements\n */\n let songInfoElements = document.querySelectorAll(\n '[data-amplitude-song-info][data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n Iterate over all of the song info elements. We will either\n set these to the new values, or clear them if the active song\n doesn't have the info set.\n */\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n Get the info so we can check if the active meta data has the\n key.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info element playlist.\n */\n let elementPlaylist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n If the playlists match or the element is a main element, then\n we set the song info.\n */\n if (elementPlaylist == playlist) {\n /*\n If the active metadata has the key, then we set it,\n otherwise we clear it. If it's an image element then\n we default it to the default info if needed.\n */\n if (song[info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\"src\", song[info]);\n } else {\n songInfoElements[i].innerHTML = song[info];\n }\n } else {\n /*\n We look for the default album art because\n the actual key didn't exist. If the default album\n art doesn't exist then we set the src attribute\n to null.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (song.default_album_art != \"\") {\n songInfoElements[i].setAttribute(\"src\", song.default_album_art);\n } else {\n songInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n songInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n }\n\n /**\n * Sets the meta data for songs loaded in the songs array\n */\n function syncMetaData() {\n /*\n\t\t Define the image meta data keys. These are managed separately\n\t\t since we aren't actually changing the inner HTML of these elements.\n\t */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t Get all of the song info elements\n\t */\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t Iterate over all of the song info elements. We will either\n\t\t set these to the new values, or clear them if the active song\n\t\t doesn't have the info set.\n\t */\n for (let i = 0; i < songInfoElements.length; i++) {\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (songIndex != null && playlist == null) {\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info value referenced on the element. Depending on the type of\n element, we may need to fallback to another value when the direct value\n we want isn't found.\n i.e.\n data-amplitude-song-info=\"cover_art_url\" defaults to using the value\n of \"default_album_art\" when \"cover_art_url\" is missing on the song.\n */\n let val = config.songs[songIndex][info] != undefined ? config.songs[songIndex][info] : null;\n /*\n If it's an image meta data key, then we set the src attribute of\n the element. Otherwise we set the inner HTML of the element.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n /*\n If this is an image meta data key and the individual song doesn't\n have the key, use the default_album_art\n */\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n songInfoElements[i].innerHTML = val;\n }\n }\n\n /*\n If the song index and playlist are not null, continue.\n */\n if (songIndex != null && playlist != null) {\n /*\n Get the info we are displaying.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Set the meta data accordingly.\n */\n if (config.playlists[playlist].songs[songIndex][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist].songs[songIndex][info]\n );\n } else {\n songInfoElements[i].innerHTML =\n config.playlists[playlist].songs[songIndex][info];\n }\n }\n }\n }\n\n /*\n Display the playlist meta data.\n */\n displayPlaylistMetaData();\n }\n\n /**\n * Returns publically facing methods\n */\n return {\n displayMetaData: displayMetaData,\n setFirstSongInPlaylist: setFirstSongInPlaylist,\n syncMetaData: syncMetaData,\n displayPlaylistMetaData: displayPlaylistMetaData\n };\n})();\n\nexport default MetaDataElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/metaDataElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the visual syncing to the state of the config for the repeat\n * elements.\n *\n * @module visual/RepeatElements\n */\nlet RepeatElements = (function() {\n /**\n * Syncs repeat for all of the repeat buttons. Users\n * can apply styles to the 'amplitude-repeat-on' and\n * 'amplitude-repeat-off' classes. They represent the state\n * of the player.\n */\n function syncRepeat() {\n /*\n\t\t\tGets all of the repeat classes\n\t\t*/\n let repeatClasses = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterate over all of the repeat classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-on' class and remove the\n\t\t\t'amplitude-repeat-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatClasses.length; i++) {\n if (config.repeat) {\n repeatClasses[i].classList.add(\"amplitude-repeat-on\");\n repeatClasses[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatClasses[i].classList.remove(\"amplitude-repeat-on\");\n repeatClasses[i].classList.add(\"amplitude-repeat-off\");\n }\n }\n }\n\n /**\n * Syncs repeat for all of the playlist repeat buttons. Users\n * can apply styles to the `amplitude-repeat-on` and `amplitude-repeat-off`\n * classes. They repreent the state of the playlist in the player.\n */\n function syncRepeatPlaylist(playlist) {\n /*\n\t\t\t Gets all of the repeat buttons.\n\t\t */\n let repeatButtons = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\t Iterate over all of the repeat buttons\n\t\t */\n for (let i = 0; i < repeatButtons.length; i++) {\n /*\n\t\t\t\t Ensure that the repeat button belongs to matches the\n\t\t\t\t playlist we are syncing the state for.\n\t\t\t */\n if (\n repeatButtons[i].getAttribute(\"data-amplitude-playlist\") == playlist\n ) {\n /*\n\t\t\t\t\t If the state of the playlist is shuffled on, true, then\n\t\t\t\t\t we add the 'amplitude-repeat-on' class and remove the\n\t\t\t\t\t 'amplitude-repeat-off' class. If the player is not shuffled\n\t\t\t\t\t then we do the opposite.\n\t\t\t\t */\n if (config.playlists[playlist].repeat) {\n repeatButtons[i].classList.add(\"amplitude-repeat-on\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatButtons[i].classList.add(\"amplitude-repeat-off\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-on\");\n }\n }\n }\n }\n\n /**\n * Syncs repeat for all of the repeat song buttons. Users\n * can apply styles to the 'amplitude-repeat-song-on' and\n * 'amplitude-repeat-song-off' classes. They represent the state\n * of the player.\n */\n function syncRepeatSong() {\n /*\n\t\t\tGets all of the repeat song classes\n\t\t*/\n let repeatSongClasses = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterate over all of the repeat song classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-song-on' class and remove the\n\t\t\t'amplitude-repeat-song-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatSongClasses.length; i++) {\n if (config.repeat_song) {\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-off\");\n } else {\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-off\");\n }\n }\n }\n\n /*\n Returns the publically available methods.\n */\n return {\n syncRepeat: syncRepeat,\n syncRepeatPlaylist: syncRepeatPlaylist,\n syncRepeatSong: syncRepeatSong\n };\n})();\n\nexport default RepeatElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/repeatElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/debug\n */\nimport Debug from \"./debug.js\";\n\n/**\n * AmplitudeJS Callback Utility\n *\n * @module utilities/callbacks\n */\nlet Callbacks = (function() {\n /**\n * Initializes the callbacks for the player.\n */\n function initialize() {\n /*\n Event: abort\n https://www.w3schools.com/tags/av_event_abort.asp\n */\n config.audio.addEventListener(\"abort\", function() {\n run(\"abort\");\n });\n\n /*\n Event: error\n https://www.w3schools.com/tags/av_event_error.asp\n */\n config.audio.addEventListener(\"error\", function() {\n run(\"error\");\n });\n\n /*\n Event: loadeddata\n https://www.w3schools.com/tags/av_event_loadeddata.asp\n */\n config.audio.addEventListener(\"loadeddata\", function() {\n run(\"loadeddata\");\n });\n\n /*\n Event: loadedmetadata\n https://www.w3schools.com/tags/av_event_loadedmetadata.asp\n */\n config.audio.addEventListener(\"loadedmetadata\", function() {\n run(\"loadedmetadata\");\n });\n\n /*\n Event: loadstart\n https://www.w3schools.com/tags/av_event_loadstart.asp\n */\n config.audio.addEventListener(\"loadstart\", function() {\n run(\"loadstart\");\n });\n\n /*\n Event: pause\n https://www.w3schools.com/tags/av_event_pause.asp\n */\n config.audio.addEventListener(\"pause\", function() {\n run(\"pause\");\n });\n\n /*\n Event: playing\n https://www.w3schools.com/tags/av_event_playing.asp\n */\n config.audio.addEventListener(\"playing\", function() {\n run(\"playing\");\n });\n\n /*\n Event: play\n https://www.w3schools.com/tags/av_event_play.asp\n */\n config.audio.addEventListener(\"play\", function() {\n run(\"play\");\n });\n\n /*\n Event: progress\n https://www.w3schools.com/tags/av_event_progress.asp\n */\n config.audio.addEventListener(\"progress\", function() {\n run(\"progress\");\n });\n\n /*\n Event: ratechange\n https://www.w3schools.com/tags/av_event_ratechange.asp\n */\n config.audio.addEventListener(\"ratechange\", function() {\n run(\"ratechange\");\n });\n\n /*\n Event: seeked\n https://www.w3schools.com/tags/av_event_seeked.asp\n */\n config.audio.addEventListener(\"seeked\", function() {\n run(\"seeked\");\n });\n\n /*\n Event: seeking\n https://www.w3schools.com/tags/av_event_seeking.asp\n */\n config.audio.addEventListener(\"seeking\", function() {\n run(\"seeking\");\n });\n\n /*\n Event: stalled\n https://www.w3schools.com/tags/av_event_stalled.asp\n */\n config.audio.addEventListener(\"stalled\", function() {\n run(\"stalled\");\n });\n\n /*\n Event: suspend\n https://www.w3schools.com/tags/av_event_suspend.asp\n */\n config.audio.addEventListener(\"suspend\", function() {\n run(\"suspend\");\n });\n\n /*\n Event: timeupdate\n https://www.w3schools.com/tags/av_event_timeupdate.asp\n */\n config.audio.addEventListener(\"timeupdate\", function() {\n run(\"timeupdate\");\n });\n\n /*\n Event: volumechange\n https://www.w3schools.com/tags/av_event_volumechange.asp\n */\n config.audio.addEventListener(\"volumechange\", function() {\n run(\"volumechange\");\n });\n\n /*\n Event: waiting\n https://www.w3schools.com/tags/av_event_waiting.asp\n */\n config.audio.addEventListener(\"waiting\", function() {\n run(\"waiting\");\n });\n\n /*\n Event: canplay\n https://www.w3schools.com/tags/av_event_canplay.asp\n */\n config.audio.addEventListener(\"canplay\", function() {\n run(\"canplay\");\n });\n\n /*\n Event: canplaythrough\n https://www.w3schools.com/tags/av_event_canplaythrough.asp\n */\n config.audio.addEventListener(\"canplaythrough\", function() {\n run(\"canplaythrough\");\n });\n\n /*\n Event: durationchange\n https://www.w3schools.com/tags/av_event_durationchange.asp\n */\n config.audio.addEventListener(\"durationchange\", function() {\n run(\"durationchange\");\n });\n\n /*\n Event: ended\n https://www.w3schools.com/tags/av_event_ended.asp\n */\n config.audio.addEventListener(\"ended\", function() {\n run(\"ended\");\n });\n }\n\n /**\n * Runs a user defined callback method\n *\n * Public Accessor: Callbacks.run( callbackName )\n *\n * @access public\n * @param {string} callbackName - The name of the callback we are going to run.\n */\n function run(callbackName) {\n /*\n Checks to see if a user defined a callback method for the\n callback we are running.\n */\n if (config.callbacks[callbackName]) {\n /*\n Build the callback function\n */\n let callbackFunction = config.callbacks[callbackName];\n\n /*\n Write a debug message stating the callback we are running\n */\n Debug.writeMessage(\"Running Callback: \" + callbackName);\n\n /*\n Run the callback function and catch any errors\n */\n try {\n callbackFunction();\n } catch (error) {\n if (error.message == \"CANCEL EVENT\") {\n throw error;\n } else {\n Debug.writeMessage(\"Callback error: \" + error.message);\n }\n }\n }\n }\n\n return {\n initialize: initialize,\n run: run\n };\n})();\n\nexport default Callbacks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/callbacks.js","/**\n * Handles the visual state for all of the mute elements.\n *\n * @module visual/MuteElements\n */\nlet MuteElements = (function() {\n /**\n * Syncs mute for all of the mute buttons. This represents the\n * state of the player if it's muted or not.\n *\n * @access public\n * @param {string} state \t- The muted state of the player.\n */\n function setMuted(state) {\n /*\n\t\t\tGet all of the mute buttons.\n\t\t*/\n let muteClasses = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterate over all of the mute classes. If the state of the player\n\t\t\tis not-muted then we add the amplitude-not-muted classe and remove\n\t\t\tthe amplitude muted class otherwise we do the opposite.\n\t\t*/\n for (let i = 0; i < muteClasses.length; i++) {\n if (!state) {\n muteClasses[i].classList.add(\"amplitude-not-muted\");\n muteClasses[i].classList.remove(\"amplitude-muted\");\n } else {\n muteClasses[i].classList.remove(\"amplitude-not-muted\");\n muteClasses[i].classList.add(\"amplitude-muted\");\n }\n }\n }\n\n return {\n setMuted: setMuted\n };\n})();\n\nexport default MuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/muteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Keeps the volume slider elements in sync.\n * @module visual/VolumeSliderElements\n */\nlet VolumeSliderElements = (function() {\n /**\n * Visually syncs the volume sliders so they are all the same if there\n * are more than one.\n *\n * @access public\n */\n function sync() {\n let volumeSliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume sliders for the song, setting the value\n\t\t\tto the config value.\n\t\t*/\n for (let i = 0; i < volumeSliders.length; i++) {\n volumeSliders[i].value = config.audio.volume * 100;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default VolumeSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/volumeSliderElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Repeater utility. Handles setting the repeat for all scenarios.\n *\n * @module utilities/Repeater\n */\nlet Repeater = (function() {\n /**\n * Sets the state of the repeat for a song.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n */\n function setRepeat(repeat) {\n /*\n Set the global repeat to be toggled\n */\n config.repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat for a playlist.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n * @param {string} playlist - The key of the playlist for repeating\n */\n function setRepeatPlaylist(repeat, playlist) {\n /*\n Set the playlist repeat to be toggled.\n */\n config.playlists[playlist].repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat song\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat shoudl be on or off for the song.\n */\n function setRepeatSong(repeat) {\n config.repeat_song = repeat;\n }\n\n /*\n Returns the public facing methods\n */\n return {\n setRepeat: setRepeat,\n setRepeatPlaylist: setRepeatPlaylist,\n setRepeatSong: setRepeatSong\n };\n})();\n\nexport default Repeater;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/repeater.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Shuffle Module. Handles all of the shuffling functionality for\n * AmplitudeJS\n *\n * @module utilities/Shuffler\n */\nlet Shuffler = (function() {\n /**\n * Sets the shuffle state globally\n *\n * @access public\n * @param {boolean} shuffle - True when we are shuffling, false when we turn it off.\n */\n function setShuffle(shuffle) {\n config.shuffle_on = shuffle;\n\n if (shuffle) {\n shuffleSongs();\n } else {\n config.shuffle_list = [];\n }\n }\n\n /**\n * Toggles the shuffle status globally.\n *\n * @access public\n */\n function toggleShuffle() {\n /*\n If shuffle is on, we toggle it off. If shuffle is off, we\n toggle on.\n */\n if (config.shuffle_on) {\n config.shuffle_on = false;\n config.shuffle_list = [];\n } else {\n config.shuffle_on = true;\n shuffleSongs();\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n * @param {boolean} shuffle True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n config.playlists[playlist].shuffle = shuffle;\n\n if (config.playlists[playlist].shuffle) {\n shufflePlaylistSongs(playlist);\n } else {\n config.playlists[playlist].shuffle_list = [];\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n */\n function toggleShufflePlaylist(playlist) {\n /*\n If the playlist shuffled is on, we toggle it off. If the\n playlist shuffled is off, we toggle it on.\n */\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle = false;\n config.playlists[playlist].shuffle_list = [];\n } else {\n config.playlists[playlist].shuffle = true;\n shufflePlaylistSongs(playlist);\n }\n }\n\n /**\n * Shuffles individual songs in the config\n * Based off of: http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html\n *\n * Public Accessor: Shuffle.shuffleSongs()\n *\n * @access public\n */\n function shuffleSongs() {\n /*\n\t\t\tBuilds a temporary array with the length of the config.\n\t\t*/\n let shuffleTemp = new Array(config.songs.length);\n\n /*\n\t\t\tSet the temporary array equal to the songs array.\n\t\t*/\n for (let i = 0; i < config.songs.length; i++) {\n shuffleTemp[i] = config.songs[i];\n }\n\n /*\n\t\t\tIterate ove rthe songs and generate random numbers to\n\t\t\tswap the indexes of the shuffle array.\n\t\t*/\n for (let i = config.songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(Math.random() * config.songs.length + 1);\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n\t\t\tSet the shuffle list to the shuffle temp.\n\t\t*/\n config.shuffle_list = shuffleTemp;\n }\n\n /**\n * Shuffle songs in a playlist\n *\n * Public Accessor: Shuffle.shufflePlaylistSongs( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist we are shuffling.\n */\n function shufflePlaylistSongs(playlist) {\n /*\n Builds a temporary array with the length of the playlist songs.\n */\n let shuffleTemp = new Array(config.playlists[playlist].songs.length);\n\n /*\n Set the temporary array equal to the playlist array.\n */\n for (let i = 0; i < config.playlists[playlist].songs.length; i++) {\n shuffleTemp[i] = config.playlists[playlist].songs[i];\n }\n\n /*\n Iterate ove rthe songs and generate random numbers to\n swap the indexes of the shuffle array.\n */\n for (let i = config.playlists[playlist].songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(\n Math.random() * config.playlists[playlist].songs.length + 1\n );\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n Set the shuffle list to the shuffle temp.\n */\n config.playlists[playlist].shuffle_list = shuffleTemp;\n }\n\n /**\n * Swaps and randomizes the song shuffle.\n *\n * @access private\n * @param {object} shuffleList \t- The list of songs that is going to be shuffled\n * @param {number} original \t\t- The original index of he song in the songs array\n * @param {number} random \t\t\t- The randomized index that will be the new index of the song in the shuffle array.\n */\n function shuffleSwap(shuffleList, original, random) {\n let temp = shuffleList[original];\n shuffleList[original] = shuffleList[random];\n shuffleList[random] = temp;\n }\n\n /**\n * Returns public facing methods\n */\n return {\n setShuffle: setShuffle,\n toggleShuffle: toggleShuffle,\n setShufflePlaylist: setShufflePlaylist,\n toggleShufflePlaylist: toggleShufflePlaylist,\n shuffleSongs: shuffleSongs,\n shufflePlaylistSongs: shufflePlaylistSongs\n };\n})();\n\nexport default Shuffler;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/shuffler.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS song slider elements.\n * @module visual/SongSliderElements\n */\nlet SongSliderElements = (function() {\n /**\n * Syncs all of the song slider elements.\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function sync(location, playlist, songIndex) {\n syncMain(location);\n syncPlaylist(location, playlist);\n syncSong(location, songIndex);\n syncSongInPlaylist(location, playlist);\n }\n\n /**\n * Syncs the main slider location\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n */\n function syncMain(location) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the main song sliders\n\t\t*/\n const mainSongSliders = document.querySelectorAll(\".amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the main sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < mainSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = mainSongSliders[i].getAttribute(\"data-amplitude-playlist\");\n let song = mainSongSliders[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n mainSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs playlist song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the playlist song sliders\n\t\t*/\n const playlistSongSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterates over all of the playlist sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < playlistSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlistAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\tin.\n\t\t\t*/\n if (playlistAttribute == playlist && songAttribute == null) {\n playlistSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function syncSong(location, songIndex) {\n /*\n\t\t\tWe only want to sync song sliders if the playlist is null.\n\t\t*/\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure we have a location that's a number\n\t\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\t\tGets the individual song sliders\n\t\t\t*/\n const songSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-song-index=\"' + songIndex + '\"]'\n );\n\n /*\n\t\t\t\tIterates over all of the individual song sliders and sets the value\n\t\t\t\tto the percentage of the song played.\n\t\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n /*\n\t Grab the playlist and song attributes from the element.\n\t */\n let playlistAttribute = songSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = songSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\t\tin.\n\t\t\t\t*/\n if (playlistAttribute == null && songAttribute == songIndex) {\n songSliders[i].value = location;\n }\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncSongInPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets the song in playlist sliders\n\t\t*/\n const songInPlaylistSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' +\n playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tIterates over all of the song in playlist sliders and sets the value\n\t\t\tto the percentage of the song played.\n\t\t*/\n for (let i = 0; i < songInPlaylistSliders.length; i++) {\n songInPlaylistSliders[i].value = location;\n }\n }\n\n /**\n * Visually syncs the song sliders back to 0. This usually happens when\n * a song has changed, we ensure that all song sliders get reset.\n *\n * @access public\n */\n function resetElements() {\n let songSliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterate over all of the song sliders and set them to\n\t\t\t0 essentially resetting them.\n\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n songSliders[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncMain: syncMain,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n resetElements: resetElements\n };\n})();\n\nexport default SongSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songSliderElements.js","/**\n * Imports the AmplitudeJS Current Time\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentTimeElements from \"./time/currentTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Hour Elements\n * @module visual/time/CurrentHourElements\n */\nimport CurrentHourElements from \"./time/currentHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Minute Elements\n * @module visual/time/CurrentMinuteElements\n */\nimport CurrentMinuteElements from \"./time/currentMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Second Elements\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentSecondElements from \"./time/currentSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Count Down Time Elements\n * @module visual/time/DurationCountDownTimeElements\n */\nimport DurationCountDownTimeElements from \"./time/durationCountDownTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Hour Elements\n * @module visual/time/DurationHourElements\n */\nimport DurationHourElements from \"./time/durationHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Minute Elements\n * @module visual/time/DurationMinuteElements\n */\nimport DurationMinuteElements from \"./time/durationMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Second Elements\n * @module visual/time/DurationSecondElements\n */\nimport DurationSecondElements from \"./time/durationSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Time Elements\n * @module visual/time/DurationTimeElements\n */\nimport DurationTimeElements from \"./time/durationTimeElements.js\";\n\n/**\n * Time Elements Interface. This allows us to update all of the sub time elements\n * through one central point.\n * @module visual/TimeElements\n */\nlet TimeElements = (function() {\n /**\n * Resets the current times.\n */\n function resetCurrentTimes() {\n CurrentTimeElements.resetTimes();\n CurrentHourElements.resetTimes();\n CurrentMinuteElements.resetTimes();\n CurrentSecondElements.resetTimes();\n }\n\n /**\n * Syncs the current time elements to the time provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n */\n function syncCurrentTimes(currentTime) {\n CurrentTimeElements.sync(currentTime);\n CurrentHourElements.sync(currentTime.hours);\n CurrentMinuteElements.sync(currentTime.minutes);\n CurrentSecondElements.sync(currentTime.seconds);\n }\n\n /**\n * Resets the duration times.\n */\n function resetDurationTimes() {\n DurationCountDownTimeElements.resetTimes();\n DurationHourElements.resetTimes();\n DurationMinuteElements.resetTimes();\n DurationSecondElements.resetTimes();\n DurationTimeElements.resetTimes();\n }\n\n /**\n * Syncs the duration times to the times provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n * @param {Object} songDuration - An object representing the duration of the audio\n */\n function syncDurationTimes(currentTime, songDuration) {\n DurationCountDownTimeElements.sync(currentTime, songDuration);\n DurationTimeElements.sync(songDuration);\n DurationHourElements.sync(songDuration.hours);\n DurationMinuteElements.sync(songDuration.minutes);\n DurationSecondElements.sync(songDuration.seconds);\n }\n\n /**\n * Returns the publically accessible methods.\n */\n return {\n resetCurrentTimes: resetCurrentTimes,\n syncCurrentTimes: syncCurrentTimes,\n resetDurationTimes: resetDurationTimes,\n syncDurationTimes: syncDurationTimes\n };\n})();\n\nexport default TimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/timeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Handles the visualizations elements.\n *\n * @module Visualizations\n */\nlet Visualizations = (function() {\n /**\n * Runs all of the visualizations on the screen.\n */\n function run() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n /*\n If the web audio API is available, we display the visualizations.\n */\n if (config.web_audio_api_available) {\n /*\n If the visualization has not started, there are visualizations available,\n and we have at least one visualization element, then we continue.\n */\n if (\n Object.keys(config.visualizations.available).length > 0 &&\n visualizationElements.length > 0\n ) {\n /*\n Iterate over all of the visualizations on the page and activate the\n ones we need.\n */\n for (let i = 0; i < visualizationElements.length; i++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n runGlobalVisualization(visualizationElements[i]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n runPlaylistVisualization(visualizationElements[i], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n runSongVisualization(visualizationElements[i], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n runSongInPlaylistVisualization(\n visualizationElements[i],\n playlist,\n song\n );\n }\n }\n }\n } else {\n displayBackups();\n }\n }\n\n /**\n * Runs a global visualization\n *\n * @param {Node} element The container element that handles the visualization.\n */\n function runGlobalVisualization(element) {\n /*\n Gets the global visualization index and the active song visualization indexes\n so we know which visualization to use. The song will override the global\n */\n let globalVisualizationIndex = config.visualization;\n let activeSongVisualizationIndex =\n config.active_index != null\n ? config.songs[config.active_index].visualization\n : config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n\n /*\n If the active song visualization is defined and the visualization exists,\n use that visualization.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the user defined a global visualization, use that one.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n\n /*\n If the user didn't define a global visualization, use the first visualization\n registered if there is one.\n */\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n\n /**\n * Run a specific playlist visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} playlist The key of the playlist we are running the visualization for.\n */\n function runPlaylistVisualization(element, playlist) {\n /*\n If the playlist is equal to the active playlist, then we continue.\n */\n if (playlist == config.active_playlist) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the actual song has a visualization, we run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the actual playlist has a visualization, run that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If a global visualization is defined, run that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song specific visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} song The song index that we are running the visualization for.\n */\n function runSongVisualization(element, song) {\n /*\n If the song is equal to the active song, then we continue.\n */\n if (song == config.active_index) {\n /*\n Get the indexes of the song\n */\n let activeSongVisualizationIndex =\n config.songs[config.active_index].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the song has a visualization, run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the global visualization is set, use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song in playlist visualization.\n *\n * @param {Node} element - The element containing the visualization.\n * @param {string} playlist - The string of the playlist key.\n * @param {index} song - The index of the song in the playlist.\n */\n function runSongInPlaylistVisualization(element, playlist, song) {\n /*\n If the playlist is the same as the active playlist and the active\n index of the song is the same as the song, then we continue.\n */\n if (\n playlist == config.active_playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the active song has a visualization, we use that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the active playlist has a visualization, we use that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If the global visualization has been set, we use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Add a visualization to the array of active visualizations.\n *\n * @param {string} key - The key of the active visualization.\n * @param {Node} element - The element that the visualization will be applied to.\n */\n function addToActiveVisualizations(key, element) {\n let visualization = new config.visualizations.available[key][\"object\"]();\n visualization.setPreferences(\n config.visualizations.available[key][\"preferences\"]\n );\n visualization.startVisualization(element);\n config.visualizations.active.push(visualization);\n }\n\n /**\n * Stops all active visualizations.\n */\n function stop() {\n /*\n Iterates over all of the visualizations and stop the visualization.\n */\n for (let i = 0; i < config.visualizations.active.length; i++) {\n config.visualizations.active[i].stopVisualization();\n }\n\n /*\n Clear the active visualizations.\n */\n config.visualizations.active = [];\n }\n\n /**\n * Registers any visualization we can use.\n *\n * @param {object} visualization The visualization object itself\n * @param {object} preferences User preferences overrides.\n */\n function register(visualization, preferences) {\n /*\n Initialize the new visualization.\n */\n let newVisualization = new visualization();\n\n /*\n\t Adds the visualization to the global config so it knows\n\t it can be used when playing songs.\n\n\t getID is a public function for getting a visualization's id.\n\t It becomes the key to access the visualization.\n\t */\n config.visualizations.available[newVisualization.getID()] = new Array();\n config.visualizations.available[newVisualization.getID()][\n \"object\"\n ] = visualization;\n config.visualizations.available[newVisualization.getID()][\n \"preferences\"\n ] = preferences;\n }\n\n /**\n * Displays the backups for the visualizations.\n */\n function displayBackups() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if (visualizationElements.length > 0) {\n for (let x = 0; x < visualizationElements.length; x++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[x].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[x].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n displayGlobalBackup(visualizationElements[x]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n displayPlaylistBackup(visualizationElements[x], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n displaySongBackup(visualizationElements[x], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistBackup(visualizationElements[x], playlist, song);\n }\n }\n }\n }\n\n /**\n * Displays the global backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayGlobalBackup(element) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n\n /**\n * Displays the playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayPlaylistBackup(element, playlist) {\n if (config.active_playlist == playlist) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongBackup(element, song) {\n if (config.active_index == song) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song in playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongInPlaylistBackup(element, playlist, song) {\n if (\n config.active_playlist == playlist &&\n config.playlists[active_playlist].active_index == song\n ) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n run: run,\n stop: stop,\n register: register\n };\n})();\n\nexport default Visualizations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/visualizations.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the initializer\n * @module init/AmplitudeInitializer\n */\nimport AmplitudeInitializer from \"../init/init.js\";\n\n/**\n * These helpers wrap around the basic methods of the Soundcloud API\n * and get the information we need from SoundCloud to make the songs\n * streamable through Amplitude\n *\n * @module soundcloud/SoundCloud\n */\nlet SoundCloud = (function() {\n /**\n * Defines the temporary user config used while we configure soundcloud\n * @type {object}\n */\n let tempUserConfig = {};\n\n /**\n * Loads the soundcloud SDK for use with Amplitude so the user doesn't have\n * to load it themselves.\n * With help from: http://stackoverflow.com/questions/950087/include-a-javascript-file-in-another-javascript-file\n *\n * @access public\n * @param {object} userConfig \t- The config defined by the user for AmplitudeJS\n */\n function loadSoundCloud(userConfig) {\n /*\n\t\t\tSets the temporary config to the config passed by the user so we can make changes\n\t\t\tand not break the actual config.\n\t\t*/\n tempUserConfig = userConfig;\n\n /*\n\t\t\tGets the head tag for the document and create a script element.\n\t\t*/\n let head = document.getElementsByTagName(\"head\")[0];\n let script = document.createElement(\"script\");\n\n script.type = \"text/javascript\";\n\n /*\n\t\t\tURL to the remote soundcloud SDK\n\t\t*/\n script.src = \"https://connect.soundcloud.com/sdk.js\";\n script.onreadystatechange = initSoundcloud;\n script.onload = initSoundcloud;\n\n /*\n\t\t\tAdd the script to the head of the document.\n\t\t*/\n head.appendChild(script);\n }\n\n /**\n * Initializes soundcloud with the key provided.\n *\n * @access private\n */\n function initSoundcloud() {\n /*\n\t\t\tCalls the SoundCloud initialize function\n\t\t\tfrom their API and sends it the client_id\n\t\t\tthat the user passed in.\n\t\t*/\n SC.initialize({\n client_id: config.soundcloud_client\n });\n\n /*\n\t\t\tGets the streamable URLs to run through Amplitue. This is\n\t\t\tVERY important since Amplitude can't stream the copy and pasted\n\t\t\tlink from the SoundCloud page, but can resolve the streaming\n\t\t\tURLs from the link.\n\t\t*/\n getStreamableURLs();\n }\n\n /**\n * Gets the streamable URL from the URL provided for\n * all of the soundcloud links. This will loop through\n * and set all of the information for the soundcloud\n * urls.\n *\n * @access private\n */\n function getStreamableURLs() {\n /*\n\t\t\tDefine the regex to find the soundcloud URLs\n\t\t*/\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n for (let i = 0; i < config.songs.length; i++) {\n /*\n\t\t\t\tIf the URL matches soundcloud, we grab\n\t\t\t\tthat url and get the streamable link\n\t\t\t\tif there is one.\n\t\t\t*/\n if (config.songs[i].url.match(soundcloud_regex)) {\n config.soundcloud_song_count++;\n resolveStreamable(config.songs[i].url, i);\n }\n }\n }\n\n /**\n * Resolves an individual streamable URL.\n *\n * @param {string} url - The URL of the SoundCloud song to get the streamable URL from.\n * @param {string} playlist - The playlist we are getting the streamable URL for.\n * @param {Integer} index - The index of the song in the playlist or the songs array.\n * @param {boolean} addToShuffleList - Whether we add to the shuffle list for the songs or playlist.\n *\n */\n function resolveIndividualStreamableURL(\n url,\n playlist,\n index,\n addToShuffleList = false\n ) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n If streamable we get the url and bind the client ID to the end\n so Amplitude can just stream the song normally. We then overwrite\n the url the user provided with the streamable URL.\n */\n if (sound.streamable) {\n if (playlist != null) {\n config.playlists[playlist].songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n }\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.playlists[playlist].songs[index].cover_art_url =\n sound.artwork_url;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].cover_art_url =\n sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.playlists[playlist].songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[\n index\n ].soundcloud_data = sound;\n }\n } else {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.shuffle_list[index].stream_url +\n \"?client_id=\" +\n config.soundcloud_client;\n }\n\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n\n if (addToShuffleList) {\n config.shuffle_list[index].cover_art_url = sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.shuffle_list[index].soundcloud_data = sound;\n }\n }\n } else {\n if (playlist != null) {\n AmplitudeHelpers.writeDebugMessage(\n config.playlists[playlist].songs[index].name +\n \" by \" +\n config.playlists[playlist].songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n } else {\n /*\n If not streamable, then we print a message to the user stating\n that the song with name X and artist X is not streamable. This\n gets printed ONLY if they have debug turned on.\n */\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n }\n });\n }\n\n /**\n * Due to Soundcloud SDK being asynchronous, we need to scope the\n * index of the song in another function. The privateGetSoundcloudStreamableURLs\n * function does the actual iteration and scoping.\n *\n * @access private\n * @param {string} url \t\t- URL of the soundcloud song\n * @param {number} index \t- The index of the soundcloud song in the songs array.\n */\n function resolveStreamable(url, index) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n\t\t\t\tIf streamable we get the url and bind the client ID to the end\n\t\t\t\tso Amplitude can just stream the song normally. We then overwrite\n\t\t\t\tthe url the user provided with the streamable URL.\n\t\t\t*/\n if (sound.streamable) {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n /*\n\t\t\t\t\tIf the user want's to use soundcloud art, we overwrite the\n\t\t\t\t\tcover_art_url with the soundcloud artwork url.\n\t\t\t\t*/\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n }\n\n /*\n\t\t\t\t\tGrab the extra metadata from soundcloud and bind it to the\n\t\t\t\t\tsong. The user can get this through the public function:\n\t\t\t\t\tgetActiveSongMetadata\n\t\t\t\t*/\n config.songs[index].soundcloud_data = sound;\n } else {\n /*\n\t\t\t\t\tIf not streamable, then we print a message to the user stating\n\t\t\t\t\tthat the song with name X and artist X is not streamable. This\n\t\t\t\t\tgets printed ONLY if they have debug turned on.\n\t\t\t\t*/\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n /*\n\t\t\t\tIncrements the song ready counter.\n\t\t\t*/\n config.soundcloud_songs_ready++;\n\n /*\n\t\t\t\tWhen all songs are accounted for, then amplitude is ready\n\t\t\t\tto rock and we set the rest of the config.\n\t\t\t*/\n if (config.soundcloud_songs_ready == config.soundcloud_song_count) {\n AmplitudeInitializer.setConfig(tempUserConfig);\n }\n });\n }\n\n /**\n * Determines if a given URL is a SoundCloud URL.\n *\n * @param {string} url - The URL to test if it's a SoundCloud URL.\n */\n function isSoundCloudURL(url) {\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n return url.match(soundcloud_regex);\n }\n\n /*\n\t\tReturns the publically accessible methods\n\t*/\n return {\n loadSoundCloud: loadSoundCloud,\n resolveIndividualStreamableURL: resolveIndividualStreamableURL,\n isSoundCloudURL: isSoundCloudURL\n };\n})();\n\nexport default SoundCloud;\n\n\n\n// WEBPACK FOOTER //\n// ./src/soundcloud/soundcloud.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the Playback Speed Visual Elements Handler\n * @module visual/PlaybackSpeedElements\n */\nlet PlaybackSpeedElements = (function() {\n /**\n * Sets all of the visual playback speed buttons to have the right class\n * to display the background image that represents the current playback\n * speed.\n *\n * @access public\n */\n function sync() {\n /*\n\t\t\tGets all of the playback speed classes.\n\t\t*/\n let playbackSpeedClasses = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes\n\t\t\tapplying the right speed class for visual purposes.\n\t\t*/\n for (let i = 0; i < playbackSpeedClasses.length; i++) {\n /*\n\t\t\t\tRemoves all of the old playback speed classes.\n\t\t\t*/\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-10\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-15\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-20\");\n\n /*\n\t\t\t\tSwitch the current playback speed and apply the appropriate\n\t\t\t\tspeed class.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-10\");\n break;\n case 1.5:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-15\");\n break;\n case 2:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-20\");\n break;\n }\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default PlaybackSpeedElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playbackSpeedElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the shuffle elements\n * @module visual/ShuffleElements\n */\nlet ShuffleElements = (function() {\n /**\n * Syncs the global shuffle button visual state.\n *\n * @access public\n */\n function syncMain() {\n /*\n\t\t\tGets the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterate over all of the shuffle buttons.\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tEnsure the shuffle button doesn't belong to a playlist. We have\n\t\t\t\ta separate method for that.\n\t\t\t*/\n if (shuffleButtons[i].getAttribute(\"data-amplitude-playlist\") == null) {\n /*\n\t\t\t\t\tIf the state of the player is shuffled on, true, then\n\t\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\t\tthen we do the opposite.\n\t\t\t\t*/\n if (config.shuffle_on) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n }\n\n /**\n * Syncs the playlist shuffle button visual state.\n *\n * @access public\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function syncPlaylist(playlist) {\n /*\n\t\t\tGets all of the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.querySelectorAll(\n '.amplitude-shuffle[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterate over all of the shuffle buttons\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tIf the state of the playlist is shuffled on, true, then\n\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\tthen we do the opposite.\n\t\t\t*/\n if (config.playlists[playlist].shuffle) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n syncMain: syncMain,\n syncPlaylist: syncPlaylist\n };\n})();\n\nexport default ShuffleElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/shuffleElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the syncing of the song played progress elements.\n *\n * @module visual/SongPlayedProgressElements\n */\nlet SongPlayedProgressElements = (function() {\n /**\n * Syncs the song played progress bars. These are HTML5 progress elements.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percentage of the song that has been played.\n */\n function sync(songPlayedPercentage) {\n syncGlobal(songPlayedPercentage);\n syncPlaylist(songPlayedPercentage);\n syncSong(songPlayedPercentage);\n syncSongInPlaylist(songPlayedPercentage);\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the global progress bar.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncGlobal(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n \".amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the playlist progress bar.\n *\n * @access public\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let song = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSong(percentage) {\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure that the song completion percentage is a number\n\t\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\t\tGet all of the song progress bars\n\t\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song in playlist.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSongInPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n Iterates over all of the song played progress elements\n and sets them accordingly.\n */\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist != null && songIndex != null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sets all of the song played progress bars to 0\n *\n * @access public\n */\n function resetElements() {\n let songPlayedProgressBars = document.getElementsByClassName(\n \"amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n songPlayedProgressBars[i].value = 0;\n }\n }\n\n return {\n sync: sync,\n resetElements: resetElements\n };\n})();\n\nexport default SongPlayedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songPlayedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Core Module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * AmplitudeJS SoundCloud Module\n * @module soundcloud/SoundCloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Imports the utilities used by the main module.\n */\n/**\n * AmplitudeJS Config State Module\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Module\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * AmplitudeJS Events Module\n * @module events/Events\n */\nimport Events from \"../events/events.js\";\n\n/**\n * AmplitudeJS FX Module\n * @module fx/Fx\n */\nimport Fx from \"../fx/fx.js\";\n\n/**\n * AmplitudeJS Visualizations Module\n * @module fx/Visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * AmplitudeJS WaveForm Module\n * @module fx/WaveForm\n */\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * AmplitudeJS Audio Navigation Module.\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Playlists Initializer Module\n * @module init/Playlists\n */\nimport PlaylistsInitializer from \"./playlists.js\";\n\n/**\n * Imports the AmplitudeJS Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Imports the AmplitudeJS Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Volume Slider\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Imports the AmplitudeJS Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the AmplitudeJS Play/Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS MetaData Elements Module.\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports the AmplitudeJS PlaybackSpeedElements Module.\n * @module visual/PlayBackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Initializer Module. Helps with the handling of all of the\n * initialization for AmplitudeJS.\n *\n * @module init/Initializer\n */\nlet Initializer = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json )\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function initialize(userConfig) {\n let ready = false;\n\n /*\n\t\t\tReset the config on init so we have a clean slate. This is if the\n\t\t\tuser has to re-init.\n\t\t*/\n ConfigState.resetConfig();\n\n /*\n\t\t\tInitialize event handlers on init. This will clear any old\n\t\t\tevent handlers on the amplitude element and re-bind what is\n\t\t\tnecessary.\n\t\t*/\n Events.initialize();\n\n /*\n Initialize the callbacks we listen to for the audio object.\n */\n Callbacks.initialize();\n\n /*\n\t\t\tInitializes debugging right away so we can use it for the rest\n\t\t\tof the configuration.\n\t\t*/\n config.debug = userConfig.debug != undefined ? userConfig.debug : false;\n\n /*\n Set default artwork, if specified.\n */\n setArt(userConfig);\n\n /*\n\t\t\tChecks to see if the user has songs defined.\n\t\t*/\n if (userConfig.songs) {\n /*\n\t\t\t\tChecks to see if the user has some songs in the songs array.\n\t\t\t*/\n if (userConfig.songs.length != 0) {\n /*\n\t\t\t\t\tCopies over the user defined songs. and prepares\n\t\t\t\t\tAmplitude for the rest of the configuration.\n\t\t\t\t*/\n config.songs = userConfig.songs;\n /*\n\t\t\t\t\tFlag amplitude as ready.\n\t\t\t\t*/\n ready = true;\n } else {\n Debug.writeMessage(\"Please add some songs, to your songs object!\");\n }\n } else {\n Debug.writeMessage(\n \"Please provide a songs object for AmplitudeJS to run!\"\n );\n }\n\n /*\n\t\t\tInitializes the audio context. In this method it checks to see if the\n\t\t\tuser wants to use visualizations or not before proceeding.\n\t\t*/\n if (Fx.webAudioAPIAvailable()) {\n if (Fx.determineUsingAnyFX()) {\n /*\n Configure the Web Audio API If It's available.\n */\n Fx.configureWebAudioAPI();\n\n /*\n Activates the audio context after an event for the user.\n */\n document.documentElement.addEventListener(\"mousedown\", function() {\n if (config.context.state !== \"running\") {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\"keydown\", function() {\n if (config.context.state !== \"running\") {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\"keyup\", function() {\n if (config.context.state !== \"running\") {\n config.context.resume();\n }\n });\n\n /*\n Set the user waveform settings if provided.\n */\n if (\n userConfig.waveforms != undefined &&\n userConfig.waveforms.sample_rate != undefined\n ) {\n config.waveforms.sample_rate = userConfig.waveforms.sample_rate;\n }\n\n /*\n Initialize the waveform.\n */\n WaveForm.init();\n\n /*\n If the user is registering visualizations on init,\n we set them right away.\n */\n if (\n userConfig.visualizations != undefined &&\n userConfig.visualizations.length > 0\n ) {\n /*\n Iterate over all of the visualizations and\n register them in our player.\n */\n for (let i = 0; i < userConfig.visualizations.length; i++) {\n Visualizations.register(\n userConfig.visualizations[i].object,\n userConfig.visualizations[i].params\n );\n }\n }\n }\n } else {\n Debug.writeMessage(\n \"The Web Audio API is not available on this platform. We are using your defined backups!\"\n );\n }\n\n /*\n Initialize default live settings\n */\n initializeDefaultLiveSettings();\n\n /*\n Initialize default song indexes\n */\n initializeDefaultSongIndexes();\n\n /*\n\t\t\tWhen the preliminary config is ready, we are ready to proceed.\n\t\t*/\n if (ready) {\n /*\n\t\t\t\tCopies over the soundcloud information to the global config\n\t\t\t\twhich will determine where we go from there.\n\t\t\t*/\n config.soundcloud_client =\n userConfig.soundcloud_client != undefined\n ? userConfig.soundcloud_client\n : \"\";\n\n /*\n\t\t\t\tChecks if we want to use the art loaded from soundcloud.\n\t\t\t*/\n config.soundcloud_use_art =\n userConfig.soundcloud_use_art != undefined\n ? userConfig.soundcloud_use_art\n : \"\";\n\n /*\n\t\t\t\tIf the user provides a soundcloud client then we assume that\n\t\t\t\tthere are URLs in their songs that will reference SoundCloud.\n\t\t\t\tWe then copy over the user config they provided to the\n\t\t\t\ttemp_user_config so we don't mess up the global or their configs\n\t\t\t\tand load the soundcloud information.\n\t\t\t*/\n let tempUserConfig = {};\n\n /*\n If there's a soundcloud_client key set, we load the SoundCloud data\n for all of the songs in the array.\n */\n if (config.soundcloud_client != \"\") {\n tempUserConfig = userConfig;\n\n /*\n\t\t\t\t\tLoad up SoundCloud for use with AmplitudeJS.\n\t\t\t\t*/\n SoundCloud.loadSoundCloud(tempUserConfig);\n } else {\n /*\n\t\t\t\t\tThe user is not using Soundcloud with Amplitude at this point\n\t\t\t\t\tso we just finish the configuration with the users's preferences.\n\t\t\t\t*/\n setConfig(userConfig);\n }\n }\n\n /*\n\t\t\tDebug out what was initialized with AmplitudeJS.\n\t\t*/\n Debug.writeMessage(\"Initialized With: \");\n Debug.writeMessage(config);\n }\n\n /**\n * Rebinds all of the elements in the display.\n *\n * Public Accessor: Amplitude.rebindDisplay()\n * @access public\n */\n function rebindDisplay() {\n Events.initialize();\n MetaDataElements.displayMetaData();\n }\n\n /**\n * Finishes the initalization of the config. Takes all of the user defined\n * parameters and makes sure they override the defaults. The important\n * config information is assigned in the publicInit() function.\n *\n * This function can be called from 2 different locations:\n * \t1. Right away on init after the important settings are defined.\n *\n * \t2. After all of the Soundcloud URLs are resolved properly and\n *\t \tsoundcloud is configured. We will need the proper URLs from Soundcloud\n * \t\tto stream through Amplitude so we get those right away before we\n * \t\tset the information and the active song\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setConfig(userConfig) {\n /*\n Checks if the user has any playlists defined. If they do\n we have to initialize the functionality for the playlists.\n */\n if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) {\n PlaylistsInitializer.initialize(userConfig.playlists);\n }\n\n /*\n\t\t\tCheck to see if the user entered a start song\n\t\t*/\n if (userConfig.start_song != undefined && !userConfig.starting_playlist) {\n /*\n\t\t\t\tEnsure what has been entered is an integer.\n\t\t\t*/\n if (Checks.isInt(userConfig.start_song)) {\n AudioNavigation.changeSong(\n config.songs[userConfig.start_song],\n userConfig.start_song\n );\n } else {\n Debug.writeMessage(\n \"You must enter an integer index for the start song.\"\n );\n }\n } else {\n AudioNavigation.changeSong(config.songs[0], 0);\n }\n\n /*\n If the shuffle is on by default, shuffle the songs and\n switch to the shuffled song.\n */\n if (userConfig.shuffle_on != undefined && userConfig.shuffle_on) {\n config.shuffle_on = true;\n Shuffler.shuffleSongs();\n\n AudioNavigation.changeSong(config.shuffle_list[0], 0);\n }\n\n /*\n\t\t\tAllows the user to set whether they want to continue to the next song\n\t\t\twhen the current song finishes or not. In any scenario that's not a playlist,\n\t\t\tcontining to the next song may not be desired.\n\t\t*/\n config.continue_next =\n userConfig.continue_next != undefined ? userConfig.continue_next : true;\n\n /*\n\t\t\tIf the user defined a playback speed, we copy over their\n\t\t\tpreference here, otherwise we default to normal playback\n\t\t\tspeed of 1.0.\n\t\t*/\n config.playback_speed =\n userConfig.playback_speed != undefined ? userConfig.playback_speed : 1.0;\n\n /*\n\t\t\tSets the audio playback speed.\n\t\t*/\n Core.setPlaybackSpeed(config.playback_speed);\n\n /*\n\t\t\tIf the user wants the song to be pre-loaded for instant\n\t\t\tplayback, they set it to true. By default it's set to just\n\t\t\tload the metadata.\n\t\t*/\n config.audio.preload =\n userConfig.preload != undefined ? userConfig.preload : \"auto\";\n\n /*\n\t\t\tInitializes the user defined callbacks. This should be a JSON\n\t\t\tobject that contains a key->value store of the callback name\n\t\t\tand the name of the function the user needs to call.\n\t\t*/\n config.callbacks =\n userConfig.callbacks != undefined ? userConfig.callbacks : {};\n\n /*\n\t\t\tInitializes the user defined key bindings. This should be a JSON\n\t\t\tobject that contains a key->value store of the key event number\n\t\t\tpressed and the method to be run.\n\t\t*/\n config.bindings =\n userConfig.bindings != undefined ? userConfig.bindings : {};\n\n /*\n\t\t\tThe user can define a starting volume in a range of 0-100 with\n\t\t\t0 being muted and 100 being the loudest. After the config is set\n\t\t\tAmplitude sets the active song's volume to the volume defined\n\t\t\tby the user.\n\t\t*/\n config.volume = userConfig.volume != undefined ? userConfig.volume : 50;\n\n /*\n\t\t\tSets the delay between songs if the user has it set. This should be in MS.\n\t\t*/\n config.delay = userConfig.delay != undefined ? userConfig.delay : 0;\n\n /*\n\t\t\tThe user can set the volume increment and decrement values between 1 and 100\n\t\t\tfor when the volume up or down button is pressed. The default is an increase\n\t\t\tor decrease of 5.\n\t\t*/\n config.volume_increment =\n userConfig.volume_increment != undefined\n ? userConfig.volume_increment\n : 5;\n\n config.volume_decrement =\n userConfig.volume_decrement != undefined\n ? userConfig.volume_decrement\n : 5;\n\n /*\n\t\t\tSet the volume to what is defined in the config. The user can define this,\n\t\t\tso we should set it up that way.\n\t\t*/\n Core.setVolume(config.volume);\n\n /*\n Set default artwork, if specified\n */\n setArt(userConfig);\n\n /*\n Initialize the visual elements\n */\n initializeElements();\n\n /*\n\t\t\tIf the user has selected a starting playlist, we need to set the starting playlist\n\t\t\tand sync the visuals\n\t\t*/\n if (\n userConfig.starting_playlist != undefined &&\n userConfig.starting_playlist != \"\"\n ) {\n /*\n\t\t\t\tSet the active playlist to the starting playlist by the user\n\t\t\t*/\n config.active_playlist = userConfig.starting_playlist;\n\n /*\n\t\t\t\tCheck if the user defined a song to start with in the playlist.\n\t\t\t*/\n if (\n userConfig.starting_playlist_song != undefined &&\n userConfig.starting_playlist_song != \"\"\n ) {\n /*\n\t\t\t\t\tEnsure the song is a valid index.\n\t\t\t\t*/\n if (\n typeof userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ] != undefined\n ) {\n /*\n\t\t\t\t\t\tSet the player to the song defined by the user.\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ],\n parseInt(userConfig.starting_playlist_song)\n );\n } else {\n /*\n\t\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n /*\n\t\t\t\t\t\tDebug that the song index doesn't exist\n\t\t\t\t\t*/\n Debug.writeMessage(\n \"The index of \" +\n userConfig.starting_playlist_song +\n \" does not exist in the playlist \" +\n userConfig.starting_playlist\n );\n }\n } else {\n /*\n\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t*/\n AudioNavigation.changeSong(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n }\n\n /*\n\t\t\t\tSync the main and song play pause buttons.\n\t\t\t*/\n PlayPauseElements.sync();\n }\n\n /*\n\t\t\tRun after init callback\n\t\t*/\n Callbacks.run(\"initialized\");\n }\n\n /**\n * Sets the default_album_art and default_playlist_art from the\n * user supplied configuration.\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setArt(userConfig) {\n /*\n If the user defines default album art, this image will display if the active\n song doesn't have album art defined.\n */\n if (userConfig.default_album_art != undefined) {\n config.default_album_art = userConfig.default_album_art;\n } else {\n config.default_album_art = \"\";\n }\n\n /*\n\t\t\tIf the user defines default playlist art, this image will display if the user\n\t\t\ttries to set up a playlist meta data image tag but doesn't have one defined.\n\t\t*/\n if (userConfig.default_playlist_art != undefined) {\n config.default_playlist_art = userConfig.default_playlist_art;\n } else {\n config.default_playlist_art = \"\";\n }\n }\n\n /**\n * Initializes all of the elements on the page to the default starting point\n * to build from there.\n *\n * @access private\n */\n function initializeElements() {\n /*\n\t\t\tVisually sync the shuffle statuses\n\t\t*/\n ShuffleElements.syncMain();\n\n /*\n\t\t\tSync Mute Elements.\n\t\t*/\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync Volume Slider Elements\n\t\t*/\n VolumeSliderElements.sync();\n\n /*\n\t\t\tSyncs all of the playback speed elements.\n\t\t*/\n PlaybackSpeedElements.sync();\n\n /*\n\t\t\tSyncs all of the visual time elements to 00.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tSets all of the play pause buttons to pause.\n\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\tSets the meta data for the songs automatically.\n\t\t*/\n MetaDataElements.syncMetaData();\n\n /*\n\t\t\tSets the repeat buttons automatically.\n\t\t*/\n RepeatElements.syncRepeatSong();\n }\n\n /**\n * Counts the number of playlists the user has configured. This ensures\n * that the user has at least 1 playlist so we can validate the songs\n * defined in the playlist are correct and they didn't enter an invalid\n * ID.\n *\n * @access private\n * @param {object} playlists \t-\n */\n function countPlaylists(playlists) {\n /*\n\t\t\tInitialize the placeholders to iterate through the playlists\n\t\t\tand find out how many we have to account for.\n\t\t*/\n let size = 0,\n key;\n\n /*\n\t\t\tIterate over playlists and if the user has the playlist defined,\n\t\t\tincrement the size of playlists.\n\t\t*/\n for (key in playlists) {\n if (playlists.hasOwnProperty(key)) {\n size++;\n }\n }\n\n /*\n\t\t\tDebug how many playlists are in the config.\n\t\t*/\n Debug.writeMessage(\"You have \" + size + \" playlist(s) in your config\");\n\n /*\n\t\t\tReturn the number of playlists in the config.\n\t\t*/\n return size;\n }\n\n /**\n * Intializes the default live settings for all of the songs.\n *\n * @access private\n */\n function initializeDefaultLiveSettings() {\n for (let i = 0; i < config.songs.length; i++) {\n if (config.songs[i].live == undefined) {\n config.songs[i].live = false;\n }\n }\n }\n\n /**\n * Initializes the index of the song in the songs array so\n * we can reference it if needed\n *\n * @access private\n */\n function initializeDefaultSongIndexes() {\n for (let i = 0; i < config.songs.length; i++) {\n config.songs[i].index = i;\n }\n }\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n initialize: initialize,\n setConfig: setConfig,\n rebindDisplay: rebindDisplay\n };\n})();\n\nexport default Initializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/init.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Builds a waveform for the current audio.\n * Help from: https://robots.thoughtbot.com/javascript-audio-api\n * https://stackoverflow.com/questions/21347833/html-svg-not-drawing-works-in-other-pages\n */\nlet WaveForm = (function() {\n /*\n Initialize the local variables used in the Waveform.\n */\n let buffer = \"\";\n let sampleRate = \"\";\n let peaks = \"\";\n\n function init() {\n sampleRate = config.waveforms.sample_rate;\n\n /*\n Grabs all of the waveform elements on the page.\n */\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n If there are waveforms, we iterate over them and set them up to display\n properly.\n */\n if (waveforms.length > 0) {\n /*\n Iterate over all of the waveforms and build the SVG parts.\n */\n for (let i = 0; i < waveforms.length; i++) {\n /*\n Clear the inner HTML of the element if we are replacing the waveform.\n */\n waveforms[i].innerHTML = \"\";\n\n /*\n Inserts an SVG into the element.\n */\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 -1 \" + sampleRate + \" 2\");\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n\n /*\n Add a g component to the SVG\n */\n let g = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svg.appendChild(g);\n\n /*\n Add a path component to the g\n */\n let path = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"path\"\n );\n path.setAttribute(\"d\", \"\");\n path.setAttribute(\"id\", \"waveform\");\n\n g.appendChild(path);\n\n /*\n Append the SVG to the waveform.\n */\n waveforms[i].appendChild(svg);\n }\n }\n }\n\n /**\n * Builds each waveform for the page.\n */\n function build() {\n if (config.web_audio_api_available) {\n /*\n If we don't have the wave form built, we need to build the waveform by loading\n the src with an array buffer.\n */\n if (\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] == undefined\n ) {\n /*\n Initializes a new XML Http Request.\n */\n var req = new XMLHttpRequest();\n\n /*\n Opens the src parameter for the audio file to read in.\n */\n req.open(\"GET\", config.audio.src, true);\n req.responseType = \"arraybuffer\";\n\n /*\n When the ready state changes, check to see if we can render the\n wave form.\n */\n req.onreadystatechange = function(e) {\n /*\n When the request is complete, then we begin decoding the\n audio to build the waveform.\n */\n if (req.readyState == 4) {\n /*\n If the status is 200 means the response is a success and\n we decode the audio data.\n */\n if (req.status == 200) {\n /*\n Decode the audio data and process the waveform.\n */\n config.context.decodeAudioData(req.response, function(\n bufferedAudio\n ) {\n /*\n Set the buffer to the audio returned.\n */\n buffer = bufferedAudio;\n\n /*\n Get the peaks in the audio.\n */\n peaks = getPeaks(sampleRate, buffer);\n\n /*\n Build the SVG\n */\n process(sampleRate, buffer, peaks);\n });\n }\n }\n };\n req.send();\n } else {\n /*\n If we already have a waveform, we grab the waveform that\n was created for the song and display it. We do a simple hash\n of the song URL so it's already unique.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n }\n\n /**\n * Processes the audio and generates the waveform.\n *\n * @param {sampleRate} sampleRate - The rate we should sample the audio.\n * @param {arraybuffer} buffer - The Web Audio API\n * @param {array} peaks - The peaks in the audio.\n */\n function process(sampleRate, buffer, peaks) {\n /*\n If we have a buffer, we find the peaks in the audio.\n */\n if (buffer) {\n /*\n Get the total peaks in the song.\n */\n let totalPeaks = peaks.length;\n\n /*\n Figure out the depth of the peak.\n */\n let d = \"\";\n for (let peakNumber = 0; peakNumber < totalPeaks; peakNumber++) {\n if (peakNumber % 2 === 0) {\n d += ` M${~~(peakNumber / 2)}, ${peaks.shift()}`;\n } else {\n d += ` L${~~(peakNumber / 2)}, ${peaks.shift()}`;\n }\n }\n\n /*\n Add the waveform to the built waveforms array.\n */\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] = d;\n\n /*\n Display the waveform.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n\n /**\n * Get the peaks of the audio for the waveform.\n *\n * @param {number} length - The sample size of the audio.\n * @param {array} buffer - The array buffer used to find the peaks in the audio.\n */\n function getPeaks(length, buffer) {\n /*\n Set the parameters needed to build the SVG.\n */\n const sampleSize = buffer.length / length;\n const sampleStep = ~~(sampleSize / 10) || 1;\n const numberOfChannels = buffer.numberOfChannels;\n const mergedPeaks = [];\n\n /*\n Iterate over the channels and find the peaks.\n */\n for (\n let channelNumber = 0;\n channelNumber < numberOfChannels;\n channelNumber++\n ) {\n /*\n Initialize the peaks array and set the channel data to what\n the buffer has in its channel data.\n */\n const peaks = [];\n const channelData = buffer.getChannelData(channelNumber);\n\n /*\n Iterate over peaks with respect to the sample size.\n */\n for (let peakNumber = 0; peakNumber < length; peakNumber++) {\n /*\n Gt the start and end peak.\n */\n const start = ~~(peakNumber * sampleSize);\n const end = ~~(start + sampleSize);\n\n /*\n Set min and max to the channel data first peak.\n */\n let min = channelData[0];\n let max = channelData[0];\n\n /*\n Iterate over the parts of the song starting to the\n ending to display the waveform.\n */\n for (\n let sampleIndex = start;\n sampleIndex < end;\n sampleIndex += sampleStep\n ) {\n const value = channelData[sampleIndex];\n\n if (value > max) {\n max = value;\n }\n if (value < min) {\n min = value;\n }\n }\n\n /*\n Set the max and min for the peak.\n */\n peaks[2 * peakNumber] = max;\n peaks[2 * peakNumber + 1] = min;\n\n /*\n Merge the peaks\n */\n if (channelNumber === 0 || max > mergedPeaks[2 * peakNumber]) {\n mergedPeaks[2 * peakNumber] = max;\n }\n\n if (channelNumber === 0 || min < mergedPeaks[2 * peakNumber + 1]) {\n mergedPeaks[2 * peakNumber + 1] = min;\n }\n }\n }\n\n /*\n Returns the merged peaks.\n */\n return mergedPeaks;\n }\n\n /**\n * Displays all of the waveforms necessary.\n *\n * @param {path} svg - The drawing of the waveform.\n */\n function displayWaveForms(svg) {\n let waveformElements = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n Iterate over all of the waveform elements and\n display the waveform.\n */\n for (let i = 0; i < waveformElements.length; i++) {\n /*\n Get the playlist attribute of the waveform element.\n */\n let playlist = waveformElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Get the song index attribute of the waveform element.\n */\n let song = waveformElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n If the playlist is null and the song is null it's a global element.\n */\n if (playlist == null && song == null) {\n displayGlobalWaveform(waveformElements[i], svg);\n }\n\n /*\n If the playlist is defined but the song is null it's a playlist element.\n */\n if (playlist != null && song == null) {\n displayPlaylistWaveform(waveformElements[i], svg, playlist);\n }\n\n /*\n If the playlist is not defined and the song is not null it's a song\n element.\n */\n if (playlist == null && song != null) {\n displaySongWaveform(waveformElements[i], svg, song);\n }\n\n /*\n If the playlist and song are defined it's a song in the playlist element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistWaveform(waveformElements[i], svg, playlist, song);\n }\n }\n }\n\n /**\n * Displays a global wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n */\n function displayGlobalWaveform(element, svg) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n\n /**\n * Displays a playlist wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {string} playlist - The playlist we are displaying the waveform for.\n */\n function displayPlaylistWaveform(element, svg, playlist) {\n /*\n Ensure the playlist is the active playlist.\n */\n if (config.active_playlist == playlist) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {Integer} song - The index of the song we are displaying the\n * waveform for.\n */\n function displaySongWaveform(element, svg, song) {\n /*\n Ensure it's the active song being displayed.\n */\n if (config.active_index == song) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song in playlist waveform.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {String} playlist - The playlist the waveform is in.\n * @param {Integer} song - The index of the song we are displaying the waveform for.\n */\n function displaySongInPlaylistWaveform(element, svg, playlist, song) {\n /*\n Ensure it's the active song in the active playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[config.active_playlist].active_index == song\n ) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Determines if the user is using waveforms\n */\n function determineIfUsingWaveforms() {\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n if (waveforms.length > 0) {\n return true;\n } else {\n return false;\n }\n }\n\n /*\n Return the public methods.\n */\n return {\n init: init,\n build: build,\n determineIfUsingWaveforms: determineIfUsingWaveforms\n };\n})();\n\nexport default WaveForm;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/waveform.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * The utility to handle the computation of time in AmplitudeJS.\n * @module utilities/Time\n */\nlet Time = (function() {\n /**\n * Computes the current song time. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeCurrentTimes() {\n /*\n\t\t\tInitialize the current time object that will be returned.\n\t\t*/\n let currentTime = {};\n\n /*\n\t\t\tComputes the current seconds for the song.\n\t\t*/\n let currentSeconds =\n (Math.floor(config.audio.currentTime % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.currentTime % 60);\n\n /*\n\t\t\tComputes the current minutes for the song.\n\t\t*/\n let currentMinutes = Math.floor(config.audio.currentTime / 60);\n\n /*\n\t\t\tInitialize the current hours variable.\n\t\t*/\n let currentHours = \"00\";\n\n /*\n\t\t\tIf the current minutes is less than 10, we add a leading 0.\n\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n\n /*\n\t\t\tIf the user is more than 60 minutes into the song, then\n\t\t\twe extract the hours.\n\t\t*/\n if (currentMinutes >= 60) {\n currentHours = Math.floor(currentMinutes / 60);\n currentMinutes = currentMinutes % 60;\n\n /*\n\t\t\t\tIf the user is less than 10 minutes in, we append the\n\t\t\t\tadditional 0 to the minutes.\n\t\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean current time object and send back the appropriate information.\n\t\t*/\n currentTime.seconds = currentSeconds;\n currentTime.minutes = currentMinutes;\n currentTime.hours = currentHours;\n\n return currentTime;\n }\n\n /**\n * Computes the current song duration. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeSongDuration() {\n /*\n\t\t\tInitialize the song duration object that will be returned.\n\t\t*/\n let songDuration = {};\n\n /*\n\t\t\tComputes the duration of the song's seconds.\n\t\t*/\n let songDurationSeconds =\n (Math.floor(config.audio.duration % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.duration % 60);\n\n /*\n\t\t\tComputes the duration of the song's minutes.\n\t\t*/\n let songDurationMinutes = Math.floor(config.audio.duration / 60);\n\n /*\n\t\t\tInitialize the hours duration variable.\n\t\t*/\n var songDurationHours = \"00\";\n\n /*\n\t\t\tIf the song duration minutes is less than 10, we add a leading 0.\n\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n\n /*\n\t\t\tIf there is more than 60 minutes in the song, then we\n\t\t\textract the hours.\n\t\t*/\n if (songDurationMinutes >= 60) {\n songDurationHours = Math.floor(songDurationMinutes / 60);\n songDurationMinutes = songDurationMinutes % 60;\n\n /*\n\t\t\t\tIf the song duration minutes is less than 10 we append\n\t\t\t\tthe additional 0.\n\t\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean song duration object and send back the appropriate information.\n\t\t*/\n songDuration.seconds = isNaN(songDurationSeconds)\n ? \"00\"\n : songDurationSeconds;\n songDuration.minutes = isNaN(songDurationMinutes)\n ? \"00\"\n : songDurationMinutes;\n songDuration.hours = isNaN(songDurationHours)\n ? \"00\"\n : songDurationHours.toString();\n\n return songDuration;\n }\n\n /**\n * Computes the song completion percentage.\n *\n * @access public\n */\n function computeSongCompletionPercentage() {\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Sets the current time for the audio.\n *\n * @access public\n */\n function setCurrentTime(time) {\n /*\n If the song is not live, we can set the current time.\n */\n if (!config.active_metadata.live) {\n /*\n Makes sure the number is finite to set the time.\n */\n if (isFinite(time)) {\n config.audio.currentTime = time;\n }\n }\n }\n\n /**\n * Defines what is returned by the module\n */\n return {\n computeCurrentTimes: computeCurrentTimes,\n computeSongDuration: computeSongDuration,\n computeSongCompletionPercentage: computeSongCompletionPercentage,\n setCurrentTime: setCurrentTime\n };\n})();\n\nexport default Time;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/time.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Visual Handler for Buffered Progress Elements\n *\n * @module visual/BufferedProgressElements\n */\nlet BufferedProgressElements = (function() {\n /**\n * Syncs the buffered progress bars to the current percentage in the config\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Sync the global song buffered progress elements.\n */\n function syncGlobal() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n let playlist = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && song == null && !isNaN(config.buffered)) {\n songBufferedProgressBars[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the playlist song buffered progress elements.\n */\n function syncPlaylist() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsPlaylist.length; i++) {\n let song = songBufferedProgressBarsPlaylist[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null && !isNaN(config.buffered)) {\n songBufferedProgressBarsPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song song buffered progress elements.\n */\n function syncSong() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongs = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongs.length; i++) {\n let playlist = songBufferedProgressBarsSongs[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null && !isNaN(config.buffered)) {\n songBufferedProgressBarsSongs[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song in playlist song buffered progress elements.\n */\n function syncSongInPlaylist() {\n let activePlaylistIndex =\n config.active_playlist != null && config.active_playlist != \"\"\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongsInPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongsInPlaylist.length; i++) {\n if (!isNaN(config.buffered)) {\n songBufferedProgressBarsSongsInPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sets all of the song buffered progress bars to 0\n *\n * @access public\n */\n function reset() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n let songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n songBufferedProgressBars[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n reset: reset\n };\n})();\n\nexport default BufferedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/bufferedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Ended Module. Handles the ended event on the audio.\n *\n * @module events/Ended\n */\nlet Ended = (function() {\n /**\n * When the song has ended, handles what to do next\n *\n * HANDLER FOR: ended\n *\n * @access public\n */\n function handle() {\n /*\n Sets the time out for song ended. This determines if\n we should go to the next song or delay between songs.\n */\n setTimeout(function() {\n /*\n If we continue next, we should move to the next song in the playlist.\n */\n if (config.continue_next) {\n /*\n\t\t\t\t\tIf the active playlist is not set, we set the\n\t\t\t\t\tnext song that's in the songs array.\n\t\t\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext(true);\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist, true);\n }\n } else {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\t\t\tStops the active song.\n\t\t\t\t\t*/\n Core.stop();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n }, config.delay);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Ended;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/ended.js","/*\n\tImport the necessary classes and config to use\n\twith the events.\n*/\nimport config from \"../config.js\";\n\n/**\n * Imports all of the handler objects used by the events.\n */\nimport KeyDown from \"./keydown.js\";\nimport TimeUpdate from \"./timeUpdate.js\";\nimport Ended from \"./ended.js\";\nimport Progress from \"./progress.js\";\nimport Play from \"./play.js\";\nimport Pause from \"./pause.js\";\nimport PlayPause from \"./playPause.js\";\nimport Stop from \"./stop.js\";\nimport Mute from \"./mute.js\";\nimport VolumeUp from \"./volumeUp.js\";\nimport VolumeDown from \"./volumeDown.js\";\nimport SongSlider from \"./songSlider.js\";\nimport VolumeSlider from \"./volumeSlider.js\";\nimport Next from \"./next.js\";\nimport Prev from \"./prev.js\";\nimport Repeat from \"./repeat.js\";\nimport RepeatSong from \"./repeatSong.js\";\nimport PlaybackSpeed from \"./playbackSpeed.js\";\nimport Shuffle from \"./shuffle.js\";\nimport SkipTo from \"./skipTo.js\";\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * Imports the utility classes used by the evnets.\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Events Module. Handles all of the events we listen to in\n * AmplitudeJS.\n *\n * @module events/Events\n */\nvar Events = (function() {\n /**\n * Initializes the handlers for the events listened to by Amplitude\n *\n * @access public\n */\n function initialize() {\n /*\n\t\t\tWrite out debug message\n\t\t*/\n Debug.writeMessage(\"Beginning initialization of event handlers..\");\n\n /*\n\t\t\tSets flag that the screen is moving and not a tap\n\t\t*/\n document.addEventListener(\"touchmove\", function() {\n config.is_touch_moving = true;\n });\n\n /*\n\t\t\tOn touch end if it was a touch move event, set moving to\n\t\t\tfalse\n\t\t*/\n document.addEventListener(\"touchend\", function() {\n if (config.is_touch_moving) {\n config.is_touch_moving = false;\n }\n });\n\n /*\n\t\t\tOn time update for the audio element, update visual displays that\n\t\t\trepresent the time on either a visualized element or time display.\n\t\t*/\n bindTimeUpdate();\n\n /*\n\t\t\tBinds key down event handlers for matching key codes to functions.\n\t\t*/\n bindKeyDownEventHandlers();\n\n /*\n\t\t\tWhen the audio element has ended playing, we handle the song\n\t\t\tending. In a single song or multiple modular song instance,\n\t\t\tthis just synchronizes the visuals for time and song time\n\t\t\tvisualization, but for a playlist it determines whether\n\t\t\tit should play the next song or not.\n\t\t*/\n bindSongEnded();\n\n /*\n\t\t\tBinds progress event so we can see how much of the song is loaded.\n\t\t*/\n bindProgress();\n\n /*\n\t\t\tBinds 'amplitude-play' event handlers\n\t\t*/\n bindPlay();\n\n /*\n\t\t\tBinds 'amplitude-pause' event handlers.\n\t\t*/\n bindPause();\n\n /*\n\t\t\tBinds 'amplitude-play-pause' event handlers.\n\t\t*/\n bindPlayPause();\n\n /*\n\t\t\tBinds 'amplitude-stop' event handlers.\n\t\t*/\n bindStop();\n\n /*\n\t\t\tBinds 'amplitude-mute' event handlers.\n\t\t*/\n bindMute();\n\n /*\n\t\t\tBinds 'amplitude-volume-up' event handlers\n\t\t*/\n bindVolumeUp();\n\n /*\n\t\t\tBinds 'amplitude-volume-down' event handlers\n\t\t*/\n bindVolumeDown();\n\n /*\n\t\t\tBinds 'amplitude-song-slider' event handlers\n\t\t*/\n bindSongSlider();\n\n /*\n\t\t\tBinds 'amplitude-volume-slider' event handlers.\n\t\t*/\n bindVolumeSlider();\n\n /*\n\t\t\tBinds 'amplitude-next' event handlers.\n\t\t*/\n bindNext();\n\n /*\n\t\t\tBinds 'amplitude-prev' event handlers.\n\t\t*/\n bindPrev();\n\n /*\n\t\t\tBinds 'amplitude-shuffle' event handlers.\n\t\t*/\n bindShuffle();\n\n /*\n\t\t\tBinds 'amplitude-repeat' event handlers.\n\t\t*/\n bindRepeat();\n\n /*\n\t\t\tBinds 'amplitude-repeat-song' event handlers.\n\t\t*/\n bindRepeatSong();\n\n /*\n\t\t\tBinds 'amplitude-playback-speed' event handlers.\n\t\t*/\n bindPlaybackSpeed();\n\n /*\n\t\t\tBinds 'amplitude-skip-to' event handlers.\n\t\t*/\n bindSkipTo();\n\n /*\n\t\t\tBinds `canplaythrough` event to build the waveform.\n\t\t*/\n bindCanPlayThrough();\n }\n\n /**\n * On time update for the audio element, update visual displays that\n * represent the time on either a visualized element or time display.\n *\n * @access private\n */\n function bindTimeUpdate() {\n /*\n\t\t\tBind for time update\n\t\t*/\n config.audio.removeEventListener(\"timeupdate\", TimeUpdate.handle);\n config.audio.addEventListener(\"timeupdate\", TimeUpdate.handle);\n\n /*\n\t\t\tBind for duration change\n\t\t*/\n config.audio.removeEventListener(\"durationchange\", TimeUpdate.handle);\n config.audio.addEventListener(\"durationchange\", TimeUpdate.handle);\n }\n\n /**\n * On keydown, we listen to what key got pressed so we can map the key to\n * a function. This allows the user to map pause and play, next, etc. to key\n * presses.\n *\n * @access private\n */\n function bindKeyDownEventHandlers() {\n document.removeEventListener(\"keydown\", KeyDown.handle);\n document.addEventListener(\"keydown\", KeyDown.handle);\n }\n\n /**\n * When the audio element has ended playing, we handle the song\n * ending. In a single song or multiple modular song instance,\n * this just synchronizes the visuals for time and song time\n * visualization, but for a playlist it determines whether\n * it should play the next song or not.\n *\n * @access private\n */\n function bindSongEnded() {\n config.audio.removeEventListener(\"ended\", Ended.handle);\n config.audio.addEventListener(\"ended\", Ended.handle);\n }\n\n /**\n * As the audio is loaded, the progress event gets fired. We bind into this\n * to grab the buffered percentage of the song. We can then add more elements\n * to show the buffered amount.\n *\n * @access private\n */\n function bindProgress() {\n config.audio.removeEventListener(\"progress\", Progress.handle);\n config.audio.addEventListener(\"progress\", Progress.handle);\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play buttons\n *\n * @access private\n */\n function bindPlay() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play\n\t\t*/\n var play_classes = document.getElementsByClassName(\"amplitude-play\");\n\n /*\n\t\t\tIterates over all of the play classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_classes[i].removeEventListener(\"touchend\", Play.handle);\n play_classes[i].addEventListener(\"touchend\", Play.handle);\n } else {\n play_classes[i].removeEventListener(\"click\", Play.handle);\n play_classes[i].addEventListener(\"click\", Play.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS pause buttons.\n *\n * @access private\n */\n function bindPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-pause\n\t\t*/\n var pause_classes = document.getElementsByClassName(\"amplitude-pause\");\n\n /*\n\t\t\tIterates over all of the pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n pause_classes[i].removeEventListener(\"touchend\", Pause.handle);\n pause_classes[i].addEventListener(\"touchend\", Pause.handle);\n } else {\n pause_classes[i].removeEventListener(\"click\", Pause.handle);\n pause_classes[i].addEventListener(\"click\", Pause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play pause buttons\n *\n * @access private\n */\n function bindPlayPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play-pause\n\t\t*/\n var play_pause_classes = document.getElementsByClassName(\n \"amplitude-play-pause\"\n );\n\n /*\n\t\t\tIterates over all of the play/pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_pause_classes[i].removeEventListener(\"touchend\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"touchend\", PlayPause.handle);\n } else {\n play_pause_classes[i].removeEventListener(\"click\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"click\", PlayPause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS stop buttons\n *\n * @access private\n */\n function bindStop() {\n /*\n\t\t\tGets all of the elements with the class amplitude-stop\n\t\t*/\n var stop_classes = document.getElementsByClassName(\"amplitude-stop\");\n\n /*\n\t\t\tIterates over all of the stop classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < stop_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n stop_classes[i].removeEventListener(\"touchend\", Stop.handle);\n stop_classes[i].addEventListener(\"touchend\", Stop.handle);\n } else {\n stop_classes[i].removeEventListener(\"click\", Stop.handle);\n stop_classes[i].addEventListener(\"click\", Stop.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS mute buttons\n *\n * @access private\n */\n function bindMute() {\n /*\n\t\t\tGets all of the elements with the class amplitue-mute\n\t\t*/\n var mute_classes = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterates over all of the mute classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < mute_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n mute_classes[i].removeEventListener(\"touchend\", Mute.handle);\n mute_classes[i].addEventListener(\"touchend\", Mute.handle);\n }\n } else {\n mute_classes[i].removeEventListener(\"click\", Mute.handle);\n mute_classes[i].addEventListener(\"click\", Mute.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Up Buttons\n *\n * @access private\n */\n function bindVolumeUp() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-up\n\t\t*/\n var volume_up_classes = document.getElementsByClassName(\n \"amplitude-volume-up\"\n );\n\n /*\n\t\t\tIterates over all of the volume up classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_up_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_up_classes[i].removeEventListener(\"touchend\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"touchend\", VolumeUp.handle);\n }\n } else {\n volume_up_classes[i].removeEventListener(\"click\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"click\", VolumeUp.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Down Buttons\n *\n * @access private\n */\n function bindVolumeDown() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-down\n\t\t*/\n var volume_down_classes = document.getElementsByClassName(\n \"amplitude-volume-down\"\n );\n\n /*\n\t\t\tIterates over all of the volume down classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_down_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_down_classes[i].removeEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n volume_down_classes[i].addEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n }\n } else {\n volume_down_classes[i].removeEventListener(\"click\", VolumeDown.handle);\n volume_down_classes[i].addEventListener(\"click\", VolumeDown.handle);\n }\n }\n }\n\n /**\n * Binds change and input events for AmplitudeJS Song Slider Inputs\n *\n * @access private\n */\n function bindSongSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-song-slider\n\t\t*/\n var song_sliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the song slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < song_sliders.length; i++) {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n song_sliders[i].removeEventListener(\"change\", SongSlider.handle);\n song_sliders[i].addEventListener(\"change\", SongSlider.handle);\n } else {\n song_sliders[i].removeEventListener(\"input\", SongSlider.handle);\n song_sliders[i].addEventListener(\"input\", SongSlider.handle);\n }\n }\n }\n\n /**\n * Binds change and input events fro AmplitudeJS Volume Slider inputs\n *\n * @access private\n */\n function bindVolumeSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-slider\n */\n var volume_sliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < volume_sliders.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n volume_sliders[i].removeEventListener(\"change\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"change\", VolumeSlider.handle);\n } else {\n volume_sliders[i].removeEventListener(\"input\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"input\", VolumeSlider.handle);\n }\n }\n }\n }\n\n /**\n * Binds click and touchend events fro AmplitudeJS Next buttons\n *\n * @access private\n */\n function bindNext() {\n /*\n\t\t\tGets all of the elements with the class amplitude-next\n */\n var next_classes = document.getElementsByClassName(\"amplitude-next\");\n\n /*\n\t\t\tIterates over all of the next classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < next_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n next_classes[i].removeEventListener(\"touchend\", Next.handle);\n next_classes[i].addEventListener(\"touchend\", Next.handle);\n } else {\n next_classes[i].removeEventListener(\"click\", Next.handle);\n next_classes[i].addEventListener(\"click\", Next.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS prev buttons.\n *\n * @access private\n */\n function bindPrev() {\n /*\n\t\t\tGets all of the elements with the class amplitude-prev\n\t\t*/\n var prev_classes = document.getElementsByClassName(\"amplitude-prev\");\n\n /*\n\t\t\tIterates over all of the prev classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < prev_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n prev_classes[i].removeEventListener(\"touchend\", Prev.handle);\n prev_classes[i].addEventListener(\"touchend\", Prev.handle);\n } else {\n prev_classes[i].removeEventListener(\"click\", Prev.handle);\n prev_classes[i].addEventListener(\"click\", Prev.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS shuffle buttons.\n *\n * @access private\n */\n function bindShuffle() {\n /*\n\t\t\tGets all of the elements with the class amplitude-shuffle\n\t\t*/\n var shuffle_classes = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterates over all of the shuffle classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < shuffle_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the shuffle control.\n\t\t\t*/\n shuffle_classes[i].classList.remove(\"amplitude-shuffle-on\");\n shuffle_classes[i].classList.add(\"amplitude-shuffle-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n shuffle_classes[i].removeEventListener(\"touchend\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"touchend\", Shuffle.handle);\n } else {\n shuffle_classes[i].removeEventListener(\"click\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"click\", Shuffle.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat buttons.\n *\n * @access private\n */\n function bindRepeat() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat\n\t\t*/\n var repeat_classes = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterates over all of the repeat classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_classes[i].removeEventListener(\"touchend\", Repeat.handle);\n repeat_classes[i].addEventListener(\"touchend\", Repeat.handle);\n } else {\n repeat_classes[i].removeEventListener(\"click\", Repeat.handle);\n repeat_classes[i].addEventListener(\"click\", Repeat.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat song buttons.\n *\n * @access private\n */\n function bindRepeatSong() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat-song\n\t\t*/\n var repeat_song_classes = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterates over all of the repeat song classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_song_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_song_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_song_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_song_classes[i].removeEventListener(\n \"touchend\",\n RepeatSong.handle\n );\n repeat_song_classes[i].addEventListener(\"touchend\", RepeatSong.handle);\n } else {\n repeat_song_classes[i].removeEventListener(\"click\", RepeatSong.handle);\n repeat_song_classes[i].addEventListener(\"click\", RepeatSong.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS playback speed buttons\n *\n * @access private\n */\n function bindPlaybackSpeed() {\n /*\n\t\t\tGets all of the elements with the class amplitude-playback-speed\n\t\t*/\n var playback_speed_classes = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < playback_speed_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n playback_speed_classes[i].removeEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n } else {\n playback_speed_classes[i].removeEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS skip to buttons.\n *\n * @access private\n */\n function bindSkipTo() {\n /*\n\t\t\tGets all of the skip to elements with the class 'amplitude-skip-to'\n\t\t*/\n var skipToClasses = document.getElementsByClassName(\"amplitude-skip-to\");\n\n /*\n\t\t\tIterates over all of the skip to classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it's a click.\n\t\t*/\n for (var i = 0; i < skipToClasses.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n skipToClasses[i].removeEventListener(\"touchend\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"touchend\", SkipTo.handle);\n } else {\n skipToClasses[i].removeEventListener(\"click\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"click\", SkipTo.handle);\n }\n }\n }\n\n /**\n * Binds can play through to a song.\n *\n * @access private\n */\n function bindCanPlayThrough() {\n if (WaveForm.determineIfUsingWaveforms()) {\n config.audio.removeEventListener(\"canplaythrough\", WaveForm.build);\n config.audio.addEventListener(\"canplaythrough\", WaveForm.build);\n }\n }\n\n /*\n\t\tReturns the public facing functions.\n\t*/\n return {\n initialize: initialize\n };\n})();\n\nexport default Events;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/events.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the core of AmplitudeJS\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Shuffle Utility\n * @module utilities/Shuffle\n */\nimport Shuffle from \"../utilities/shuffler.js\";\n\n/**\n * Imports the Repeater Utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Repeat Elements Visual Handler\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Imports the Play Pause Elements Visual Handler\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Key Down event handler\n *\n * @module events/KeyDown\n */\nlet KeyDown = (function() {\n /**\n * When the keydown event is fired, we determine which function should be run\n * based on what was passed in.\n *\n * HANDLER FOR: keydown\n *\n * @access public\n * @prop {object} event The event object being passed in.\n */\n function handle(event) {\n runKeyEvent(event.which);\n }\n\n /**\n * Runs an event on key down\n *\n * @access public\n * @param {number} key \t- The key code the event is bound to.\n */\n function runKeyEvent(key) {\n /*\n\t\t\tChecks to see if the user bound an event to the code pressed.\n\t\t*/\n if (config.bindings[key] != undefined) {\n /*\n\t\t\t\tDetermine which event should be run if bound.\n\t\t\t*/\n switch (config.bindings[key]) {\n /*\n\t\t\t\t\tFires a play pause event.\n\t\t\t\t*/\n case \"play_pause\":\n runPlayPauseKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a next event.\n\t\t\t\t*/\n case \"next\":\n runNextKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a previous event.\n\t\t\t\t*/\n case \"prev\":\n runPrevKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a stop event.\n\t\t\t\t*/\n case \"stop\":\n runStopKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a shuffle event.\n\t\t\t\t*/\n case \"shuffle\":\n runShuffleKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a repeat event.\n\t\t\t\t*/\n case \"repeat\":\n runRepeatKeyDownEvent();\n break;\n }\n }\n }\n\n /**\n * Runs the play pause method for key down.\n */\n function runPlayPauseKeyDownEvent() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Runs the next method for key down.\n */\n function runNextKeyDownEvent() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the previous method for key down.\n */\n function runPrevKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the stop method for key down.\n */\n function runStopKeyDownEvent() {\n /*\n Syncs all of the play pause elements to pause.\n */\n PlayPauseElements.syncToPause();\n\n /*\n Stops the active song.\n */\n Core.stop();\n }\n\n /**\n * Runs the shuffle method for key down.\n */\n function runShuffleKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n Shuffle.toggleShuffle();\n } else {\n Shuffle.toggleShufflePlaylist(config.active_playlist);\n }\n }\n\n /**\n * Run the repeat method for key down.\n */\n function runRepeatKeyDownEvent() {\n /*\n Toggles the repeat\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Returns the public methods for the handler.\n */\n return {\n handle: handle\n };\n})();\n\nexport default KeyDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/keydown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a mute event.\n * @module events/Mute\n */\nlet Mute = (function() {\n /**\n * Handles an event for a mute element\n *\n * HANDLER FOR: class=\"amplitude-mute\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tIf the current volume in the config is 0, we set the volume to the\n\t\t\t\tpre_mute level. This means that the audio is already muted and\n\t\t\t\tneeds to be restored to the pre_mute level.\n\n\t\t\t\tOtherwise, we set pre_mute volume to the current volume\n\t\t\t\tand set the config volume to 0, muting the audio.\n\t\t\t*/\n if (config.volume == 0) {\n Core.setVolume(config.pre_mute_volume);\n } else {\n config.pre_mute_volume = config.volume;\n Core.setVolume(0);\n }\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\t\tSyncs the volume sliders so the visuals align up with the functionality.\n\t\t\t\tIf the volume is at 0, then the sliders should represent that so the user\n\t\t\t\thas the right starting point.\n\t\t\t*/\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Mute;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/mute.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core module.\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Play Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Next Event Handler\n *\n * @module events/Next\n */\nlet Next = (function() {\n /**\n * Handles an event on the next button\n *\n * HANDLER FOR: class=\"amplitude-next\"\n *\n * GLOBAL: class=\"amplitude-next\"\n * PLAYLIST: class=\"amplitude-next\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global next.\n */\n if (playlist == null) {\n handleGlobalNext();\n }\n\n /*\n If the playlist is set, we handle the playlist next.\n */\n if (playlist != null) {\n handlePlaylistNext(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global enxt button.\n *\n * @access private\n */\n function handleGlobalNext() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set next on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a next playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the next for.\n */\n function handlePlaylistNext(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setNextPlaylist(playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the next song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Next;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/next.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the ConfigState module.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the pause events\n * @module events/Pause\n */\nlet Pause = (function() {\n /**\n * Handles an event on a pause button\n *\n * HANDLER FOR: class=\"amplitude-pause\"\n *\n * GLOBAL: class=\"amplitude-pause\"\n * PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple pause classes on the page. In that\n case it is possible the user could click a different pause\n class.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global pause button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPause();\n }\n\n /*\n Handle a playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPause(playlistAttribute);\n }\n\n /*\n Handle a song pause button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPause(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPause(playlistAttribute, songIndexAttribute);\n }\n }\n }\n\n /**\n * Handles global pause button which pauses whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPause() {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n */\n function handlePlaylistPause(playlist) {\n /*\n Checks to see if the active playlist is the same\n */\n if (config.active_playlist == playlist) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song pause.\n *\n * @access private\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongPause(song) {\n /*\n Checks to see if the active playlist is null and the song matches\n the active index.\n */\n if (\n (config.active_playlist == \"\" || config.active_playlist == null) &&\n config.active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song in playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongInPlaylistPause(playlist, song) {\n /*\n Checks to see if the active song matches the song and the\n active playlist matches the playlist. This means the pause button is\n for the song in the playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Pause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/pause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state utility.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play events\n * @module events/Play\n */\nlet Play = (function() {\n /**\n * Handles an event on a play button in Amplitude.\n *\n * HANDLER FOR: class=\"amplitude-play\"\n *\n * GLOBAL: class=\"amplitude-play\"\n * PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple play classes on the page. In that\n case it is possible the user could click a different play\n class and change the song.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global play button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPlay();\n }\n\n /*\n Handle a playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPlay(playlistAttribute);\n }\n\n /*\n Handle a song play button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPlay(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPlay(playlistAttribute, songIndexAttribute);\n }\n }\n }\n\n /**\n * Handles global play button which plays whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPlay() {\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handle the playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n */\n function handlePlaylistPlay(playlist) {\n /*\n Checks if we have a new playlist.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n Sets the active playlist to what belongs to the playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n Plays the song.\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song play button.\n *\n * @access private\n * @param {integer} song The index of the song we are playing.\n */\n function handleSongPlay(song) {\n /*\n There can be multiple playlists on the page and there can be\n multiple songs on the page AND there can be songs in multiple\n playlists, so we have some checking to do.\n */\n\n /*\n Check to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n */\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n We then change the song to the index selected.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Check to see if the song has changed. If it has,\n set the active song. If it was in a playlist, the\n song wouldn't change here, since we already set the\n song when we checked for a playlist.\n */\n if (Checks.newSong(null, song)) {\n /*\n The song selected is different, so we change the\n song.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song in playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n * @param {integer} song The song the play button belongs to.\n */\n function handleSongInPlaylistPlay(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Play;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/play.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Import the config state utility.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play pause events\n * @module events/PlayPause\n */\nlet PlayPause = (function() {\n /**\n * Handles an event on a play/pause button\n *\n * HANDLER FOR: class=\"amplitude-play-pause\"\n *\n * GLOBAL: class=\"amplitude-play-pause\"\n * PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist and song from the element. It's alright if these\n are null.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n Handle a global play pause button\n */\n if (playlist == null && song == null) {\n handleGlobalPlayPause();\n }\n\n /*\n Handle a playlist play pause button\n */\n if (playlist != null && song == null) {\n handlePlaylistPlayPause(playlist);\n }\n\n /*\n Handle a song play pause button\n */\n if (playlist == null && song != null) {\n handleSongPlayPause(song);\n }\n\n /*\n Handle a song in playlist play pause button\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistPlayPause(playlist, song);\n }\n }\n }\n\n /**\n * Sets the main play pause buttons to the current state of the song.\n * @access private\n */\n function handleGlobalPlayPause() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} playlist The playlist the main play pause button controls\n */\n function handlePlaylistPlayPause(playlist) {\n /*\n The only thing that can change when you click a playlist\n play pause is the playlist. Main play pauses have no change\n in song, song play pauses can change playlist and song.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n If there's a new playlist, then we set the new playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0,\n true\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} song The index of the song being played/paused\n */\n function handleSongPlayPause(song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song, true);\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(null, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song, true);\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the song in playlist play pause buttons to the current\n * state of the song.\n * @access private\n * @param {string} playlist The playlist the song is a part of\n * @param {number} song The index of the song being played/paused\n */\n function handleSongInPlaylistPlayPause(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song,\n true\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song,\n true\n );\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlayPause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playPause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Core module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Playback Speed Visual Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * AmplitudeJS Playback Speed Event Handler\n *\n * @module events/PlaybackSpeed\n */\nlet PlaybackSpeed = (function() {\n /**\n * Handles an event on the playback speed button\n *\n * HANDLER FOR: class=\"amplitude-playback-speed\"\n *\n * @access public\n */\n function handle() {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tWe increment the speed by .5 everytime we click\n\t\t\t\tthe button to change the playback speed. Once we are\n\t\t\t\tactively playing back at 2, we start back at 1 which\n\t\t\t\tis normal speed.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n Core.setPlaybackSpeed(1.5);\n break;\n case 1.5:\n Core.setPlaybackSpeed(2);\n break;\n case 2:\n Core.setPlaybackSpeed(1);\n break;\n }\n\n /*\n\t\t\t\tVisually sync the playback speed.\n\t\t\t*/\n PlaybackSpeedElements.sync();\n }\n }\n\n /*\n Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlaybackSpeed;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playbackSpeed.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Prev Event Handler\n *\n * @module events/Prev\n */\nlet Prev = (function() {\n /**\n * Handles an event on the previous button\n *\n * HANDLER FOR: class=\"amplitude-prev\"\n *\n * GLOBAL: class=\"amplitude-prev\"\n * PLAYLIST: class=\"amplitude-prev\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global prev.\n */\n if (playlist == null) {\n handleGlobalPrev();\n }\n\n /*\n If the playlist is set, we handle the playlist prev.\n */\n if (playlist != null) {\n handlePlaylistPrev(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global previous button.\n *\n * @access private\n */\n function handleGlobalPrev() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set prev on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a previous playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the previous for.\n */\n function handlePlaylistPrev(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the previous song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Prev;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/prev.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the BufferedProgressElements visual handler\n * @module visual/bufferedProgressElements.js\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * AmplitudeJS Event Handler for progress\n *\n * @module events/Progress\n */\nlet Progress = (function() {\n /**\n * As the song is buffered, we can display the buffered percentage in\n * a progress bar.\n *\n * HANDLER FOR: progress\n *\n * @access public\n */\n function handle() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n /*\n Set the computed song buffered value to the config.\n */\n config.buffered = (bufferedEnd / duration) * 100;\n }\n\n /*\n Sync the buffered progress bars.\n */\n BufferedProgressElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Progress;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/progress.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeater utility module.\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the visual repeat elements module\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Repeat Event Handler\n *\n * @module events/Repeat\n */\nlet Repeat = (function() {\n /**\n * Handles an event on the repeat button\n *\n * HANDLER FOR: class=\"amplitude-repeat\"\n *\n * GLOBAL: class=\"amplitude-repeat\"\n * PLAYLIST: class=\"amplitude-repeat\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global repeat.\n */\n if (playlist == null) {\n handleGlobalRepeat();\n }\n\n /*\n If the playlist is set, we handle the playlist repeat.\n */\n if (playlist != null) {\n handlePlaylistRepeat(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global repeat button.\n *\n * @access private\n */\n function handleGlobalRepeat() {\n /*\n Sets repeat to the opposite of what it was set to\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Handles an event on a playlist repeat button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the repeat store.\n */\n function handlePlaylistRepeat(playlist) {\n /*\n Sets repeat to the opposite of what it was set to for the playlist.\n */\n Repeater.setRepeatPlaylist(!config.playlists[playlist].repeat, playlist);\n\n /*\n Visually sync playlist repeat\n */\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Repeat;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeat.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeat utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Handles an event on the Amplitude Repeat Song.\n *\n * @module events/RepeatSong\n */\nlet RepeatSong = (function() {\n /**\n * Handles an event on the repeat song button\n *\n * HANDLER FOR: 'amplitude-repeat-song'\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets repeat song to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default RepeatSong;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeatSong.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the shuffler utility\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * Imports the visual shuffle elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Handles all of the shuffle events\n * @module events/Shuffle\n */\nlet Shuffle = (function() {\n /**\n * Handles an event on the shuffle button\n *\n * HANDLER FOR: class=\"amplitude-shuffle\"\n *\n * GLOBAL: class=\"amplitude-shuffle\"\n * PLAYLIST: class=\"amplitude-shuffle\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist attribute\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n\t\t\t\tCheck to see if the shuffle button belongs to a playlist\n\t\t\t*/\n if (playlist == null) {\n handleGlobalShuffle();\n } else {\n handlePlaylistShuffle(playlist);\n }\n }\n }\n\n /**\n * Handles the event on the global shuffle button.\n */\n function handleGlobalShuffle() {\n /*\n Either shuffles or removes shuffle on the global state.\n */\n Shuffler.toggleShuffle();\n\n /*\n Visualize the shuffle state change.\n */\n ShuffleElements.syncMain(config.shuffle_on);\n }\n\n /**\n * Handles the event on the playlist shuffle button.\n *\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function handlePlaylistShuffle(playlist) {\n /*\n Either shuffles or removes shuffle on the playlist state.\n */\n Shuffler.toggleShufflePlaylist(playlist);\n\n /*\n Visually sync the playlist shuffle statuses.\n */\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Shuffle;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/shuffle.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles the skip to event.\n *\n * @module events/SkipTo\n */\nlet SkipTo = (function() {\n /**\n * Handles an event on a skip to button.\n *\n * HANDLER FOR: class=\"amplitude-skip-to\"\n *\n * GLOBAL: class=\"amplitude-skip-to\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n * PLAYLIST: class=\"amplitude-skip-to\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Extracts the needed attributes from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let songIndex = this.getAttribute(\"data-amplitude-song-index\");\n let location = this.getAttribute(\"data-amplitude-location\");\n\n /*\n If the location is null, write a message. We can't skip to a location\n that is null\n */\n if (location == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the song index is null, write a debug message. We can't skip to a location\n of a null song.\n */\n if (songIndex == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the location and song index are set, continue.\n */\n if (location != null && songIndex != null) {\n /*\n \t\t\t\tDetermines if the skip to button is in the scope of a playlist.\n \t\t\t*/\n if (playlist == null) {\n handleSkipToSong(parseInt(songIndex), parseInt(location));\n } else {\n handleSkipToPlaylist(\n playlist,\n parseInt(songIndex),\n parseInt(location)\n );\n }\n }\n }\n }\n\n /**\n * Handles the skipping to a specific song\n *\n * @access private\n * @param {string} songIndex - The index of the song being skipped to\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToSong(songIndex, location) {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Handles the skipping to a song that's in a playlist.\n *\n * @access private\n * @param {string} playlist - The playlist being skipped to\n * @param {string} songIndex - The index of the song in the playlist\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToPlaylist(playlist, songIndex, location) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SkipTo;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/skipTo.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the time utility\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the song slider elements.\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Handles the song slider to event.\n *\n * @module events/SongSlider\n */\nlet SongSlider = (function() {\n /**\n * Handles a song slider element.\n *\n * HANDLER FOR: class=\"amplitude-song-slider\"\n *\n * GLOBAL: class=\"amplitude-song-slider\"\n * PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-song-slider\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tGets the percentage of the song we will be setting the location for.\n\t\t*/\n let locationPercentage = this.value;\n\n /*\n Computes the time in seconds for the current song.\n */\n let computedTime = config.audio.duration * (locationPercentage / 100);\n\n /*\n Gets the attributes for playlist and index for the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n If no playlist or song is defined, then it's a global song slider.\n */\n if (playlist == null && song == null) {\n handleGlobalSongSlider(computedTime, locationPercentage);\n }\n\n /*\n If a playlist but no song is defined, then it's playlist slider.\n */\n if (playlist != null && song == null) {\n handlePlaylistSongSlider(computedTime, locationPercentage, playlist);\n }\n\n /*\n If no playlist but a song is defined, then it's a song slider.\n */\n if (playlist == null && song != null) {\n handleSongSongSlider(computedTime, locationPercentage, song);\n }\n\n /*\n If playlist and song are defined then it's a song in a playlist\n slider.\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n song\n );\n }\n }\n\n /**\n * Handles a change on a global audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n */\n function handleGlobalSongSlider(computedTime, locationPercentage) {\n /*\n\t\t\tIf the active song is not live, set the current time and adjust the slider.\n\t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n config.active_index\n );\n }\n }\n\n /**\n * Handles a change on a playlist audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {string} playlist = The playlist the song slider belongs to.\n */\n function handlePlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist\n ) {\n /*\n\t\t\tWe don't want to song slide a playlist that's not the\n\t\t\tactive placylist.\n\t\t*/\n if (config.active_playlist == playlist) {\n /*\n \t\t\tIf the active song is not live, set the current time\n \t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n playlist,\n config.active_index\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongSongSlider(computedTime, locationPercentage, songIndex) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected.\n */\n if (config.active_index == songIndex && config.active_playlist == null) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n songIndex\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} playlist = The playlist the song belongs to.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n songIndex\n ) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected and the active playlist is the same\n as the playlist selected.\n */\n if (\n config.playlists[playlist].active_index == songIndex &&\n config.active_playlist == playlist\n ) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(locationPercentage, playlist, songIndex);\n }\n }\n }\n\n /*\n Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SongSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/songSlider.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state module.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Handles all of the stop events\n * @module events/Stop\n */\nlet Stop = (function() {\n /**\n * Handles an event on a stop element.\n *\n * HANDLER FOR: class=\"amplitude-stop\"\n *\n * @access public\n */\n function handle() {\n /*\n If touch is not moving, we run. We don't want to accidentally press\n stop if touch is moving.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets all of the play/pause buttons to pause\n\t\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\t\tStops the active song.\n\t\t\t*/\n Core.stop();\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Stop;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/stop.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Buffered Progress Elements visual class\n * @module visual/bufferedProgressElements\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * Imports the Time Elements visual class.\n * @module visual/timeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the Song Slider Elements visual class.\n * @module visual/songSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements visual class.\n * @module visual/songPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time utility class\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the Callback utility class\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Event Handler for Time Update\n *\n * @module events/TimeUpdate\n */\nlet TimeUpdate = (function() {\n /**\n * When the time updates on the active song, we sync the current time displays\n *\n * HANDLER FOR: timeupdate\n *\n * @access public\n */\n function handle() {\n /*\n Computes the buffered time.\n */\n computeBufferedTime();\n\n /*\n Sync the buffered progress elements.\n */\n BufferedProgressElements.sync();\n\n /*\n Updates the current time information.\n */\n updateTimeInformation();\n\n /*\n Run time callbacks\n */\n runTimeCallbacks();\n }\n\n /**\n * Computes the buffered time\n */\n function computeBufferedTime() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n config.buffered = (bufferedEnd / duration) * 100;\n }\n }\n\n /**\n * Updates the current time information.\n * @access private\n */\n function updateTimeInformation() {\n /*\n If the current song is not live, then\n we can update the time information. Otherwise the\n current time updates wouldn't mean much since the time\n is infinite.\n */\n if (!config.active_metadata.live) {\n /*\n Compute the current time\n */\n let currentTime = Time.computeCurrentTimes();\n\n /*\n Compute the song completion percentage\n */\n let songCompletionPercentage = Time.computeSongCompletionPercentage();\n\n /*\n Computes the song duration\n */\n let songDuration = Time.computeSongDuration();\n\n /*\n Sync the current time elements with the current\n location of the song and the song duration elements with\n the duration of the song.\n */\n TimeElements.syncCurrentTimes(currentTime);\n\n /*\n Sync the song slider elements.\n */\n SongSliderElements.sync(\n songCompletionPercentage,\n config.active_playlist,\n config.active_index\n );\n\n /*\n Sync the song played progress elements.\n */\n SongPlayedProgressElements.sync(songCompletionPercentage);\n\n /*\n Sync the duration time elements.\n */\n TimeElements.syncDurationTimes(currentTime, songDuration);\n }\n }\n\n /**\n * Runs a callback at a certain time in the song.\n */\n function runTimeCallbacks() {\n /*\n Gets the current seconds into the song.\n */\n let currentSeconds = Math.floor(config.audio.currentTime);\n\n /*\n Checks to see if there is a callback at the certain seconds into the song.\n */\n if (\n config.active_metadata.time_callbacks != undefined &&\n config.active_metadata.time_callbacks[currentSeconds] != undefined\n ) {\n /*\n Checks to see if the callback has been run. Since the time updates more than\n one second, we don't want the callback to run X times.\n */\n if (!config.active_metadata.time_callbacks[currentSeconds].run) {\n config.active_metadata.time_callbacks[currentSeconds].run = true;\n config.active_metadata.time_callbacks[currentSeconds]();\n }\n } else {\n /*\n Iterate over all of the callbacks for a song. If the song has one, we flag\n the run as false. This occurs because we have passed the active second for\n the callback, so we flag it as not run. It will either run again if the user\n seeks back or not run in the future.\n */\n for (var seconds in config.active_metadata.time_callbacks) {\n if (config.active_metadata.time_callbacks.hasOwnProperty(seconds)) {\n config.active_metadata.time_callbacks[seconds].run = false;\n }\n }\n }\n }\n /**\n * Returns public functions\n */\n return {\n handle: handle\n };\n})();\n\nexport default TimeUpdate;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/timeUpdate.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume down event.\n * @module events/VolumeDown\n */\nlet VolumeDown = (function() {\n /**\n * Handles a click on a volume down element.\n *\n * HANDLER FOR: class=\"amplitude-volume-down\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume - config.volume_increment > 0) {\n volume = config.volume - config.volume_increment;\n } else {\n volume = 0;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeDown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeSlider\n */\nlet VolumeSlider = (function() {\n /**\n * Handles a change on the volume slider\n *\n * HANDLER FOR: class=\"amplitude-volume-slider\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tCalls the core function to set the volume to the computed value\n\t\t\tbased on the user's intent.\n\t\t*/\n Core.setVolume(this.value);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync the volume slider locations\n\t\t*/\n VolumeSliderElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeSlider.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeUp\n */\nlet VolumeUp = (function() {\n /**\n * Handles a click on a volume up element.\n *\n * HANDLER FOR: class=\"amplitude-volume-up\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume + config.volume_increment <= 100) {\n volume = config.volume + config.volume_increment;\n } else {\n volume = 100;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeUp;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeUp.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS FX Module. Helps with configuring and setting up visualizations\n * and any other features of the Web Audio API that Amplitude takes advantage\n * of.\n *\n * @module fx/FX\n */\nlet Fx = (function() {\n /**\n * Configures the Web Audio API to work with AmplitudeJS\n */\n function configureWebAudioAPI() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n\n /*\n\t\t\tIf we have a context, the Web Audio API is available and we can continue,\n\t\t\totherwise, we alert the user if they have debug turned on.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tWeb Audio API is available, set the context in our config.\n\t\t\t*/\n config.context = new browserContext();\n \n /*\n\t\t\t\tCreate an analyzer that we will use in the context.\n\t\t\t*/\n config.analyser = config.context.createAnalyser();\n\n /*\n\t\t\t\tSet cross origin to anonymous so we have a better chance of being able\n\t\t\t\tto use the power of the Web Audio API.\n\t\t\t*/\n config.audio.crossOrigin = \"anonymous\";\n \n /*\n\t\t\t\tBind the source to the Javascript Audio Element.\n\t\t\t*/\n config.source = config.context.createMediaElementSource(config.audio);\n\n /*\n\t\t\t\tConnect the analyser to the source\n\t\t\t*/\n config.source.connect(config.analyser);\n\n /*\n\t\t\t\tConnect the context destination to the analyser.\n\t\t\t*/\n config.analyser.connect(config.context.destination);\n } else {\n AmplitudeHelpers.writeDebugMessage(\n \"Web Audio API is unavailable! We will set any of your visualizations with your back up definition!\"\n );\n }\n }\n\n /**\n * Determines if the web audio API is available or not.\n */\n function webAudioAPIAvailable() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n config.web_audio_api_available = false;\n\n /*\n\t\t\tDetermines if the Web Audio API is available or not.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is available\n\t\t\t*/\n config.web_audio_api_available = true;\n return true;\n } else {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is not available\n\t\t\t*/\n config.web_audio_api_available = false;\n return false;\n }\n }\n\n /**\n * Determines if the user is using any of the web audio API features.\n */\n function determineUsingAnyFX(){\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if( waveforms.length > 0 || visualizationElements.length > 0 ){\n return true;\n }else{\n return false;\n }\n }\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n configureWebAudioAPI: configureWebAudioAPI,\n webAudioAPIAvailable: webAudioAPIAvailable,\n determineUsingAnyFX: determineUsingAnyFX\n };\n})();\n\nexport default Fx;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/fx.js","/**\n * @name \t\tAmplitudeJS\n * @author \tDan Pastori (Server Side Up) \n */\n/**\n * AmplitudeJS Initializer Module\n *\n * @module init/AmplitudeInitializer\n */\nimport Initializer from \"./init/init.js\";\n\n/****************************************************\n * Config\n ****************************************************/\n/**\n * Imports the config module\n * @module config\n */\nimport config from \"./config.js\";\n\n/****************************************************\n * Core\n ****************************************************/\n/**\n * AmplitudeJS Core Module\n *\n * @module core/Core\n */\nimport Core from \"./core/core.js\";\n\n/****************************************************\n * Utilities\n ****************************************************/\n/**\n * Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"./utilities/shuffler.js\";\n\n/**\n * Imports the config state module.\n * @module ConfigState\n */\nimport ConfigState from \"./utilities/configState.js\";\n\n/**\n * Imports the audio navigation\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"./utilities/audioNavigation.js\";\n\n/**\n * Repeater Module\n *\n * @module utilities/Repeater\n */\nimport Repeater from \"./utilities/repeater.js\";\n\n/**\n * Imports the checks\n * @module utilities/Checks\n */\nimport Checks from \"./utilities/checks.js\";\n\n/****************************************************\n * FX Modules\n ****************************************************/\n/**\n * Imports the visualizations module\n * @module fx/Visualizations\n */\nimport Visualizations from \"./fx/visualizations.js\";\n\n/****************************************************\n * Elements\n ****************************************************/\n/**\n * Visual Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"./visual/shuffleElements.js\";\n\n/**\n * Visual Repeat Elements\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"./visual/repeatElements.js\";\n\n/**\n * Song Slider Elements\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"./visual/songSliderElements.js\";\n\n/**\n * Song Played Progress Elements\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"./visual/songPlayedProgressElements.js\";\n\n/**\n * Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"./visual/timeElements.js\";\n\n/**\n * Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"./visual/playPauseElements.js\";\n\n/**\n * Meta Data Elements\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"./visual/metaDataElements.js\";\n\n/**\n * Playback Speed Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"./visual/playbackSpeedElements.js\";\n\nimport Debug from \"./utilities/debug.js\";\n\nimport SoundCloud from \"./soundcloud/soundcloud.js\";\n\n/**\n * Amplitude should just be an interface to the public functions.\n * Everything else should be handled by other objects\n *\n * @module Amplitude\n */\nlet Amplitude = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json );\n *\n * @access public\n * @param {object} userConfig \t- A JSON object of user defined values that helps configure and initialize AmplitudeJS.\n */\n function init(userConfig) {\n Initializer.initialize(userConfig);\n }\n\n /**\n * Returns the current config for AmplitudeJS\n */\n function getConfig() {\n return config;\n }\n\n /**\n * Binds new elements that were added to the page.\n *\n * Public Accessor: Amplitude.bindNewElements()\n *\n * @access public\n */\n function bindNewElements() {\n Initializer.rebindDisplay();\n }\n\n /**\n * Returns the active playlist.\n *\n * Public Accessor: Amplitude.getActivePlaylist()\n *\n * @access public\n */\n function getActivePlaylist() {\n return config.active_playlist;\n }\n\n /**\n * Returns the current playback speed.\n *\n * Public Accessor: Amplitude.getPlaybackSpeed()\n *\n * @access public\n */\n function getPlaybackSpeed() {\n return config.playback_speed;\n }\n\n /**\n * Sets the playback speed\n *\n * Public Accessor: Amplitude.setPlaybackSpeed( speed )\n *\n * @access public\n */\n function setPlaybackSpeed(speed) {\n /*\n Increments are set in .5 We only accept values\n 1, 1.5, 2\n\n 1 -> Regular Speed\n 1.5 -> 50% faster\n 2 -> Twice as fast\n */\n Core.setPlaybackSpeed(speed);\n\n /*\n Visually sync the playback speed.\n */\n PlaybackSpeedElements.sync();\n }\n\n /**\n * Gets the repeat state of the player.\n *\n * Public Accessor: Amplitude.getRepeat()\n *\n * @access public\n */\n function getRepeat() {\n return config.repeat;\n }\n\n /**\n * Gets the repeat state for a playlist\n *\n * Public Accessor: Amplitude.getRepeatPlaylist()\n *\n * @access public\n */\n function getRepeatPlaylist(playlistKey) {\n return config.playlists[playlistKey].repeat;\n }\n\n /**\n * Returns the shuffle state of the player.\n *\n * Public Accessor: Amplitude.getShuffle()\n *\n * @access public\n */\n function getShuffle() {\n return config.shuffle_on;\n }\n\n /**\n * Returns the shuffle state of the playlist.\n *\n * Public Accessor: Amplitude.getShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to see if it's shuffled or not.\n */\n function getShufflePlaylist(playlist) {\n return config.playlists[playlist].shuffle;\n }\n\n /**\n * Sets the shuffle state for the player.\n *\n * Public Accessor: Amplitude.setShuffle()\n *\n * @param {boolean} shuffle \t- True when we are shuffling the songs, false when we turn off shuffle.\n *\n * @access public\n */\n function setShuffle(shuffle) {\n Shuffler.setShuffle(shuffle);\n\n ShuffleElements.syncMain();\n }\n\n /**\n * Sets the shuffle state for the playlist\n *\n * Public Accessor: Amplitude.setShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} shuffle \t- True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n Shuffler.setShufflePlaylist(playlist, shuffle);\n\n ShuffleElements.syncMain();\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the player.\n *\n * Public Accessor: Amplitude.setRepeat()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song to be in.\n */\n function setRepeat(repeatState) {\n Repeater.setRepeat(repeatState);\n RepeatElements.syncRepeat();\n }\n\n /**\n * Sets the repeat state for a playlist.\n *\n * Public Accessor: Amplitude.setRepeatPlaylist( playlistKey )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} repeatState - The state you want the repeat playlist to be in.\n */\n function setRepeatPlaylist(playlist, repeatState) {\n Repeater.setRepeatPlaylist(repeatState, playlist);\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the song.\n *\n * Public Accessor: Amplitude.setRepeatSong()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song status to be in.\n */\n function setRepeatSong(repeatState) {\n if (!config.is_touch_moving) {\n /*\n\t\t\t Sets repeat to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Gets the default album art for the player\n *\n * Public Accessor: Amplitude.getDefaultAlbumArt()\n *\n * @access public\n */\n function getDefaultAlbumArt() {\n return config.default_album_art;\n }\n\n /**\n * Gets the default playlist art for the playlists\n *\n * Public Accessor: Amplitude.getDefaultPlaylistArt()\n *\n * @access public\n */\n function getDefaultPlaylistArt() {\n return config.default_playlist_art;\n }\n\n /**\n * Sets the default album art for the player\n *\n * Public Accessor: Amplitude.setDefaultAlbumArt( url )\n *\n * @access public\n * @param {string} url \t- A string representing the URL of the new default album art.\n */\n function setDefaultAlbumArt(url) {\n config.default_album_art = url;\n }\n\n /**\n * Sets the default playlist art for the player\n *\n * Public Accessor: Amplitude.setDefaultPlaylistArt( url )\n *\n * @access public\n * @param {string} url - A string representing the URL of the new default playlist art.\n */\n function setDefaultPlaylistArt(url) {\n config.default_plalist_art = url;\n }\n\n /**\n * Allows the user to get the percentage of the song played.\n *\n * Public Accessor: Amplitude.getSongPlayedPercentage();\n *\n * @access public\n */\n function getSongPlayedPercentage() {\n /*\n\t\t\tReturns the percentage of the song played.\n\t\t*/\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Allows the user to get the amount of seconds the song has played.\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongPlayedSeconds() {\n /*\n\t\t\tReturns the amount of seconds the song has played.\n\t\t*/\n return config.audio.currentTime;\n }\n\n /**\n * Allows the user to get the duration of the current song\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongDuration() {\n /*\n\t\t\tReturns the duration of the current song\n\t\t*/\n return config.audio.duration;\n }\n\n /**\n * Allows the user to set how far into the song they want to be. This is\n * helpful for implementing custom range sliders. Only works on the current song.\n *\n * Public Accessor: Amplitude.setSongPlayedPercentage( float );\n *\n * @access public\n * @param {number} percentage \t- The percentage of the song played\n */\n function setSongPlayedPercentage(percentage) {\n /*\n\t\t\tEnsures the percentage is a number and is between 0 and 100.\n\t\t*/\n if (typeof percentage == \"number\" && (percentage > 0 && percentage < 100)) {\n /*\n\t\t\t\t\tSets the current time of the song to the percentage.\n\t\t\t\t*/\n config.audio.currentTime = config.audio.duration * (percentage / 100);\n }\n }\n\n /**\n * Allows the user to turn on debugging.\n *\n * Public Accessor: Amplitude.setDebug( bool );\n *\n * @access public\n * @param {boolean} state \t\t- Turns debugging on and off.\n */\n function setDebug(state) {\n /*\n\t\t\tSets the global config debug on or off.\n\t\t*/\n config.debug = state;\n }\n\n /**\n * Returns the active song meta data for the user to do what is\n * needed.\n *\n * Public Accessor: Amplitude.getActiveSongMetadata();\n *\n * @access public\n * @returns {object} JSON Object with the active song information\n */\n function getActiveSongMetadata() {\n return config.active_metadata;\n }\n\n /**\n * Returns the active playlist meta data for the for the user to use.\n *\n * Public Accessor: Amplitude.getActivePlaylistMetadata();\n *\n * @access public\n * @returns {object} JSON representation for the active playlist\n */\n function getActivePlaylistMetadata() {\n return config.playlists[config.active_playlist];\n }\n\n /**\n * Returns a song in the songs array at that index\n *\n * Public Accessor: Amplitude.getSongAtIndex( song_index )\n *\n * @access public\n * @param {number} index \t- The integer for the index of the song in the songs array.\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtIndex(index) {\n return config.songs[index];\n }\n\n /**\n * Returns a song at a playlist index\n *\n * Public Accessor: Amplitude.getSongAtPlaylistIndex( playlist, index\n *\n * @access public\n * @param {number} index \t\t\t- The integer for the index of the song in the playlist.\n * @param {string} playlist\t\t- The key of the playlist we are getting the song at the index for\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtPlaylistIndex(playlist, index) {\n let song = config.playlists[playlist].songs[index];\n\n return song;\n }\n\n /**\n * Adds a song to the end of the config array. This will allow Amplitude\n * to play the song in a playlist type setting.\n *\n * Public Accessor: Amplitude.addSong( song_json )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n * @returns {number} New index of the song.\n */\n function addSong(song) {\n /*\n\t\t\tEnsures we have a songs array to push to.\n\t\t*/\n if (config.songs == undefined) {\n config.songs = [];\n }\n\n config.songs.push(song);\n\n if (config.shuffle_on) {\n config.shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n null,\n config.songs.length - 1,\n config.shuffle_on\n );\n }\n\n return config.songs.length - 1;\n }\n\n /**\n * Adds a song to the beginning of the config array.\n * This will allow Amplitude to play the song in a\n * playlist type setting.\n *\n * Public Accessor: Amplitude.addSong( song_json )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n * @returns {number} New index of the song (0)\n */\n function prependSong(song) {\n /*\n\t\t\tEnsures we have a songs array to push to.\n\t\t*/\n if (config.songs == undefined) {\n config.songs = [];\n }\n\n config.songs.unshift(song);\n\n if (config.shuffle_on) {\n config.shuffle_list.unshift(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n null,\n config.songs.length - 1,\n config.shuffle_on\n );\n }\n\n return 0;\n }\n\n /**\n * Adds a song to a playlist. This will allow Amplitude to play the song in the\n * playlist\n *\n * Public Accessor: Amplitude.addSongToPlaylist( song_json, playlist_key )\n *\n * @access public\n * @param {object} song \t\t\t- JSON representation of a song.\n * @param {string} playlist\t\t- Playlist we are adding the song to.\n * @returns {mixed} New index of song in playlist or null if no playlist exists\n */\n function addSongToPlaylist(song, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.push(song);\n\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n playlist,\n config.playlists[playlist].songs.length - 1,\n config.playlists[playlist].shuffle\n );\n }\n\n return config.playlists[playlist].songs.length - 1;\n } else {\n Debug.writeMessage(\"Playlist doesn't exist!\");\n return null;\n }\n }\n\n /**\n * Adds a playlist to Amplitude.\n *\n * @param {string} key - The key of the playlist we are adding.\n * @param {object} data - The data relating to the playlist\n * @param {array} songs - The songs to add to the playlist\n */\n function addPlaylist(key, data, songs) {\n /*\n Ensures the playlist is not already defined.\n */\n if (config.playlists[key] == undefined) {\n /*\n Initialize the new playlist object.\n */\n config.playlists[key] = {};\n\n /*\n Define the ignored keys that we don't want to copy over.\n */\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n /*\n Iterate over all of the keys defined by the user and\n set them on the playlist.\n */\n for (let dataKey in data) {\n if (ignoredKeys.indexOf(dataKey) < 0) {\n config.playlists[key][dataKey] = data[dataKey];\n }\n }\n\n /*\n Initialize the default parameters for the playlist and set the songs.\n */\n config.playlists[key].songs = songs;\n config.playlists[key].active_index = null;\n config.playlists[key].repeat = false;\n config.playlists[key].shuffle = false;\n config.playlists[key].shuffle_list = [];\n\n return config.playlists[key];\n } else {\n Debug.writeMessage(\"A playlist already exists with that key!\");\n return null;\n }\n }\n\n /**\n * Removes a song from the song array\n *\n * Public Accessor: Amplitude.removeSong( index )\n *\n * @access public\n * @param {integer} index - Index of the song being removed\n * @returns {boolean} True if removed false if not.\n */\n function removeSong(index) {\n config.songs.splice(index, 1);\n }\n\n /**\n * Removes a song from the playlist\n *\n * Public Accessor: Amplitude.removeSongFromPlaylist( index, playlist )\n *\n * @access public\n * @param {integer} index \t\t\t- Index of the song being removed from the playlist.\n * @param {string} playlist\t\t\t- Playlist we are removing the song from.\n * @returns {boolean} True if removed false if not.\n */\n function removeSongFromPlaylist(index, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.splice(index, 1);\n }\n }\n\n /**\n * When you pass a song object it plays that song right awawy. It sets\n * the active song in the config to the song you pass in and synchronizes\n * the visuals.\n *\n * Public Accessor: Amplitude.playNow( song )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n */\n function playNow(song) {\n /*\n\t\t\tMakes sure the song object has a URL associated with it\n\t\t\tor there will be nothing to play.\n\t\t*/\n if (song.url) {\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n } else {\n /*\n\t\t\t\tWrite error message since the song passed in doesn't\n\t\t\t\thave a URL.\n\t\t\t*/\n Debug.writeMessage(\"The song needs to have a URL!\");\n }\n\n /*\n\t\t\tPlays the song.\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSets the main song control status visual\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tUpdate the song meta data\n\t\t*/\n MetaDataElements.displayMetaData();\n\n /*\n\t\t\tReset the song sliders, song progress bar info, and\n\t\t\treset times. This ensures everything stays in sync.\n\t\t*/\n SongSliderElements.resetElements();\n\n /*\n\t\t\tReset the song played progress elements.\n\t\t*/\n SongPlayedProgressElements.resetElements();\n\n /*\n\t\t\tReset all of the current time elements.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tReset all of the duration time elements.\n\t\t*/\n TimeElements.resetDurationTimes();\n\n }\n\n /**\n * Plays a song at the index passed in from the songs array.\n *\n * Public Accessor: Amplitude.playSongAtIndex( index )\n *\n * @access public\n * @param {number} index \t- The number representing the song in the songs array.\n */\n function playSongAtIndex(index) {\n /*\n\t\t\t Stop the current song.\n\t\t*/\n Core.stop();\n\n /*\n\t\t\t Determine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n AudioNavigation.setActivePlaylist(null);\n\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\t Check if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(null, index)) {\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n }\n\n /**\n * Plays a song at the index passed in for the playlist provided. The index passed\n * in should be the index of the song in the playlist and not the songs array.\n *\n * @access public\n * @param {number} index \t\t- The number representing the song in the playlist array.\n * @param {string} playlist - The key string representing the playlist we are playing the song from.\n *\n */\n function playPlaylistSongAtIndex(index, playlist) {\n Core.stop();\n\n /*\n\t\t\tDetermine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tCheck if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(playlist, index)) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n }\n\n /**\n * Allows the user to play whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.play();\n *\n * @access public\n */\n function play() {\n Core.play();\n }\n\n /**\n * Allows the user to pause whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.pause();\n *\n * @access public\n */\n function pause() {\n Core.pause();\n }\n\n /**\n * Allows the user to stop whatever the active song is directly\n * through Javascript.\n *\n * Public Accessor: Amplitude.stop();\n *\n * @access public\n */\n function stop() {\n Core.stop();\n }\n\n /**\n * Returns the audio object used to play the audio\n *\n * Public Accessor: Amplitude.getAudio();\n *\n * @access public\n */\n function getAudio() {\n return config.audio;\n }\n\n /**\n * Returns the Web Audio API ANalyser used for visualizations.\n *\n * Public Accessor: Amplitude.getAnalyser()\n *\n * @access public\n */\n function getAnalyser() {\n return config.analyser;\n }\n\n /**\n * Plays the next song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.next( playlist );\n *\n * @access public\n * @param {string} [playlist = null \t- The playlist key\n */\n function next(playlist = null) {\n let nextData = {};\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the next global\n\t\t\t\tsong or we set the next in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setNextPlaylist(playlist);\n }\n }\n\n /**\n * Plays the prev song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.prev( playlist );\n *\n * @access public\n * @param {string} [playlist = null] \t- The playlist key\n */\n function prev(playlist = null) {\n let prevData = {};\n\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the prev global\n\t\t\t\tsong or we set the prev in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setPreviousPlaylist(playlist);\n }\n }\n\n /**\n * Gets all of the songs in the songs array\n *\n * Public Accessor: Amplitude.getSongs( );\n *\n * @access public\n */\n function getSongs() {\n return config.songs;\n }\n\n /**\n * Gets all of the songs in a playlist\n *\n * Public Accessor: Amplitude.getSongsInPlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsInPlaylist(playlist) {\n return config.playlists[playlist].songs;\n }\n\n /**\n * Get current state of songs. If shuffled, this will return the shuffled\n * songs.\n *\n * Public Accessor: Amplitude.getSongsState();\n *\n * @access public\n */\n function getSongsState() {\n if (config.shuffle_on) {\n return config.shuffle_list;\n } else {\n return config.songs;\n }\n }\n\n /**\n * Get current state of songs in playlist. If shuffled, this will return the\n * shuffled songs.\n *\n * Public Accessor: Amplitude.getSongsStatePlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsStatePlaylist(playlist) {\n if (config.playlists[playlist].shuffle) {\n return config.playlists[playlist].shuffle_list;\n } else {\n return config.playlists[playlist].songs;\n }\n }\n\n /**\n * Gets the active index of the player\n *\n * Public Accessor: Amplitude.getActiveIndex()\n *\n * @access public\n */\n function getActiveIndex() {\n return parseInt(config.active_index);\n }\n\n /**\n * Get the version of AmplitudeJS\n *\n * Public Accessor: Amplitude.getVersion()\n *\n * @access public\n */\n function getVersion() {\n return config.version;\n }\n\n /**\n * Get the buffered amount for the current song\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n */\n function getBuffered() {\n return config.buffered;\n }\n\n /**\n * Skip to a certain location in a selected song.\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n * @param {number} seconds \t\t\t\t\t\t- The amount of seconds we should skip to in the song.\n * @param {number} songIndex \t\t\t\t\t- The index of the song in the songs array.\n * @param {string} [playlist = null]\t- The playlist the song we are skipping to belogns to.\n */\n function skipTo(seconds, songIndex, playlist = null) {\n seconds = parseInt(seconds);\n\n if (playlist != null) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n } else {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n }\n }\n\n /**\n * Sets the meta data for a song in the songs array. This will set any\n * meta data for a song besides the URL. The URL could cause issues if the\n * song was playing.\n *\n * Public Accessor: Amplitude.setSongMetaData()\n *\n * @access public\n * @param {number} index\t\t\t\t\t- The index of the song in the songs array.\n * @param {object} metaData \t\t\t- The object containing the meta data we are updating.\n * @param {string} playlist - The playlist we are updating the song meta data for.\n */\n function setSongMetaData(index, metaData, playlist = null) {\n /*\n Update the meta data for a song in a playlist.\n */\n if (\n playlist != \"\" &&\n playlist != null &&\n config.playlists[playlist] != undefined\n ) {\n /*\n Set all of the defined meta data properties\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.playlists[playlist].songs[index][key] = metaData[key];\n }\n }\n }\n } else {\n /*\n Update the meta data for a song.\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.songs[index][key] = metaData[key];\n }\n }\n }\n }\n\n /*\n Display the updates on the screen.\n */\n MetaDataElements.displayMetaData();\n MetaDataElements.syncMetaData();\n }\n\n function setPlaylistMetaData(playlist, metaData) {\n if (config.playlists[playlist] != undefined) {\n /*\n \t\t\tThese are the ignored keys that we won't be worrying about displaying.\n \t\t\tEvery other key in the playlist object can be displayed.\n \t\t*/\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (ignoredKeys.indexOf(key) < 0) {\n config.playlists[playlist][key] = metaData[key];\n }\n }\n }\n\n MetaDataElements.displayPlaylistMetaData();\n } else {\n Debug.writeMessage(\"You must provide a valid playlist key!\");\n }\n }\n\n /**\n * Sets the delay between the songs when they are finished.\n *\n * Public Accessor: Amplitude.setDelay()\n *\n * @access public\n * @param {number} delay \t- The millisecond delay time between songs\n */\n function setDelay(time) {\n config.delay = time;\n }\n\n /**\n * Returns the current delay between songs.\n *\n * Public Accessor: Amplitude.getDelay()\n *\n * @access public\n */\n function getDelay() {\n return config.delay;\n }\n\n /**\n * Returns the state of the player.\n *\n * Public Accessor: Amplitude.getPlayerState();\n */\n function getPlayerState() {\n return config.player_state;\n }\n\n /**\n * Registers a visualization and sets that visualization's\n * preferences. When creating a visualization, you can set certain\n * preferences that the user can overwrite similar to Amplitude.\n * Public Accessor: Amplitude.registerVisualization( visualization, preferences )\n *\n * @param {object} visualzation A visualization object that gets registered\n * with Amplitude\n *\n * @param {object} preferences A JSON object of preferences relating to the\n * visualization\n */\n function registerVisualization(visualization, preferences) {\n Visualizations.register(visualization, preferences);\n }\n\n /**\n * Set the visualization for the playlist\n *\n * @param {string} playlist - The playlist we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setPlaylistVisualization(playlist, visualizationKey) {\n if (config.playlists[playlist] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The playlist for the key provided does not exist\");\n }\n }\n\n /**\n * Set a visualization for the song.\n *\n * @param {number} songIndex - The index of the song in the songs array we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setSongVisualization(songIndex, visualizationKey) {\n if (config.songs[songIndex]) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.songs[songIndex].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"A song at that index is undefined\");\n }\n }\n\n /**\n * Set song in playlist visualization.\n *\n * @param {string} playlist - The playlist we are setting the song visualization for.\n * @param {number} songIndex - The index we are setting the visualization for.\n * @param {strong} visualizationKey - The key of the visualization we are adding to the song in the playlist.\n */\n function setSongInPlaylistVisualization(\n playlist,\n songIndex,\n visualizationKey\n ) {\n if (config.playlists[playlist].songs[songIndex] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].songs[\n songIndex\n ].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The song in the playlist at that key is not defined\");\n }\n }\n\n /**\n * Sets the global visualization default.\n */\n function setGlobalVisualization(visualizationKey) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n }\n\n /**\n * Sets the active volume.\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume(volumeLevel) {\n Core.setVolume(volumeLevel);\n }\n\n /**\n * Gets the active volume.\n */\n function getVolume() {\n return config.volume;\n }\n\n /*\n\t\tReturns all of the publically accesible methods.\n\t*/\n return {\n init: init,\n getConfig: getConfig,\n bindNewElements: bindNewElements,\n getActivePlaylist: getActivePlaylist,\n getPlaybackSpeed: getPlaybackSpeed,\n setPlaybackSpeed: setPlaybackSpeed,\n getRepeat: getRepeat,\n getRepeatPlaylist: getRepeatPlaylist,\n getShuffle: getShuffle,\n getShufflePlaylist: getShufflePlaylist,\n setShuffle: setShuffle,\n setShufflePlaylist: setShufflePlaylist,\n setRepeat: setRepeat,\n setRepeatSong: setRepeatSong,\n setRepeatPlaylist: setRepeatPlaylist,\n getDefaultAlbumArt: getDefaultAlbumArt,\n setDefaultAlbumArt: setDefaultAlbumArt,\n getDefaultPlaylistArt: getDefaultPlaylistArt,\n setDefaultPlaylistArt: setDefaultPlaylistArt,\n getSongPlayedPercentage: getSongPlayedPercentage,\n setSongPlayedPercentage: setSongPlayedPercentage,\n getSongPlayedSeconds: getSongPlayedSeconds,\n getSongDuration: getSongDuration,\n setDebug: setDebug,\n getActiveSongMetadata: getActiveSongMetadata,\n getActivePlaylistMetadata: getActivePlaylistMetadata,\n getSongAtIndex: getSongAtIndex,\n getSongAtPlaylistIndex: getSongAtPlaylistIndex,\n addSong: addSong,\n prependSong: prependSong,\n addSongToPlaylist: addSongToPlaylist,\n removeSong: removeSong,\n removeSongFromPlaylist: removeSongFromPlaylist,\n playNow: playNow,\n playSongAtIndex: playSongAtIndex,\n playPlaylistSongAtIndex: playPlaylistSongAtIndex,\n play: play,\n pause: pause,\n stop: stop,\n getAudio: getAudio,\n getAnalyser: getAnalyser,\n next: next,\n prev: prev,\n getSongs: getSongs,\n getSongsInPlaylist: getSongsInPlaylist,\n getSongsState: getSongsState,\n getSongsStatePlaylist: getSongsStatePlaylist,\n getActiveIndex: getActiveIndex,\n getVersion: getVersion,\n getBuffered: getBuffered,\n skipTo: skipTo,\n setSongMetaData: setSongMetaData,\n setPlaylistMetaData: setPlaylistMetaData,\n setDelay: setDelay,\n getDelay: getDelay,\n getPlayerState: getPlayerState,\n addPlaylist: addPlaylist,\n registerVisualization: registerVisualization,\n setPlaylistVisualization: setPlaylistVisualization,\n setSongVisualization: setSongVisualization,\n setSongInPlaylistVisualization: setSongInPlaylistVisualization,\n setGlobalVisualization: setGlobalVisualization,\n getVolume: getVolume,\n setVolume: setVolume\n };\n})();\n\nexport default Amplitude;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Utility.\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Visual Meta Data Elements Module\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * AmplitudeJS SoundCloud Meta module\n * @module soundcloud/Soundcloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Handles the initialization of the playlists.\n *\n * @module init/PlaylistsInitializer\n */\nlet PlaylistsInitializer = (function() {\n /**\n * Initializes the playlists for AmplitudeJS\n *\n * @param {Object} playlists - The playlists defined by the user.\n */\n function initialize(playlists) {\n /*\n Copy the playlists over to Amplitude\n */\n config.playlists = playlists;\n\n /*\n Copy songs over from songs array.\n */\n copySongsToPlaylists();\n\n /*\n Grab any SoundCloud Data for the playlist songs if needed.\n */\n grabSoundCloudData();\n\n /*\n Initialize a scoped active index for each playlist.\n */\n initializePlaylistActiveIndexes();\n\n /*\n Initialize the shuffle status of the playlists.\n */\n initializePlaylistShuffleStatuses();\n\n /*\n Initialize the repeat status for the playlits.\n */\n initializePlaylistsRepeatStatuses();\n\n /*\n Initialize temporary place holders for shuffle lists.\n */\n initializePlaylistShuffleLists();\n\n /*\n Initializes the first song in the playlist\n */\n initializeFirstSongInPlaylistMetaData();\n }\n\n /**\n * Initializes a scoped active index for each playlist.\n *\n * @access private\n */\n function initializePlaylistActiveIndexes() {\n /*\n \t\tIterate over all of the playlists defined by the user\n and add an active index.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].active_index = null;\n }\n }\n\n /**\n * Ensures the indexes in the playlists are valid indexes. The song has\n * to exist in the Amplitude config to be played correctly. If the index\n * is an integer, we ensure it exists and coy it to the array.\n *\n * @access private\n */\n function copySongsToPlaylists() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Checks if the playlist has songs.\n */\n if (config.playlists[key].songs) {\n /*\n Iterate over all of the songs in the playlist\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n if (Checks.isInt(config.playlists[key].songs[i])) {\n config.playlists[key].songs[i] =\n config.songs[config.playlists[key].songs[i]];\n\n config.playlists[key].songs[i].index = i;\n }\n /*\n Check to see if the index for the song in the playlist\n exists in the songs config.\n */\n if (\n Checks.isInt(config.playlists[key].songs[i]) &&\n !config.songs[config.playlists[key].songs[i]]\n ) {\n Debug.writeMessage(\n \"The song index: \" +\n config.playlists[key].songs[i] +\n \" in playlist with key: \" +\n key +\n \" is not defined in your songs array!\"\n );\n }\n\n /*\n If not an int, then is a dedicated song, just set the index.\n */\n if (!Checks.isInt(config.playlists[key].songs[i]) ){\n config.playlists[key].songs[i].index = i;\n }\n }\n }\n }\n }\n }\n\n /**\n * Grabs the SoundCloud data for any song in the playlist that\n * the user needs to grab data for.\n *\n * @access private\n */\n function grabSoundCloudData() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Iterate over all of the songs in the playlist and see if\n they need to grab the SoundCloud data for the song.\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n /*\n Only Grab the data if the URL is a SoundCloud URL.\n */\n if (SoundCloud.isSoundCloudURL(config.playlists[key].songs[i].url)) {\n /*\n Only grab the data if the SoundCloud data has not already been\n grabbed for the audio. This could happen if the user defined the\n song in the songs array and was grabbed before.\n */\n if (config.playlists[key].songs[i].soundcloud_data == undefined) {\n SoundCloud.resolveIndividualStreamableURL(\n config.playlists[key].songs[i].url,\n key,\n i\n );\n }\n }\n }\n }\n }\n }\n\n /**\n * Initializes the shuffle statuses for each of the playlists. These will\n * be referenced when we shuffle individual playlists.\n *\n * @access private\n */\n function initializePlaylistShuffleStatuses() {\n /*\n\t\t\tIterate over all of the playlists the user defined adding\n\t\t\tthe playlist key to the shuffled playlist array and creating\n\t\t\tand empty object to house the statuses.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle = false;\n }\n }\n\n /**\n * Initializes the repeat statuses for each of the playlists. These will\n * be referenced when we repeat individual playlits.\n *\n * @access private\n */\n function initializePlaylistsRepeatStatuses() {\n /*\n Iterate over all of the playlists the user defined adding\n the playlist key to the repeated playlist array and creating\n and empty object to house the statuses.\n */\n for (let key in config.playlists) {\n config.playlists[key].repeat = false;\n }\n }\n\n /**\n * Initializes the shuffled playlist placeholders. These will be set for\n * playlists that are shuffled and contain the shuffled songs.\n *\n * @access private\n */\n function initializePlaylistShuffleLists() {\n /*\n \t\t\tIterate over all of the playlists the user defined adding\n \t\t\tthe playlist key to the shuffled playlists array and creating\n \t\t\tand empty object to house the shuffled playlists\n \t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle_list = [];\n }\n }\n\n /**\n * Intializes the display for the first song in the playlist meta data.\n *\n * @access private\n */\n function initializeFirstSongInPlaylistMetaData() {\n /*\n\t\t\tIterates over all of the playlists setting the meta data for the\n\t\t\tfirst song.\n\t\t*/\n for (let key in config.playlists) {\n MetaDataElements.setFirstSongInPlaylist(\n config.playlists[key].songs[0],\n key\n );\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n initialize: initialize\n };\n})();\n\nexport default PlaylistsInitializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/playlists.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the container elements.\n *\n * @param visual/ContainerElements\n */\nlet ContainerElements = (function() {\n /**\n * Applies the class 'amplitude-active-song-container' to the element\n * containing visual information regarding the active song.\n *\n * @prop {boolean} direct - Determines if it was a direct click on the song. We\n * then don't care if shuffle is on or not.\n *\n * @access public\n */\n function setActive(direct) {\n /*\n Gets all of the song container elements.\n */\n let songContainers = document.getElementsByClassName(\n \"amplitude-song-container\"\n );\n\n /*\n\t\t\tRemoves all of the active song containrs.\n\t\t*/\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.remove(\"amplitude-active-song-container\");\n }\n\n /*\n\t\t\tFinds the active index and adds the active song container to the element\n\t\t\tthat represents the song at the index.\n\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n let activeIndex = \"\";\n\n /*\n If we click directly on the song element, we ignore\n whether it's in shuffle or not.\n */\n if (direct) {\n activeIndex = config.active_index;\n } else {\n if (config.shuffle_on) {\n activeIndex = config.shuffle_list[config.active_index].index;\n } else {\n activeIndex = config.active_index;\n }\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n if (!songContainers[i].hasAttribute(\"data-amplitude-playlist\")) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n } else {\n /*\n If we have an active playlist or the action took place directly on the\n song element, we ignore the shuffle.\n */\n if (\n (config.active_playlist != null && config.active_playlist != \"\") ||\n direct\n ) {\n var activePlaylistIndex =\n config.playlists[config.active_playlist].active_index;\n } else {\n var activePlaylistIndex = \"\";\n\n if (config.playlists[config.active_playlist].shuffle) {\n activePlaylistIndex =\n config.playlists[config.active_playlist].shuffle_list[\n config.playlists[config.active_playlist].active_index\n ].index;\n } else {\n activePlaylistIndex =\n config.playlists[config.active_playlist].active_index;\n }\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n }\n\n return {\n setActive: setActive\n };\n})();\n\nexport default ContainerElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/containerElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time hour elements.\n *\n * @module visual/time/CurrentHourElements\n */\nlet CurrentHourElements = (function() {\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Updates any elements that display the current hour for the song.\n *\n * @access public\n * @param {number} hours \t- An integer conaining how many hours into the song.\n */\n function syncGlobal(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourSelectors = document.querySelectorAll(\n \".amplitude-current-hours\"\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourSelectors.length; i++) {\n let playlist = currentHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist current hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncPlaylist(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSelectors.length; i++) {\n let songIndex = currentHourPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (songIndex == null) {\n currentHourPlaylistSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the hour selectors\n \t\t*/\n const currentHourSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current hour selector's inner html to hours passed in.\n \t\t*/\n for (let i = 0; i < currentHourSongSelectors.length; i++) {\n let playlist = currentHourSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null) {\n currentHourSongSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSongSelectors.length; i++) {\n currentHourPlaylistSongSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Reset the current hour elements.\n */\n function resetTimes() {\n /*\n Gets the hour display elements\n */\n let hourSelectors = document.querySelectorAll(\".amplitude-current-hours\");\n\n /*\n Iterates over all of the hour selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < hourSelectors.length; i++) {\n hourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time minutes elements.\n *\n * @module visual/time/CurrentMinuteElements\n */\nlet CurrentMinuteElements = (function() {\n /**\n * Syncs the current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncGlobal(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinuteSelectors.length; i++) {\n let playlist = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncPlaylist(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSelectors.length; i++) {\n let songIndex = currentMinutePlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (songIndex == null) {\n currentMinutePlaylistSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the current song minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the minute selectors\n \t\t*/\n const currentMinuteSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current minute selector's inner html to minutes passed in.\n \t\t*/\n for (let i = 0; i < currentMinuteSongSelectors.length; i++) {\n let playlist = currentMinuteSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null) {\n currentMinuteSongSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSongSelectors.length; i++) {\n currentMinutePlaylistSongSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Reset the current times.\n */\n function resetTimes() {\n /*\n Gets the minute display elements\n */\n let minuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n Iterates over all of the minute selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < minuteSelectors.length; i++) {\n minuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time seconds elements.\n *\n * @module visual/time/CurrentSecondElements\n */\nlet CurrentSecondElements = (function() {\n /**\n * Syncs the current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncGlobal(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondSelectors.length; i++) {\n let playlist = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncPlaylist(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSelectors.length; i++) {\n let songIndex = currentSecondPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (songIndex == null) {\n currentSecondPlaylistSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the current song seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the second selectors\n \t\t*/\n const currentSecondSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current second selector's inner html to seconds passed in.\n \t\t*/\n for (let i = 0; i < currentSecondSongSelectors.length; i++) {\n let playlist = currentSecondSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null) {\n currentSecondSongSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSongSelectors.length; i++) {\n currentSecondPlaylistSongSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Reset the current seconds elements.\n */\n function resetTimes() {\n /*\n Gets the second display elements\n */\n let secondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n Iterates over all of the second selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < secondSelectors.length; i++) {\n secondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * These methods help sync visual time elements.\n *\n * @module visual/CurrentTimeElements\n */\nlet CurrentTimeElements = (function() {\n /**\n * Visually displays the current time on the screen. This is called on\n * time update for the current song.\n *\n * @access public\n * @param {object} currentTime \t\t\t\t\t- An object containing the current time for the song in seconds, minutes, and hours.\n */\n function sync(currentTime) {\n /*\n\t\t\tSet current time display.\n\t\t*/\n syncGlobal(currentTime);\n syncPlaylist(currentTime);\n syncSong(currentTime);\n syncSongInPlaylist(currentTime);\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncGlobal(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n \".amplitude-current-time\"\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncPlaylist(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSong(time) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the time selectors.\n \t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the time selector's inner html to the current time for the song. The current\n \t\t\ttime is computed by joining minutes and seconds.\n \t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSongInPlaylist(time) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n\n /**\n * Resets the current time displays to 00:00\n *\n * @access public\n */\n function resetTimes() {\n /*\n\t\t\tGets the time selector display elements\n\t\t*/\n let timeSelectors = document.querySelectorAll(\".amplitude-current-time\");\n\n /*\n\t\t\tIterates over all of the time selectors and sets the inner HTML\n\t\t\tto 00.\n\t\t*/\n for (let i = 0; i < timeSelectors.length; i++) {\n timeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Returns the publically facing methods\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration countdown elements.\n *\n * @module visual/time/DurationCountDownTimeElements.\n */\nlet DurationCountDownTimeElements = (function() {\n /**\n * Syncs all of the countdown time elements.\n *\n * @param {object} countDownTime - The current time of the audio.\n * @param {object} songDuration - The song duration of the audio.\n */\n function sync(countDownTime, songDuration) {\n let timeRemaining = computeTimeRemaining(countDownTime, songDuration);\n\n syncGlobal(timeRemaining);\n syncPlaylist(timeRemaining);\n syncSong(timeRemaining);\n syncSongInPlaylist(timeRemaining);\n }\n\n /**\n * Syncs the global count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncGlobal(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncPlaylist(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the song count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSong(timeRemaining) {\n if (config.active_playlist == null) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSongInPlaylist(timeRemaining) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n\n /**\n * Resets the count down times.\n */\n function resetTimes() {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Computes the time remaining for the audio.\n *\n * @param {object} currentTime - The current time of the audio.\n * @param {object} songDuration - The duration of the audio.\n */\n function computeTimeRemaining(currentTime, songDuration) {\n let timeRemaining = \"00:00\";\n\n /*\n Initialize the total current seconds and total duration seconds\n */\n let totalCurrentSeconds =\n parseInt(currentTime.seconds) +\n parseInt(currentTime.minutes) * 60 +\n parseInt(currentTime.hours) * 60 * 60;\n let totalDurationSeconds =\n parseInt(songDuration.seconds) +\n parseInt(songDuration.minutes) * 60 +\n parseInt(songDuration.hours) * 60 * 60;\n\n /*\n If the two variables are numbers we continue the computing.\n */\n if (!isNaN(totalCurrentSeconds) && !isNaN(totalDurationSeconds)) {\n /*\n Find the total remaining seconds.\n */\n let timeRemainingTotalSeconds =\n totalDurationSeconds - totalCurrentSeconds;\n\n var remainingHours = Math.floor(timeRemainingTotalSeconds / 3600);\n var remainingMinutes = Math.floor(\n (timeRemainingTotalSeconds - remainingHours * 3600) / 60\n );\n var remainingSeconds =\n timeRemainingTotalSeconds -\n remainingHours * 3600 -\n remainingMinutes * 60;\n\n timeRemaining =\n (remainingMinutes < 10 ? \"0\" + remainingMinutes : remainingMinutes) +\n \":\" +\n (remainingSeconds < 10 ? \"0\" + remainingSeconds : remainingSeconds);\n\n if (remainingHours > 0) {\n timeRemaining = remainingHours + \":\" + timeRemaining;\n }\n }\n\n return timeRemaining;\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationCountDownTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationCountDownTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration hours elements.\n *\n * @module visual/time/DurationHourElements.\n */\nlet DurationHourElements = (function() {\n /**\n * Sync the duration hours elements.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Syncs the global duration hours elements.\n *\n * @param {Integer} hours - the duration hours for the audio.\n */\n function syncGlobal(hours) {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist duration hours for the audio.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncPlaylist(hours) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song duration hours.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration hours.\n *\n * @param {Integer} hours - The duration hours of the audio.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Resets the duration shours elements to '00'\n */\n function resetTimes() {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration minutes elements.\n *\n * @module visual/time/DurationMinuteElements.\n */\nlet DurationMinuteElements = (function() {\n /**\n * Sync the duration minutes elements.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global duration minutes elements.\n *\n * @param {Integer} minutes - the duration minutes for the audio.\n */\n function syncGlobal(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist duration minutes for the audio.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncPlaylist(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the song duration minutes.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration minutes.\n *\n * @param {Integer} minutes - The duration minutes of the audio.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Resets the duration minutes elements to '00'\n */\n function resetTimes() {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration seconds elements.\n *\n * @module visual/time/DurationSecondElements.\n */\nlet DurationSecondElements = (function() {\n /**\n * Sync the duration seconds elements.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global duration seconds elements.\n *\n * @param {Integer} seconds - the duration seconds for the audio.\n */\n function syncGlobal(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist duration seconds for the audio.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncPlaylist(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the song duration seconds.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data--amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration seconds.\n *\n * @param {Integer} seconds - The duration seconds of the audio.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Resets the duration seconds elements to '00'\n */\n function resetTimes() {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration time elements.\n *\n * @module visual/time/DurationTimeElements.\n */\nlet DurationTimeElements = (function() {\n /**\n * Syncs the duration time for all elements.\n *\n * @param {Object} durationTime - The object containing all of the song duration times.\n */\n function sync(durationTime) {\n let durationText = computeDurationText(durationTime);\n\n syncGlobal(durationText);\n syncPlaylist(durationText);\n syncSong(durationText);\n syncSongInPlaylist(durationText);\n }\n\n /**\n * Sync the global song duration elements.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncGlobal(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the playlist duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncPlaylist(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the song duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncSong(durationText) {\n if (config.active_playlist == null) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n }\n\n /**\n * Sync the song in playlist duration times.\n *\n * @param {Object} durationText - An object containing the duration text.\n */\n function syncSongInPlaylist(durationText) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n\n /**\n * Resets all of the duration times to empty.\n */\n function resetTimes() {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Computes the duration text\n *\n * @param {Object} durationTime - An object containint the duration times.\n */\n function computeDurationText(durationTime) {\n var durationText = \"00:00\";\n\n if (!isNaN(durationTime.minutes) && !isNaN(durationTime.seconds)) {\n durationText = durationTime.minutes + \":\" + durationTime.seconds;\n if (!isNaN(durationTime.hours) && durationTime.hours > 0) {\n durationText = durationTime.hours + \":\" + durationText;\n }\n }\n\n return durationText;\n }\n\n /**\n * Return publically accessible methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationTimeElements.js","module.exports = {\"name\":\"amplitudejs\",\"version\":\"5.3.1\",\"description\":\"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs\",\"main\":\"dist/amplitude.js\",\"devDependencies\":{\"babel-core\":\"^6.26.3\",\"babel-loader\":\"^7.1.5\",\"babel-plugin-add-module-exports\":\"0.2.1\",\"babel-polyfill\":\"^6.26.0\",\"babel-preset-es2015\":\"^6.18.0\",\"husky\":\"^1.3.1\",\"jest\":\"^23.6.0\",\"prettier\":\"1.15.1\",\"pretty-quick\":\"^1.11.1\",\"watch\":\"^1.0.2\",\"webpack\":\"^2.7.0\"},\"directories\":{\"doc\":\"docs\"},\"files\":[\"dist\"],\"funding\":{\"type\":\"opencollective\",\"url\":\"https://opencollective.com/amplitudejs\"},\"scripts\":{\"build\":\"node_modules/.bin/webpack\",\"prettier\":\"npx pretty-quick\",\"preversion\":\"npx pretty-quick && npm run test\",\"postversion\":\"git push && git push --tags\",\"test\":\"jest\",\"version\":\"npm run build && git add -A dist\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/521dimensions/amplitudejs.git\"},\"keywords\":[\"webaudio\",\"html5\",\"javascript\",\"audio-player\"],\"author\":\"521 Dimensions (https://521dimensions.com)\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/521dimensions/amplitudejs/issues\"},\"homepage\":\"https://github.com/521dimensions/amplitudejs#readme\"}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./package.json\n// module id = 59\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 1342b390611d32154be3","webpack:///./src/config.js","webpack:///./src/core/core.js","webpack:///./src/visual/playPauseElements.js","webpack:///./src/utilities/audioNavigation.js","webpack:///./src/utilities/debug.js","webpack:///./src/utilities/checks.js","webpack:///./src/utilities/configState.js","webpack:///./src/visual/metaDataElements.js","webpack:///./src/visual/repeatElements.js","webpack:///./src/utilities/callbacks.js","webpack:///./src/visual/muteElements.js","webpack:///./src/visual/volumeSliderElements.js","webpack:///./src/utilities/repeater.js","webpack:///./src/utilities/shuffler.js","webpack:///./src/visual/songSliderElements.js","webpack:///./src/visual/timeElements.js","webpack:///./src/fx/visualizations.js","webpack:///./src/soundcloud/soundcloud.js","webpack:///./src/visual/playbackSpeedElements.js","webpack:///./src/visual/shuffleElements.js","webpack:///./src/visual/songPlayedProgressElements.js","webpack:///./src/init/init.js","webpack:///./src/fx/waveform.js","webpack:///./src/utilities/time.js","webpack:///./src/visual/bufferedProgressElements.js","webpack:///./src/events/ended.js","webpack:///./src/events/events.js","webpack:///./src/events/keydown.js","webpack:///./src/events/mute.js","webpack:///./src/events/next.js","webpack:///./src/events/pause.js","webpack:///./src/events/play.js","webpack:///./src/events/playPause.js","webpack:///./src/events/playbackSpeed.js","webpack:///./src/events/prev.js","webpack:///./src/events/progress.js","webpack:///./src/events/repeat.js","webpack:///./src/events/repeatSong.js","webpack:///./src/events/shuffle.js","webpack:///./src/events/skipTo.js","webpack:///./src/events/songSlider.js","webpack:///./src/events/stop.js","webpack:///./src/events/timeUpdate.js","webpack:///./src/events/volumeDown.js","webpack:///./src/events/volumeSlider.js","webpack:///./src/events/volumeUp.js","webpack:///./src/fx/fx.js","webpack:///./src/index.js","webpack:///./src/init/playlists.js","webpack:///./src/visual/containerElements.js","webpack:///./src/visual/time/currentHourElements.js","webpack:///./src/visual/time/currentMinuteElements.js","webpack:///./src/visual/time/currentSecondElements.js","webpack:///./src/visual/time/currentTimeElements.js","webpack:///./src/visual/time/durationCountDownTimeElements.js","webpack:///./src/visual/time/durationHourElements.js","webpack:///./src/visual/time/durationMinuteElements.js","webpack:///./src/visual/time/durationSecondElements.js","webpack:///./src/visual/time/durationTimeElements.js","webpack:///./package.json"],"names":["module","exports","version","audio","Audio","active_metadata","active_album","active_index","active_playlist","playback_speed","callbacks","songs","playlists","start_song","starting_playlist","starting_playlist_song","repeat","repeat_song","shuffle_list","shuffle_on","default_album_art","default_playlist_art","debug","volume","pre_mute_volume","volume_increment","volume_decrement","soundcloud_client","soundcloud_use_art","soundcloud_song_count","soundcloud_songs_ready","is_touch_moving","buffered","bindings","continue_next","delay","player_state","web_audio_api_available","context","source","analyser","visualizations","available","active","backup","waveforms","sample_rate","built","Core","play","Visualizations","stop","run","config","live","reconnectStream","test","navigator","userAgent","paused","playPromise","undefined","then","catch","playbackRate","ConfigState","setPlayerState","pause","disconnectStream","currentTime","Callbacks","setVolume","volumeLevel","muted","setSongLocation","songPercentage","duration","skipToLocation","seconds","addEventListener","Debug","writeMessage","once","src","load","url","setPlaybackSpeed","playbackSpeed","PlayPauseElements","sync","syncGlobal","syncPlaylist","syncSong","syncSongInPlaylist","state","playPauseElements","document","querySelectorAll","i","length","playlist","getAttribute","song","setElementPlay","setElementPause","playlistPlayPauseElements","songPlayPauseElements","activePlaylistIndex","songInPlaylistPlayPauseElements","syncToPause","element","classList","add","remove","AudioNavigation","setNext","songEnded","nextIndex","nextSong","endOfList","index","parseInt","changeSong","setNextPlaylist","shuffle","setActivePlaylist","changeSongPlaylist","setPrevious","previousIndex","previousSong","setPreviousPlaylist","direct","prepareSongChange","album","afterSongChange","SongSliderElements","resetElements","SongPlayedProgressElements","TimeElements","resetCurrentTimes","Checks","newAlbum","MetaDataElements","displayMetaData","ContainerElements","setActive","resetDurationTimes","message","console","log","newSong","songIndex","newPlaylist","isURL","pattern","isInt","int","isNaN","Number","resetConfig","imageMetaDataKeys","songInfoElements","info","val","indexOf","setAttribute","innerHTML","displayPlaylistMetaData","playlistInfoElements","setFirstSongInPlaylist","elementPlaylist","syncMetaData","RepeatElements","syncRepeat","repeatClasses","getElementsByClassName","syncRepeatPlaylist","repeatButtons","syncRepeatSong","repeatSongClasses","initialize","callbackName","callbackFunction","error","MuteElements","setMuted","muteClasses","VolumeSliderElements","volumeSliders","value","Repeater","setRepeat","setRepeatPlaylist","setRepeatSong","Shuffler","setShuffle","shuffleSongs","toggleShuffle","setShufflePlaylist","shufflePlaylistSongs","toggleShufflePlaylist","shuffleTemp","Array","randNum","Math","floor","random","shuffleSwap","shuffleList","original","temp","location","syncMain","mainSongSliders","playlistSongSliders","playlistAttribute","songAttribute","songSliders","songInPlaylistSliders","CurrentTimeElements","resetTimes","CurrentHourElements","CurrentMinuteElements","CurrentSecondElements","syncCurrentTimes","hours","minutes","DurationCountDownTimeElements","DurationHourElements","DurationMinuteElements","DurationSecondElements","DurationTimeElements","syncDurationTimes","songDuration","visualizationElements","Object","keys","runGlobalVisualization","runPlaylistVisualization","runSongVisualization","runSongInPlaylistVisualization","displayBackups","globalVisualizationIndex","visualization","activeSongVisualizationIndex","addToActiveVisualizations","firstVisualization","activePlaylistVisualizationIndex","key","setPreferences","startVisualization","push","stopVisualization","register","preferences","newVisualization","getID","x","displayGlobalBackup","displayPlaylistBackup","displaySongBackup","displaySongInPlaylistBackup","style","backgroundImage","cover_art_url","SoundCloud","tempUserConfig","loadSoundCloud","userConfig","head","getElementsByTagName","script","createElement","type","onreadystatechange","initSoundcloud","onload","appendChild","SC","client_id","getStreamableURLs","soundcloud_regex","match","resolveStreamable","resolveIndividualStreamableURL","addToShuffleList","get","sound","streamable","stream_url","artwork_url","soundcloud_data","AmplitudeHelpers","writeDebugMessage","name","artist","AmplitudeInitializer","setConfig","isSoundCloudURL","PlaybackSpeedElements","playbackSpeedClasses","ShuffleElements","shuffleButtons","songPlayedPercentage","percentage","songPlayedProgressBars","max","Initializer","ready","Events","setArt","Fx","webAudioAPIAvailable","determineUsingAnyFX","configureWebAudioAPI","documentElement","resume","WaveForm","init","object","params","initializeDefaultLiveSettings","initializeDefaultSongIndexes","rebindDisplay","countPlaylists","PlaylistsInitializer","preload","initializeElements","size","hasOwnProperty","buffer","sampleRate","peaks","svg","createElementNS","g","path","build","abs","split","reduce","a","b","charCodeAt","req","XMLHttpRequest","open","responseType","e","readyState","status","decodeAudioData","response","bufferedAudio","getPeaks","process","send","displayWaveForms","totalPeaks","d","peakNumber","shift","sampleSize","sampleStep","numberOfChannels","mergedPeaks","channelNumber","channelData","getChannelData","start","end","min","sampleIndex","waveformElements","displayGlobalWaveform","displayPlaylistWaveform","displaySongWaveform","displaySongInPlaylistWaveform","waveformPath","querySelector","determineIfUsingWaveforms","Time","computeCurrentTimes","currentSeconds","currentMinutes","currentHours","computeSongDuration","songDurationSeconds","songDurationMinutes","songDurationHours","toString","computeSongCompletionPercentage","setCurrentTime","time","isFinite","BufferedProgressElements","songBufferedProgressBars","parseFloat","songBufferedProgressBarsPlaylist","songBufferedProgressBarsSongs","songBufferedProgressBarsSongsInPlaylist","reset","Ended","handle","setTimeout","bindTimeUpdate","bindKeyDownEventHandlers","bindSongEnded","bindProgress","bindPlay","bindPause","bindPlayPause","bindStop","bindMute","bindVolumeUp","bindVolumeDown","bindSongSlider","bindVolumeSlider","bindNext","bindPrev","bindShuffle","bindRepeat","bindRepeatSong","bindPlaybackSpeed","bindSkipTo","bindCanPlayThrough","removeEventListener","TimeUpdate","KeyDown","Progress","play_classes","Play","pause_classes","Pause","play_pause_classes","PlayPause","stop_classes","Stop","mute_classes","Mute","volume_up_classes","VolumeUp","volume_down_classes","VolumeDown","ua","window","msie","song_sliders","SongSlider","volume_sliders","VolumeSlider","next_classes","Next","prev_classes","Prev","shuffle_classes","Shuffle","repeat_classes","Repeat","repeat_song_classes","RepeatSong","playback_speed_classes","PlaybackSpeed","skipToClasses","SkipTo","event","runKeyEvent","which","runPlayPauseKeyDownEvent","runNextKeyDownEvent","runPrevKeyDownEvent","runStopKeyDownEvent","runShuffleKeyDownEvent","runRepeatKeyDownEvent","handleGlobalNext","handlePlaylistNext","songIndexAttribute","handleGlobalPause","handlePlaylistPause","handleSongPause","handleSongInPlaylistPause","handleGlobalPlay","handlePlaylistPlay","handleSongPlay","handleSongInPlaylistPlay","handleGlobalPlayPause","handlePlaylistPlayPause","handleSongPlayPause","handleSongInPlaylistPlayPause","handleGlobalPrev","handlePlaylistPrev","bufferedEnd","handleGlobalRepeat","handlePlaylistRepeat","handleGlobalShuffle","handlePlaylistShuffle","handleSkipToSong","handleSkipToPlaylist","locationPercentage","computedTime","handleGlobalSongSlider","handlePlaylistSongSlider","handleSongSongSlider","handleSongInPlaylistSongSlider","computeBufferedTime","updateTimeInformation","runTimeCallbacks","songCompletionPercentage","time_callbacks","browserContext","AudioContext","webkitAudioContext","mozAudioContext","oAudioContext","msAudioContext","createAnalyser","crossOrigin","createMediaElementSource","connect","destination","Amplitude","getConfig","bindNewElements","getActivePlaylist","getPlaybackSpeed","speed","getRepeat","getRepeatPlaylist","playlistKey","getShuffle","getShufflePlaylist","repeatState","getDefaultAlbumArt","getDefaultPlaylistArt","setDefaultAlbumArt","setDefaultPlaylistArt","default_plalist_art","getSongPlayedPercentage","getSongPlayedSeconds","getSongDuration","setSongPlayedPercentage","setDebug","getActiveSongMetadata","getActivePlaylistMetadata","getSongAtIndex","getSongAtPlaylistIndex","addSong","prependSong","unshift","addSongToPlaylist","addPlaylist","data","ignoredKeys","dataKey","removeSong","splice","removeSongFromPlaylist","playNow","playSongAtIndex","playPlaylistSongAtIndex","getAudio","getAnalyser","next","nextData","prev","prevData","getSongs","getSongsInPlaylist","getSongsState","getSongsStatePlaylist","getActiveIndex","getVersion","getBuffered","skipTo","setSongMetaData","metaData","setPlaylistMetaData","setDelay","getDelay","getPlayerState","registerVisualization","setPlaylistVisualization","visualizationKey","setSongVisualization","setSongInPlaylistVisualization","setGlobalVisualization","getVolume","copySongsToPlaylists","grabSoundCloudData","initializePlaylistActiveIndexes","initializePlaylistShuffleStatuses","initializePlaylistsRepeatStatuses","initializePlaylistShuffleLists","initializeFirstSongInPlaylistMetaData","songContainers","activeIndex","hasAttribute","currentHourSelectors","currentHourPlaylistSelectors","currentHourSongSelectors","currentHourPlaylistSongSelectors","hourSelectors","currentMinuteSelectors","currentMinutePlaylistSelectors","currentMinuteSongSelectors","currentMinutePlaylistSongSelectors","minuteSelectors","currentSecondSelectors","currentSecondPlaylistSelectors","currentSecondSongSelectors","currentSecondPlaylistSongSelectors","secondSelectors","currentTimeSelectors","timeText","timeSelectors","countDownTime","timeRemaining","computeTimeRemaining","durationTimeRemainingSelectors","totalCurrentSeconds","totalDurationSeconds","timeRemainingTotalSeconds","remainingHours","remainingMinutes","remainingSeconds","durationHourSelectors","durationMinuteSelectors","durationSecondSelectors","durationTime","durationText","computeDurationText","durationTimeSelectors"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;ACdA;;AAEAA,OAAOC,OAAP,GAAiB;AACfC,WAASA,gBADM;;AAGfC,SAAO,IAAIC,KAAJ,EAHQ;;AAKfC,mBAAiB,EALF;;AAOfC,gBAAc,EAPC;;AASfC,gBAAc,CATC;;AAWfC,mBAAiB,IAXF;;AAafC,kBAAgB,GAbD;;AAefC,aAAW,EAfI;;AAiBfC,SAAO,EAjBQ;;AAmBfC,aAAW,EAnBI;;AAqBfC,cAAY,EArBG;;AAuBfC,qBAAmB,EAvBJ;;AAyBfC,0BAAwB,EAzBT;;AA2BfC,UAAQ,KA3BO;;AA6BfC,eAAa,KA7BE;;AA+BfC,gBAAc,EA/BC;;AAiCfC,cAAY,KAjCG;;AAmCfC,qBAAmB,EAnCJ;;AAqCfC,wBAAsB,EArCP;;AAuCfC,SAAO,KAvCQ;;AAyCfC,UAAQ,GAzCO;;AA2CfC,mBAAiB,GA3CF;;A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Mud,aAAanZ,KAAnB,CAAD,IAA8BmZ,aAAanZ,KAAb,GAAqB,CAAvD,EAA0D;AACxDoZ,uBAAeD,aAAanZ,KAAb,GAAqB,GAArB,GAA2BoZ,YAA1C;AACD;AACF;;AAED,WAAOA,YAAP;AACD;;AAED;;;AAGA,SAAO;AACL5hB,UAAMA,IADD;AAELmI,gBAAYA;AAFP,GAAP;AAID,CArJ0B,EAA3B,C,CAXA;;;;kBAkKeW,oB;;;;;;;AClKf,kBAAkB,mTAAmT,uQAAuQ,gBAAgB,aAAa,6BAA6B,uEAAuE,YAAY,yNAAyN,eAAe,0EAA0E,2IAA2I,4DAA4D,kE","file":"amplitude.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"Amplitude\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Amplitude\"] = factory();\n\telse\n\t\troot[\"Amplitude\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 47);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1342b390611d32154be3","/**\n * These variables make Amplitude run. The config is the most important\n * containing active settings and parameters.\n *\n * The config JSON is the global settings for ALL of Amplitude functions.\n * This is global and contains all of the user preferences. The default\n * settings are set, and the user overwrites them when they initialize\n * Amplitude.\n *\n * @module config\n * @type {object}\n * @property {string} \tconfig.version \t\t\t\t- The current version of AmplitudeJS.\n * @property {object} \tconfig.audio \t\t \t\t\t\t\t\t\t\t-\tHandles all of the audio.\n * @property {object} \tconfig.active_metadata\t\t\t\t\t- Contains the active metadata for the song.\n * @property {string} \tconfig.active_album\t\t\t\t\t\t\t- Holds the active album name. Used to check and see if the album changed and run the album changed callback.\n * @property {number} \tconfig.active_index\t\t\t\t\t\t\t- Contains the index of the actively playing song.\n * @property {string} \tconfig.active_playlist\t\t\t\t\t- Contains the key to the active playlist index.\n * @property {number} \tconfig.playback_speed\t\t\t\t\t\t- Sets the initial playback speed of the song. The values for this can be 1.0, 1.5, 2.0\n * @property {object} \tconfig.callbacks\t\t\t\t\t\t\t\t- The user can pass a JSON object with a key => value store of callbacks to be run at certain events.\n * @property {array} \t\tconfig.songs\t\t\t\t\t\t\t\t\t\t- Contains all of the songs the user has passed to Amplitude to use.\n * @property {object} \tconfig.playlists\t\t\t\t\t\t\t\t- Contains all of the playlists the user created.\n * @property {object} \tconfig.start_song \t\t\t\t\t\t\t- The index of the song that AmplitudeJS should start with.\n * @property {string} \tconfig.starting_playlist \t\t\t\t- The starting playlist the player will intiialize to.\n * @property {string} \tconfig.starting_playlist_song \t- The index of the song in the playlist that should be started.\n * @property {boolean} \tconfig.repeat \t\t\t\t\t\t\t\t\t- When repeat is on, when the song ends the song will replay itself.\n * @property {object} \tconfig.shuffle_list\t\t\t\t\t\t\t- When shuffled, gets populated with the songs the user provided in a random order.\n * @property {boolean} \tconfig.shuffle_on\t\t\t\t\t\t\t\t- When on, gets set to true so when traversing through songs, AmplitudeJS knows whether or not to use the songs object or the shuffle_list\n * @property {string}\t\tconfig.default_album_art \t\t\t\t- The user can set default album art to be displayed if the song they set doesn't contain album art.\n * @property {string} \tconfig.default_playlist_art \t\t- The user can set default playlist art to be displayed if the playlist they are setting meta data for doesn't contain an art picture.\n * @property {boolean} \tconfig.debug\t\t\t\t\t\t\t\t\t\t- When set to true, AmplitudeJS will print to the console any errors providing helpful feedback to the user.\n * @property {number} \tconfig.volume \t\t\t\t\t\t\t\t\t- The user can set the initial volume to a number between 0 and 1 over-riding the default of .5\n * @property {number} \tconfig.pre_mute_volume \t\t\t\t\t- This is set on mute so that when a user un-mutes AmplitudeJS knows what to restore the volume to.\n * @property {number}\t\tconfig.volume_increment \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should increase when the user presses the volume up button.\n * @property {number}\t\tconfig.volume_decrement \t\t\t\t- The default values are an integer between 1 and 100 for how much the volume should decrease when the user presses the volume down button.\n * @property {string} \tconfig.soundcloud_client \t\t\t\t- When using SoundCloud, the user will have to provide their API Client ID\n * @property {boolean} \tconfig.soundcloud_use_art \t\t\t- The user can set this to true and AmplitudeJS will use the album art for the song returned from the Soundcloud API\n * @property {number} \tconfig.soundcloud_song_count \t\t- Used on config to count how many songs are from Soundcloud and compare it to how many are ready for when to move to the rest of the configuration\n * @property {number} \tconfig.soundcloud_songs_ready \t- Used on config to count how many songs are ready so when we get all of the data from the SoundCloud API that we need this should match the SoundCloud song count meaning we can move to the rest of the config.\n * @property {integer}\tconfig.is_touch_moving \t\t\t\t\t- Flag for if the user is moving the screen.\n * @property {boolean}\tconfig.buffered\t\t\t\t\t\t\t\t\t- How much of the song is buffered.\n * @property {object} \tconfig.bindings\t\t\t\t\t\t\t\t\t- Array of bindings to certain key events.\n * @property {boolean} \tconfig.continue_next \t\t\t\t\t\t- Determines when a song ends, we should continue to the next song.\n * @property {number} config.delay \t\t\t\t\t\t\t\t\t\t- Sets the delay between songs in MS.\n * @property {boolean} config.use_web_audio_api \t\t\t\t- Flag that determines if the user wants to use Web Audio API Components.\n * @property {boolean} config.web_audio_api_available - Flag that determines if the Web Audio API is available.\n * @property {object} \tconfig.context \t\t\t\t\t\t\t\t\t- Web Audio API Context\n * @property {object}\t\tconfig.source \t\t\t\t\t\t\t\t\t- Web Audio API Source\n * @property {object} \tconfig.analyser \t\t\t\t\t\t\t\t- Web Audio API Analyser\n * @property {string}\t\tconfig.player_state \t\t\t\t\t\t- The current state of the player.\n */\nimport { version } from \"../package.json\";\n\nmodule.exports = {\n version: version,\n\n audio: new Audio(),\n\n active_metadata: {},\n\n active_album: \"\",\n\n active_index: 0,\n\n active_playlist: null,\n\n playback_speed: 1.0,\n\n callbacks: {},\n\n songs: [],\n\n playlists: {},\n\n start_song: \"\",\n\n starting_playlist: \"\",\n\n starting_playlist_song: \"\",\n\n repeat: false,\n\n repeat_song: false,\n\n shuffle_list: {},\n\n shuffle_on: false,\n\n default_album_art: \"\",\n\n default_playlist_art: \"\",\n\n debug: false,\n\n volume: 0.5,\n\n pre_mute_volume: 0.5,\n\n volume_increment: 5,\n\n volume_decrement: 5,\n\n soundcloud_client: \"\",\n\n soundcloud_use_art: false,\n\n soundcloud_song_count: 0,\n\n soundcloud_songs_ready: 0,\n\n is_touch_moving: false,\n\n buffered: 0,\n\n bindings: {},\n\n continue_next: true,\n\n delay: 0,\n\n player_state: \"stopped\",\n\n web_audio_api_available: false,\n\n context: null,\n\n source: null,\n\n analyser: null,\n\n visualizations: {\n available: [],\n\n active: [],\n\n backup: \"\"\n },\n\n waveforms: {\n sample_rate: 100,\n\n built: []\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/config.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Checks module.\n * @module utilities/checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Audio Navigation module.\n * @module utilities/audioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Play/Pause Visual Elements module.\n * @module visual/playPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Meta Data Visual Elements module.\n * @module visual/metaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports AmplitudeJS Callback Utility\n * @module utilities/callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Import the Visualizations from the FX module.\n * @module fx/visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * Import the Config State module.\n * @module utilities/configState\n */\n import ConfigState from \"../utilities/configState.js\";\n\n/**\n * Interacts directly with native functions of the Audio element. Logic\n * leading up to these methods are handled by click handlers which call\n * helpers and visual synchronizers. These are the core functions of AmplitudeJS.\n * Every other function that leads to these prepare the information to be\n * acted upon by these functions.\n *\n * @module core/Core\n */\nlet Core = (function() {\n /**\n * Plays the active song. If the current song is live, it reconnects\n * the stream before playing.\n *\n * Public Accessor: Amplitude.play()\n *\n * @access public\n */\n function play() {\n Visualizations.stop();\n Visualizations.run();\n\n /*\n\t\t\tIf the audio is live we re-conenct the stream.\n\t\t*/\n if (config.active_metadata.live) {\n reconnectStream();\n }\n\n /*\n\t\t\tMobile remote sources need to be reconnected on play. I think this is\n\t\t\tbecause mobile browsers are optimized not to load all resources\n\t\t\tfor speed reasons. We only do this if mobile and the paused button\n\t\t\tis not clicked. If the pause button was clicked then we don't reconnect\n\t\t\tor the user will lose their place in the stream.\n\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n ) &&\n !config.paused\n ) {\n reconnectStream();\n }\n\n /*\n\t\t\tPlay the song and set the playback rate to the playback\n\t\t\tspeed.\n */\n let playPromise = config.audio.play();\n\n if (playPromise !== undefined) {\n playPromise.then(_ => {}).catch(error => {});\n }\n config.audio.play();\n config.audio.playbackRate = config.playback_speed;\n \n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n }\n\n /**\n * Pauses the active song. If it's live, it disconnects the stream.\n *\n * Public Accessor: Amplitude.pause()\n *\n * @access public\n */\n function pause() {\n Visualizations.stop();\n\n /*\n\t\t\tPause the active song.\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tFlag that pause button was clicked.\n\t\t*/\n config.paused = true;\n \n \n /*\n\t\t\tIf the song is live, we disconnect the stream so we aren't\n\t\t\tsaving it to memory.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n \n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n }\n\n /**\n * Stops the active song by setting the current song time to 0.\n * When the user resumes, it will be from the beginning.\n * If it's a live stream it disconnects.\n *\n * Public Accessor: Amplitude.stop()\n *\n * @access public\n */\n function stop() {\n Visualizations.stop();\n\n /*\n\t\t\tSet the current time of the song to 0 which will reset the song.\n\t\t*/\n if (config.audio.currentTime != 0) {\n config.audio.currentTime = 0;\n }\n\n /*\n\t\t\tRun pause so the song will stop\n\t\t*/\n config.audio.pause();\n\n /*\n\t\t\tIf the song is live, disconnect the stream.\n\t\t*/\n if (config.active_metadata.live) {\n disconnectStream();\n }\n\n /*\n Sets the state of the player.\n */\n ConfigState.setPlayerState();\n \n /*\n\t\t\tRun the stop callback\n\t\t*/\n Callbacks.run(\"stop\");\n }\n\n /**\n * Sets the song volume.\n *\n * Public Accessor: Amplitude.setVolume( volumeLevel )\n *\n * @access public\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume(volumeLevel) {\n /*\n\t\t\tIf the volume is set to mute somewhere else, we sync the display.\n\t\t*/\n if (volumeLevel == 0) {\n config.audio.muted = true;\n } else {\n config.audio.muted = false;\n }\n\n /*\n\t\t\tSets the volume in the config so we can reference it later on.\n\t\t*/\n config.volume = volumeLevel;\n\n /*\n\t\t\tSet the volume of the active song.\n\t\t*/\n config.audio.volume = volumeLevel / 100;\n }\n\n /**\n * Sets the song percentage. If it's a live song, we ignore this because\n * we can't skip ahead. This is an issue if you have a playlist with\n * a live source.\n *\n * Public Accessor: Amplitude.setSongLocation( songPercentage )\n *\n * @access public\n * @param {number} songPercentage - A number between 1 and 100 as a percentage of song completion.\n */\n function setSongLocation(songPercentage) {\n /*\n\t\t\tAs long as the song is not live, we can set the current time of the\n\t\t\tsong to the percentage the user passed in.\n\t\t*/\n if (!config.active_metadata.live) {\n config.audio.currentTime = config.audio.duration * (songPercentage / 100);\n }\n }\n\n /**\n * Skips to a location in a song\n *\n * Public Accessor: Amplitude.skipToLocation( seconds )\n *\n * @access public\n * @param {number} seconds - An integer containing the seconds to skip to\n */\n function skipToLocation(seconds) {\n /*\n\t\t\tWhen the active song can be played through, we can check to\n\t\t\tsee if the seconds will work. We only bind the event handler\n\t\t\tonce and remove it once it's fired.\n\t\t*/\n config.audio.addEventListener(\n \"canplaythrough\",\n function() {\n /*\n\t\t\t\tIf the active song duration is greater than or equal to the\n\t\t\t\tamount of seconds the user wants to skip to and the seconds\n\t\t\t\tis greater than 0, we skip to the seconds defined.\n\t\t\t*/\n if (config.audio.duration >= seconds && seconds > 0) {\n config.audio.currentTime = seconds;\n } else {\n Debug.writeMessage(\n \"Amplitude can't skip to a location greater than the duration of the audio or less than 0\"\n );\n }\n },\n { once: true }\n );\n }\n\n /**\n * Disconnects the live stream\n *\n * Public Accessor: Amplitude.disconnectStream()\n *\n * @access public\n */\n function disconnectStream() {\n config.audio.src = \"\";\n config.audio.load();\n }\n\n /**\n * Reconnects the live stream\n *\n * Public Accessor: Amplitude.reconnectStream()\n *\n * @access public\\\n */\n function reconnectStream() {\n config.audio.src = config.active_metadata.url;\n config.audio.load();\n }\n\n /**\n * Sets the playback speed for the song.\n *\n * @param {number} playbackSpeed The speed we want the song to play back at.\n */\n function setPlaybackSpeed(playbackSpeed) {\n /*\n\t\t\tSet the config playback speed.\n\t\t*/\n config.playback_speed = playbackSpeed;\n\n /*\n\t\t\tSet the active song playback rate.\n\t\t*/\n config.audio.playbackRate = config.playback_speed;\n }\n\n /*\n\t\tReturn publically facing functions\n\t*/\n return {\n play: play,\n pause: pause,\n stop: stop,\n setVolume: setVolume,\n setSongLocation: setSongLocation,\n skipToLocation: skipToLocation,\n disconnectStream: disconnectStream,\n reconnectStream: reconnectStream,\n setPlaybackSpeed: setPlaybackSpeed\n };\n})();\n\nexport default Core;\n\n\n\n// WEBPACK FOOTER //\n// ./src/core/core.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nlet PlayPauseElements = (function() {\n /**\n * Syncs all play pause elements.\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Syncs the global play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncGlobal() {\n /*\n Get the active song state.\n */\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all play pause buttons.\n */\n const playPauseElements = document.querySelectorAll(\n \".amplitude-play-pause\"\n );\n\n /*\n Iterate over all of the play pause elements syncing the\n display visually.\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = playPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = playPauseElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the main playlist play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the main playlist play pause elements\n */\n const playlistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over the play pause elements, syncing the state accordingly.\n */\n for (let i = 0; i < playlistPlayPauseElements.length; i++) {\n /*\n Grab the song attributes from the element.\n */\n let song = playlistPlayPauseElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n We want only the play pause elements for the main on a\n playlist nothing else. We have another method for the\n song in playlist play pause method.\n */\n if (song == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(playlistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(playlistPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song play pause buttons to the state of the active song.\n *\n * @access public\n */\n function syncSong() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index that matches the active index attribute.\n */\n let songPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n Iterate over all of the song play pause elements\n */\n for (let i = 0; i < songPlayPauseElements.length; i++) {\n /*\n Grab the playlist attributes from the element.\n */\n let playlist = songPlayPauseElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n We want only the song play pause buttons, not ones scoped in a playlist.\n */\n if (playlist == null) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songPlayPauseElements[i]);\n break;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist play pause buttons to the state of\n * the active song.\n *\n * @access public\n */\n function syncSongInPlaylist() {\n let state = config.audio.paused ? \"paused\" : \"playing\";\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n Get all of the individual song play pause buttons. These have an\n amplitude-song-index attribute. Some have amplitude-playlist which\n means they are individual songs within a playlist.\n */\n let songInPlaylistPlayPauseElements = document.querySelectorAll(\n '.amplitude-play-pause[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n Iterate over all of the individual play pause elements for songs inspect\n a playlist.\n */\n for (let i = 0; i < songInPlaylistPlayPauseElements.length; i++) {\n /*\n Determines what classes we should add and remove\n from the elements.\n */\n switch (state) {\n case \"playing\":\n setElementPlay(songInPlaylistPlayPauseElements[i]);\n break;\n case \"paused\":\n setElementPause(songInPlaylistPlayPauseElements[i]);\n break;\n }\n }\n }\n\n /**\n * Sets all of the play pause buttons to paused.\n *\n * @access public\n */\n function syncToPause() {\n /*\n Gets all of the play pause elements\n */\n let playPauseElements = document.querySelectorAll(\".amplitude-play-pause\");\n\n /*\n Sets all of the elements to pause\n */\n for (let i = 0; i < playPauseElements.length; i++) {\n setElementPause(playPauseElements[i]);\n }\n }\n\n /**\n * Sets an element to be playing by removing the 'amplitude-paused' class\n * and adding the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the playing class added.\n */\n function setElementPlay(element) {\n element.classList.add(\"amplitude-playing\");\n element.classList.remove(\"amplitude-paused\");\n }\n\n /**\n * Sets an element to be paused by adding the 'amplitude-paused' class\n * and removing the 'amplitude-playing' class\n *\n * @access public\n * @param {element} element \t- The element getting the paused class added.\n */\n function setElementPause(element) {\n element.classList.remove(\"amplitude-playing\");\n element.classList.add(\"amplitude-paused\");\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncGlobal: syncGlobal,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n syncToPause: syncToPause\n };\n})();\n\nexport default PlayPauseElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playPauseElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Core Module\n *\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Callbacks Module\n *\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Checks Module\n *\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the Play Pause Elements Module\n *\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Song Slider Elements Module\n *\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements Module\n *\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time Elements Module\n *\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Meta Data Elements Module\n *\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Container Elements Module\n *\n * @module visual/ContainerElements\n */\nimport ContainerElements from \"../visual/containerElements.js\";\n\n/**\n * AmplitudeJS Audio Navigation Utility.\n *\n * @module utilities/AudioNavigation\n */\nlet AudioNavigation = (function() {\n /**\n * Sets the next song\n *\n * @access public\n * @param {boolean} [songEnded=false] If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNext(songEnded = false) {\n /*\n Initializes the next index variable. This will be the\n index of the song that is next.\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n Determines if we are repeating the song or not. If we are repeating,\n the next song will be the same song index.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n nextIndex = config.shuffle_list[config.active_index].index;\n nextSong = config.shuffle_list[nextIndex];\n } else {\n nextIndex = config.active_index;\n nextSong = config.songs[nextIndex];\n }\n } else {\n /*\n If the shuffle is on, we use the shuffled list of\n songs to determine our next song.\n */\n if (config.shuffle_on) {\n /*\n If the active shuffle index + 1 is less than the length, then\n we use the next shuffle otherwise we go to the beginning\n of the shuffle list.\n */\n if (parseInt(config.active_index) + 1 < config.shuffle_list.length) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = parseInt(config.active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n nextSong = config.shuffle_list[nextIndex];\n } else {\n /*\n If the active index + 1 is less than the length of the songs, then\n we use the next song otherwise we go to the beginning of the\n song list.\n */\n if (parseInt(config.active_index) + 1 < config.songs.length) {\n nextIndex = parseInt(config.active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next index.\n */\n nextSong = config.songs[nextIndex];\n }\n }\n\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(nextSong, nextIndex);\n\n /*\n \t\tIf it's the end of the list and repeat is not on, do nothing.\n \t*/\n if (endOfList && !config.repeat) {\n } else {\n /*\n \t\t\tIf the song has ended and repeat is on, play the song.\n \t\t*/\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the next song in a playlist\n *\n * @param {string} playlist - The playlist being shuffled\n * @param {boolean} [songEnded=false] - If the song ended, this is set to true\n * so we take into effect the repeat setting.\n */\n function setNextPlaylist(playlist, songEnded = false) {\n /*\n Initializes the next index\n */\n let nextIndex = null;\n let nextSong = {};\n\n /*\n Ensure we don't loop in the playlist if config.repeat is not true\n */\n let endOfList = false;\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n nextIndex = config.playlists[playlist].active_index;\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n } else {\n /*\n If the playlist is shuffled we get the next index of the playlist.\n */\n if (config.playlists[playlist].shuffle) {\n /*\n If the active shuffle index + 1 is less than the length of the shuffle list,\n then we use the next shuffle otherwise we go to the beginning of the shuffle list.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].shuffle_list.length\n ) {\n /*\n Set the next index to be the index of the song in the shuffle list.\n */\n nextIndex = config.playlists[playlist].active_index + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n nextSong = config.playlists[playlist].shuffle_list[nextIndex];\n } else {\n /*\n If the active index +1 is less than the length of the songs in the playlist,\n then we use the next song otherwise we go to the beginning of the playlist.\n */\n if (\n parseInt(config.playlists[playlist].active_index) + 1 <\n config.playlists[playlist].songs.length\n ) {\n nextIndex = parseInt(config.playlists[playlist].active_index) + 1;\n } else {\n nextIndex = 0;\n endOfList = true;\n }\n\n /*\n Sets the next song.\n */\n nextSong = config.playlists[playlist].songs[nextIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, nextSong, nextIndex);\n\n /*\n If it's the end of the playlist and we aren't repeating, do nothing.\n */\n if (endOfList && !config.repeat) {\n } else {\n if (!(songEnded && !config.repeat && endOfList)) {\n Core.play();\n }\n }\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"next\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous song on the global songs array.\n *\n * @access private\n */\n function setPrevious() {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the config is shuffled, get the now playing index.\n */\n if (config.shuffle_on) {\n previousIndex = config.active_index;\n previousSong = config.shuffle_list[previousIndex];\n } else {\n previousIndex = config.active_index;\n previousSong = config.songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.active_index) - 1 >= 0) {\n previousIndex = parseInt(config.active_index - 1);\n } else {\n previousIndex = parseInt(config.songs.length - 1);\n }\n\n /*\n If the config is shuffled, we grab the song from the shuffle list\n */\n if (config.shuffle_on) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.songs[previousIndex];\n }\n }\n /*\n Change the song after the next button has been pressed.\n */\n changeSong(previousSong, previousIndex);\n\n /*\n Play the newest song.\n */\n Core.play();\n\n /*\n Sync the play pause elements and run the\n after next callback.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n If we repeated the song, run the repeat song callback.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Sets the previous playlist song.\n *\n * @access private\n *\n * @prop {string} playlist - The playlist we are navigating in.\n */\n function setPreviousPlaylist(playlist) {\n /*\n Initializes the previous index\n */\n let previousIndex = null;\n let previousSong = {};\n\n /*\n If we are repeating the song, then we just start the song over.\n */\n if (config.repeat_song) {\n /*\n If the playlist is shuffled, get the now playing index.\n */\n if (config.playlists[playlist].shuffle) {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n previousIndex = config.playlists[playlist].active_index;\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n } else {\n /*\n Get the previous index. If the previous index will be less than 0, get the\n last song of the array and continue.\n */\n if (parseInt(config.playlists[playlist].active_index) - 1 >= 0) {\n previousIndex = parseInt(config.playlists[playlist].active_index - 1);\n } else {\n previousIndex = parseInt(config.playlists[playlist].songs.length - 1);\n }\n\n /*\n If the playlist is shuffled, we grab the song from the shuffle list\n */\n if (config.playlists[playlist].shuffle) {\n /*\n Grab song from the shuffle list\n */\n previousSong = config.playlists[playlist].shuffle_list[previousIndex];\n } else {\n /*\n Grab song from the songs array\n */\n previousSong = config.playlists[playlist].songs[previousIndex];\n }\n }\n\n /*\n Sets the active playlist to the playlist we are on.\n */\n setActivePlaylist(playlist);\n\n /*\n Change the song within the playlist.\n */\n changeSongPlaylist(playlist, previousSong, previousIndex);\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause buttons.\n */\n PlayPauseElements.sync();\n Callbacks.run(\"prev\");\n\n /*\n Repeat the song.\n */\n if (config.repeat_song) {\n Callbacks.run(\"song_repeated\");\n }\n }\n\n /**\n * Change song in the songs array.\n *\n * @access private\n * @prop {object} song - The song we are changing to.\n * @prop {number} index - The index we are changing to.\n * @prop {boolean} direct - Determines if it was a direct click on the song.\n * We then don't care if shuffle is on or not.\n */\n function changeSong(song, index, direct = false) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n\n config.active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange(direct);\n }\n\n /**\n * Handles a song change in the playlist\n *\n * @access private\n * @prop {string} playlist - The playlist we are changing the song on.\n * @prop {object} song - The song we are changing to in the playlist.\n * @prop {number} index - The inded of the song we are changing to in the playlist.\n * @prop {boolean} direct - Determines if it was a direct click on the song. We\n * then don't care if shuffle is on or not\n */\n function changeSongPlaylist(playlist, song, index, direct = false) {\n /*\n Prepare the song change.\n */\n prepareSongChange(song);\n\n /*\n Change the song.\n */\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n config.active_index = null;\n\n config.playlists[playlist].active_index = parseInt(index);\n\n /*\n Set new information now that the song has changed.\n */\n afterSongChange(direct);\n }\n\n /**\n * Prepares a song change\n *\n * @access private\n * @prop {object} song - The song we change to.\n */\n function prepareSongChange(song) {\n /*\n Stop the current song.\n */\n Core.stop();\n\n /*\n Sync all of the elements to a stopped song.\n */\n PlayPauseElements.syncToPause();\n SongSliderElements.resetElements();\n SongPlayedProgressElements.resetElements();\n TimeElements.resetCurrentTimes();\n\n /*\n If an album changes, fire an album change.\n */\n if (Checks.newAlbum(song)) {\n Callbacks.run(\"album_change\");\n }\n }\n\n /**\n * Updates data on the display after a song has changed.\n *\n * @prop {boolean} direct - Determines if it was a direct click on the song.\n * We then don't care if shuffle is on or not.\n *\n * @access private\n */\n function afterSongChange(direct) {\n MetaDataElements.displayMetaData();\n ContainerElements.setActive(direct);\n TimeElements.resetDurationTimes();\n\n /*\n Run the song change callback.\n */\n Callbacks.run(\"song_change\");\n }\n\n /**\n * Sets the active playlist\n *\n * @access public\n * @param {string} playlist - The string of the playlist being set to active.\n */\n function setActivePlaylist(playlist) {\n /*\n If the active playlist is different than the playlist being set,\n we run the `playlist_changed` callback.\n */\n if (config.active_playlist != playlist) {\n Callbacks.run(\"playlist_changed\");\n /*\n Set the active playlist to the playlist parameter. Only need to\n set if it's different.\n */\n config.active_playlist = playlist;\n\n if (playlist != null) {\n config.playlists[playlist].active_index = 0;\n }\n }\n }\n\n /*\n Return the publically facing methods\n */\n return {\n setNext: setNext,\n setNextPlaylist: setNextPlaylist,\n setPrevious: setPrevious,\n setPreviousPlaylist: setPreviousPlaylist,\n changeSong: changeSong,\n changeSongPlaylist: changeSongPlaylist,\n setActivePlaylist: setActivePlaylist\n };\n})();\n\nexport default AudioNavigation;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/audioNavigation.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the debugging of AmplitudeJS\n * @module utilities/Debug\n */\nlet Debug = (function() {\n /**\n * Writes out debug message to the console if enabled.\n *\n * Public Accessor: Debug.writeMessage( message )\n *\n * @access public\n * @param {string} message - The string that gets printed to alert the user of a debugging error.\n */\n function writeMessage(message) {\n /*\n If the user has flagged AmplitudeJS to debug, we print out a message\n to the console.\n */\n if (config.debug) {\n console.log(message);\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n writeMessage: writeMessage\n };\n})();\n\nexport default Debug;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/debug.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Checks Module. Checks for new songs, albums, and playlists\n *\n * @module utilities/Checks\n */\nlet Checks = (function() {\n /**\n * Checks to see if the new song to be played is different than the song\n * that is currently playing. To be true, the user would have selected\n * play on a new song with a new index. To be false, the user would have\n * clicked play/pause on the song that was playing.\n *\n * Public Accessor: Checks.newSong( playlist, songIndex )\n * @access public\n * @param {string} playlist - The playlist we are checking the new song for. Could be null\n * @param {number} songIndex - The index of the new song to be played.\n * @returns {boolean} True if we are setting a new song, false if we are not setting a new song.\n */\n function newSong(playlist, songIndex) {\n /*\n If the playlists don't match, then it's definitely a new song.\n */\n if (config.active_playlist != playlist) {\n return true;\n } else {\n /*\n If we aren't in a playlist, we check the active index.\n */\n if (config.active_playlist == null && playlist == null) {\n /*\n If the active indexes don't match, then it's a new song.\n */\n if (config.active_index != songIndex) {\n return true;\n } else {\n return false;\n }\n } else {\n /*\n If we are in a playlist, then we check to see if the\n new song index matches the active index.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index != songIndex\n ) {\n return true;\n } else {\n return false;\n }\n }\n }\n }\n\n /**\n * Checks to see if there is a new album\n *\n * Public Accessor: Checks.newAlbum( album )\n *\n * @access public\n * @param {string} album - Checks to see if the new song will have a new album.\n * @returns {boolean} True if there is a new album, false if there is not a new ablum.\n */\n function newAlbum(album) {\n if (config.active_album != album) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Checks to see if there is a new playlist\n *\n * Public Accessor: Checks.newPlaylist( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist passed in to check against the active playlist.\n * @returns {boolean} True if there is a new playlist, false if there is not a new playlist.\n */\n function newPlaylist(playlist) {\n if (config.active_playlist != playlist) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Determines if the string passed in is a URL or not\n *\n * Public Accessor: AmplitudeHelpers.isURL( url )\n *\n * @access public\n * @param {string} url - The string we are testing to see if it's a URL.\n * @returns {boolean} True if the string is a url, false if it is not.\n */\n function isURL(url) {\n /*\n\t\t\tTest the string against the URL pattern and return if it matches\n\t\t*/\n let pattern = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\n\n return pattern.test(url);\n }\n\n /**\n * Determines if what is passed in is an integer or not.\n *\n * Public Accessor: AmplitudeHelpers.isInt( int )\n *\n * @access public\n * @param {string|number} int - The variable we are testing to see is an integer or not.\n * @returns {boolean} If the variable is an integer or not.\n */\n function isInt(int) {\n return (\n !isNaN(int) && parseInt(Number(int)) == int && !isNaN(parseInt(int, 10))\n );\n }\n\n /**\n * Returns public facing methods\n */\n return {\n newSong: newSong,\n newAlbum: newAlbum,\n newPlaylist: newPlaylist,\n isURL: isURL,\n isInt: isInt\n };\n})();\n\nexport default Checks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/checks.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the state of the config object.\n *\n * @module utilities/ConfigState\n */\nlet ConfigState = (function() {\n /**\n * Resets the config to the default state. This is called on initialize\n * to ensure the user's config is what matters.\n *\n * Public Accessor: AmplitudeHelpers.resetConfig()\n *\n * @access public\n */\n function resetConfig() {\n config.audio = new Audio();\n config.active_metadata = {};\n config.active_album = \"\";\n config.active_index = 0;\n config.active_playlist = null;\n config.playback_speed = 1.0;\n config.callbacks = {};\n config.songs = [];\n config.playlists = {};\n config.start_song = \"\";\n config.starting_playlist = \"\";\n config.starting_playlist_song = \"\";\n config.repeat = false;\n config.shuffle_list = {};\n config.shuffle_on = false;\n config.default_album_art = \"\";\n config.default_playlist_art = \"\";\n config.debug = false;\n config.volume = 0.5;\n config.pre_mute_volume = 0.5;\n config.volume_increment = 5;\n config.volume_decrement = 5;\n config.soundcloud_client = \"\";\n config.soundcloud_use_art = false;\n config.soundcloud_song_count = 0;\n config.soundcloud_songs_ready = 0;\n config.continue_next = true;\n }\n\n /**\n * Sets the state of the player.\n */\n function setPlayerState() {\n /*\n If paused and the current time is 0 the player is stopped.\n */\n if (config.audio.paused && config.audio.currentTime == 0) {\n config.player_state = \"stopped\";\n }\n\n /*\n If paused and the current time is greater than 0 the player is\n paused.\n */\n if (config.audio.paused && config.audio.currentTime > 0) {\n config.player_state = \"paused\";\n }\n\n /*\n If playing, the current state is playing.\n */\n if (!config.audio.paused) {\n config.player_state = \"playing\";\n }\n }\n\n /*\n\t\tReturns the public facing methods\n\t*/\n return {\n resetConfig: resetConfig,\n setPlayerState: setPlayerState\n };\n})();\n\nexport default ConfigState;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/configState.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * These methods help display the audio's meta data\n *\n * @module visual/MetaDataElements\n */\nlet MetaDataElements = (function() {\n /**\n * Displays the active song's metadata. This is called after a song has\n * been changed. This method takes the active song and displays the\n * metadata. So once the new active song is set, we update all of the\n * screen elements.\n *\n * @access public\n */\n function displayMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t\tGet all of the song info elements\n\t\t*/\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t\tIterate over all of the song info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n\t\t\t\tGrab the playlist and song index.\n\t\t\t*/\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tEnsure that we don't set any individual elements now. We set this with the\n\t\t\t\tsync meta data method. The reason we don't set them here is because\n\t\t\t\tall individual songs would get the now playing artwork. If the playlists\n\t\t\t\tmatch or the element is a main element meaning it doesn't\n\t\t\t\tbelong to a playlist or a song, then we set the song info.\n\t\t\t*/\n if (\n songIndex == null &&\n (config.active_playlist == playlist ||\n (playlist == null && songIndex == null))\n ) {\n /*\n\t\t\t\t\tIf the active metadata has the key, then we set it,\n\t\t\t\t\totherwise we clear it. If it's an image element then\n\t\t\t\t\twe default it to the default info if needed.\n\t\t\t\t*/\n let val = (config.active_metadata[info] != undefined) ? config.active_metadata[info] : null;\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n val = val || \"\"\n songInfoElements[i].innerHTML = val;\n }\n }\n }\n }\n\n /**\n * Displays the playlist meta data.\n */\n function displayPlaylistMetaData() {\n /*\n\t\t\tDefine the image meta data keys. These are managed separately\n\t\t\tsince we aren't actually changing the inner HTML of these elements.\n\t\t*/\n let imageMetaDataKeys = [\"image_url\"];\n\n /*\n\t\t\tGet all of the playlist info elements\n\t\t*/\n let playlistInfoElements = document.querySelectorAll(\n \"[data-amplitude-playlist-info]\"\n );\n\n /*\n\t\t\tIterate over all of the playlist info elements. We will either\n\t\t\tset these to the new values, or clear them if the active song\n\t\t\tdoesn't have the info set.\n\t\t*/\n for (let i = 0; i < playlistInfoElements.length; i++) {\n /*\n\t\t\t\tGet the info so we can check if the active meta data has the\n\t\t\t\tkey.\n\t\t\t*/\n let info = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist-info\"\n );\n let playlist = playlistInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (config.playlists[playlist][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist][info]\n );\n } else {\n playlistInfoElements[i].innerHTML = config.playlists[playlist][info];\n }\n } else {\n /*\n\t\t\t\t\tWe look for the default album art because\n\t\t\t\t\tthe actual key didn't exist. If the default album\n\t\t\t\t\tart doesn't exist then we set the src attribute\n\t\t\t\t\tto null.\n\t\t\t\t*/\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (config.default_playlist_art != \"\") {\n playlistInfoElements[i].setAttribute(\n \"src\",\n config.default_playlist_art\n );\n } else {\n playlistInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n playlistInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n\n /**\n * Sets the first song in the playlist. This is used to fill in the meta\n * data in the playlist\n *\n * @param {object} song \t\t\t- The song we are setting to be the first song in the playlist\n * @param {string} playlist \t- Key of the playlist we are setting the first song in\n */\n function setFirstSongInPlaylist(song, playlist) {\n /*\n Define the image meta data keys. These are managed separately\n since we aren't actually changing the inner HTML of these elements.\n */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n Get all of the song info elements\n */\n let songInfoElements = document.querySelectorAll(\n '[data-amplitude-song-info][data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n Iterate over all of the song info elements. We will either\n set these to the new values, or clear them if the active song\n doesn't have the info set.\n */\n for (let i = 0; i < songInfoElements.length; i++) {\n /*\n Get the info so we can check if the active meta data has the\n key.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info element playlist.\n */\n let elementPlaylist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n If the playlists match or the element is a main element, then\n we set the song info.\n */\n if (elementPlaylist == playlist) {\n /*\n If the active metadata has the key, then we set it,\n otherwise we clear it. If it's an image element then\n we default it to the default info if needed.\n */\n if (song[info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\"src\", song[info]);\n } else {\n songInfoElements[i].innerHTML = song[info];\n }\n } else {\n /*\n We look for the default album art because\n the actual key didn't exist. If the default album\n art doesn't exist then we set the src attribute\n to null.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n if (song.default_album_art != \"\") {\n songInfoElements[i].setAttribute(\"src\", song.default_album_art);\n } else {\n songInfoElements[i].setAttribute(\"src\", \"\");\n }\n } else {\n songInfoElements[i].innerHTML = \"\";\n }\n }\n }\n }\n }\n\n /**\n * Sets the meta data for songs loaded in the songs array\n */\n function syncMetaData() {\n /*\n\t\t Define the image meta data keys. These are managed separately\n\t\t since we aren't actually changing the inner HTML of these elements.\n\t */\n let imageMetaDataKeys = [\n \"cover_art_url\",\n \"station_art_url\",\n \"podcast_episode_cover_art_url\"\n ];\n\n /*\n\t\t Get all of the song info elements\n\t */\n let songInfoElements = document.querySelectorAll(\n \"[data-amplitude-song-info]\"\n );\n\n /*\n\t\t Iterate over all of the song info elements. We will either\n\t\t set these to the new values, or clear them if the active song\n\t\t doesn't have the info set.\n\t */\n for (let i = 0; i < songInfoElements.length; i++) {\n let songIndex = songInfoElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n let playlist = songInfoElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (songIndex != null && playlist == null) {\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Get the song info value referenced on the element. Depending on the type of\n element, we may need to fallback to another value when the direct value\n we want isn't found.\n i.e.\n data-amplitude-song-info=\"cover_art_url\" defaults to using the value\n of \"default_album_art\" when \"cover_art_url\" is missing on the song.\n */\n let val = config.songs[songIndex][info] != undefined ? config.songs[songIndex][info] : null;\n /*\n If it's an image meta data key, then we set the src attribute of\n the element. Otherwise we set the inner HTML of the element.\n */\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n /*\n If this is an image meta data key and the individual song doesn't\n have the key, use the default_album_art\n */\n val = val || config.default_album_art\n songInfoElements[i].setAttribute(\n \"src\",\n val\n );\n } else {\n songInfoElements[i].innerHTML = val;\n }\n }\n\n /*\n If the song index and playlist are not null, continue.\n */\n if (songIndex != null && playlist != null) {\n /*\n Get the info we are displaying.\n */\n let info = songInfoElements[i].getAttribute(\"data-amplitude-song-info\");\n\n /*\n Set the meta data accordingly.\n */\n if (config.playlists[playlist].songs[songIndex][info] != undefined) {\n if (imageMetaDataKeys.indexOf(info) >= 0) {\n songInfoElements[i].setAttribute(\n \"src\",\n config.playlists[playlist].songs[songIndex][info]\n );\n } else {\n songInfoElements[i].innerHTML =\n config.playlists[playlist].songs[songIndex][info];\n }\n }\n }\n }\n\n /*\n Display the playlist meta data.\n */\n displayPlaylistMetaData();\n }\n\n /**\n * Returns publically facing methods\n */\n return {\n displayMetaData: displayMetaData,\n setFirstSongInPlaylist: setFirstSongInPlaylist,\n syncMetaData: syncMetaData,\n displayPlaylistMetaData: displayPlaylistMetaData\n };\n})();\n\nexport default MetaDataElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/metaDataElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the visual syncing to the state of the config for the repeat\n * elements.\n *\n * @module visual/RepeatElements\n */\nlet RepeatElements = (function() {\n /**\n * Syncs repeat for all of the repeat buttons. Users\n * can apply styles to the 'amplitude-repeat-on' and\n * 'amplitude-repeat-off' classes. They represent the state\n * of the player.\n */\n function syncRepeat() {\n /*\n\t\t\tGets all of the repeat classes\n\t\t*/\n let repeatClasses = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterate over all of the repeat classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-on' class and remove the\n\t\t\t'amplitude-repeat-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatClasses.length; i++) {\n if (config.repeat) {\n repeatClasses[i].classList.add(\"amplitude-repeat-on\");\n repeatClasses[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatClasses[i].classList.remove(\"amplitude-repeat-on\");\n repeatClasses[i].classList.add(\"amplitude-repeat-off\");\n }\n }\n }\n\n /**\n * Syncs repeat for all of the playlist repeat buttons. Users\n * can apply styles to the `amplitude-repeat-on` and `amplitude-repeat-off`\n * classes. They repreent the state of the playlist in the player.\n */\n function syncRepeatPlaylist(playlist) {\n /*\n\t\t\t Gets all of the repeat buttons.\n\t\t */\n let repeatButtons = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\t Iterate over all of the repeat buttons\n\t\t */\n for (let i = 0; i < repeatButtons.length; i++) {\n /*\n\t\t\t\t Ensure that the repeat button belongs to matches the\n\t\t\t\t playlist we are syncing the state for.\n\t\t\t */\n if (\n repeatButtons[i].getAttribute(\"data-amplitude-playlist\") == playlist\n ) {\n /*\n\t\t\t\t\t If the state of the playlist is shuffled on, true, then\n\t\t\t\t\t we add the 'amplitude-repeat-on' class and remove the\n\t\t\t\t\t 'amplitude-repeat-off' class. If the player is not shuffled\n\t\t\t\t\t then we do the opposite.\n\t\t\t\t */\n if (config.playlists[playlist].repeat) {\n repeatButtons[i].classList.add(\"amplitude-repeat-on\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-off\");\n } else {\n repeatButtons[i].classList.add(\"amplitude-repeat-off\");\n repeatButtons[i].classList.remove(\"amplitude-repeat-on\");\n }\n }\n }\n }\n\n /**\n * Syncs repeat for all of the repeat song buttons. Users\n * can apply styles to the 'amplitude-repeat-song-on' and\n * 'amplitude-repeat-song-off' classes. They represent the state\n * of the player.\n */\n function syncRepeatSong() {\n /*\n\t\t\tGets all of the repeat song classes\n\t\t*/\n let repeatSongClasses = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterate over all of the repeat song classes. If repeat is on,\n\t\t\tthen add the 'amplitude-repeat-song-on' class and remove the\n\t\t\t'amplitude-repeat-song-off' class. If it's off, then do the\n\t\t\topposite.\n\t\t*/\n for (let i = 0; i < repeatSongClasses.length; i++) {\n if (config.repeat_song) {\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-off\");\n } else {\n repeatSongClasses[i].classList.remove(\"amplitude-repeat-song-on\");\n repeatSongClasses[i].classList.add(\"amplitude-repeat-song-off\");\n }\n }\n }\n\n /*\n Returns the publically available methods.\n */\n return {\n syncRepeat: syncRepeat,\n syncRepeatPlaylist: syncRepeatPlaylist,\n syncRepeatSong: syncRepeatSong\n };\n})();\n\nexport default RepeatElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/repeatElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/debug\n */\nimport Debug from \"./debug.js\";\n\n/**\n * AmplitudeJS Callback Utility\n *\n * @module utilities/callbacks\n */\nlet Callbacks = (function() {\n /**\n * Initializes the callbacks for the player.\n */\n function initialize() {\n /*\n Event: abort\n https://www.w3schools.com/tags/av_event_abort.asp\n */\n config.audio.addEventListener(\"abort\", function() {\n run(\"abort\");\n });\n\n /*\n Event: error\n https://www.w3schools.com/tags/av_event_error.asp\n */\n config.audio.addEventListener(\"error\", function() {\n run(\"error\");\n });\n\n /*\n Event: loadeddata\n https://www.w3schools.com/tags/av_event_loadeddata.asp\n */\n config.audio.addEventListener(\"loadeddata\", function() {\n run(\"loadeddata\");\n });\n\n /*\n Event: loadedmetadata\n https://www.w3schools.com/tags/av_event_loadedmetadata.asp\n */\n config.audio.addEventListener(\"loadedmetadata\", function() {\n run(\"loadedmetadata\");\n });\n\n /*\n Event: loadstart\n https://www.w3schools.com/tags/av_event_loadstart.asp\n */\n config.audio.addEventListener(\"loadstart\", function() {\n run(\"loadstart\");\n });\n\n /*\n Event: pause\n https://www.w3schools.com/tags/av_event_pause.asp\n */\n config.audio.addEventListener(\"pause\", function() {\n run(\"pause\");\n });\n\n /*\n Event: playing\n https://www.w3schools.com/tags/av_event_playing.asp\n */\n config.audio.addEventListener(\"playing\", function() {\n run(\"playing\");\n });\n\n /*\n Event: play\n https://www.w3schools.com/tags/av_event_play.asp\n */\n config.audio.addEventListener(\"play\", function() {\n run(\"play\");\n });\n\n /*\n Event: progress\n https://www.w3schools.com/tags/av_event_progress.asp\n */\n config.audio.addEventListener(\"progress\", function() {\n run(\"progress\");\n });\n\n /*\n Event: ratechange\n https://www.w3schools.com/tags/av_event_ratechange.asp\n */\n config.audio.addEventListener(\"ratechange\", function() {\n run(\"ratechange\");\n });\n\n /*\n Event: seeked\n https://www.w3schools.com/tags/av_event_seeked.asp\n */\n config.audio.addEventListener(\"seeked\", function() {\n run(\"seeked\");\n });\n\n /*\n Event: seeking\n https://www.w3schools.com/tags/av_event_seeking.asp\n */\n config.audio.addEventListener(\"seeking\", function() {\n run(\"seeking\");\n });\n\n /*\n Event: stalled\n https://www.w3schools.com/tags/av_event_stalled.asp\n */\n config.audio.addEventListener(\"stalled\", function() {\n run(\"stalled\");\n });\n\n /*\n Event: suspend\n https://www.w3schools.com/tags/av_event_suspend.asp\n */\n config.audio.addEventListener(\"suspend\", function() {\n run(\"suspend\");\n });\n\n /*\n Event: timeupdate\n https://www.w3schools.com/tags/av_event_timeupdate.asp\n */\n config.audio.addEventListener(\"timeupdate\", function() {\n run(\"timeupdate\");\n });\n\n /*\n Event: volumechange\n https://www.w3schools.com/tags/av_event_volumechange.asp\n */\n config.audio.addEventListener(\"volumechange\", function() {\n run(\"volumechange\");\n });\n\n /*\n Event: waiting\n https://www.w3schools.com/tags/av_event_waiting.asp\n */\n config.audio.addEventListener(\"waiting\", function() {\n run(\"waiting\");\n });\n\n /*\n Event: canplay\n https://www.w3schools.com/tags/av_event_canplay.asp\n */\n config.audio.addEventListener(\"canplay\", function() {\n run(\"canplay\");\n });\n\n /*\n Event: canplaythrough\n https://www.w3schools.com/tags/av_event_canplaythrough.asp\n */\n config.audio.addEventListener(\"canplaythrough\", function() {\n run(\"canplaythrough\");\n });\n\n /*\n Event: durationchange\n https://www.w3schools.com/tags/av_event_durationchange.asp\n */\n config.audio.addEventListener(\"durationchange\", function() {\n run(\"durationchange\");\n });\n\n /*\n Event: ended\n https://www.w3schools.com/tags/av_event_ended.asp\n */\n config.audio.addEventListener(\"ended\", function() {\n run(\"ended\");\n });\n }\n\n /**\n * Runs a user defined callback method\n *\n * Public Accessor: Callbacks.run( callbackName )\n *\n * @access public\n * @param {string} callbackName - The name of the callback we are going to run.\n */\n function run(callbackName) {\n /*\n Checks to see if a user defined a callback method for the\n callback we are running.\n */\n if (config.callbacks[callbackName]) {\n /*\n Build the callback function\n */\n let callbackFunction = config.callbacks[callbackName];\n\n /*\n Write a debug message stating the callback we are running\n */\n Debug.writeMessage(\"Running Callback: \" + callbackName);\n\n /*\n Run the callback function and catch any errors\n */\n try {\n callbackFunction();\n } catch (error) {\n if (error.message == \"CANCEL EVENT\") {\n throw error;\n } else {\n Debug.writeMessage(\"Callback error: \" + error.message);\n }\n }\n }\n }\n\n return {\n initialize: initialize,\n run: run\n };\n})();\n\nexport default Callbacks;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/callbacks.js","/**\n * Handles the visual state for all of the mute elements.\n *\n * @module visual/MuteElements\n */\nlet MuteElements = (function() {\n /**\n * Syncs mute for all of the mute buttons. This represents the\n * state of the player if it's muted or not.\n *\n * @access public\n * @param {string} state \t- The muted state of the player.\n */\n function setMuted(state) {\n /*\n\t\t\tGet all of the mute buttons.\n\t\t*/\n let muteClasses = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterate over all of the mute classes. If the state of the player\n\t\t\tis not-muted then we add the amplitude-not-muted classe and remove\n\t\t\tthe amplitude muted class otherwise we do the opposite.\n\t\t*/\n for (let i = 0; i < muteClasses.length; i++) {\n if (!state) {\n muteClasses[i].classList.add(\"amplitude-not-muted\");\n muteClasses[i].classList.remove(\"amplitude-muted\");\n } else {\n muteClasses[i].classList.remove(\"amplitude-not-muted\");\n muteClasses[i].classList.add(\"amplitude-muted\");\n }\n }\n }\n\n return {\n setMuted: setMuted\n };\n})();\n\nexport default MuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/muteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Keeps the volume slider elements in sync.\n * @module visual/VolumeSliderElements\n */\nlet VolumeSliderElements = (function() {\n /**\n * Visually syncs the volume sliders so they are all the same if there\n * are more than one.\n *\n * @access public\n */\n function sync() {\n let volumeSliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume sliders for the song, setting the value\n\t\t\tto the config value.\n\t\t*/\n for (let i = 0; i < volumeSliders.length; i++) {\n volumeSliders[i].value = config.audio.volume * 100;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default VolumeSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/volumeSliderElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Repeater utility. Handles setting the repeat for all scenarios.\n *\n * @module utilities/Repeater\n */\nlet Repeater = (function() {\n /**\n * Sets the state of the repeat for a song.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n */\n function setRepeat(repeat) {\n /*\n Set the global repeat to be toggled\n */\n config.repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat for a playlist.\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat should be on or off\n * @param {string} playlist - The key of the playlist for repeating\n */\n function setRepeatPlaylist(repeat, playlist) {\n /*\n Set the playlist repeat to be toggled.\n */\n config.playlists[playlist].repeat = repeat;\n }\n\n /**\n * Sets the state of the repeat song\n *\n * @access public\n * @param {boolean} repeat - A boolean representing whether the repeat shoudl be on or off for the song.\n */\n function setRepeatSong(repeat) {\n config.repeat_song = repeat;\n }\n\n /*\n Returns the public facing methods\n */\n return {\n setRepeat: setRepeat,\n setRepeatPlaylist: setRepeatPlaylist,\n setRepeatSong: setRepeatSong\n };\n})();\n\nexport default Repeater;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/repeater.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Shuffle Module. Handles all of the shuffling functionality for\n * AmplitudeJS\n *\n * @module utilities/Shuffler\n */\nlet Shuffler = (function() {\n /**\n * Sets the shuffle state globally\n *\n * @access public\n * @param {boolean} shuffle - True when we are shuffling, false when we turn it off.\n */\n function setShuffle(shuffle) {\n config.shuffle_on = shuffle;\n\n if (shuffle) {\n shuffleSongs();\n } else {\n config.shuffle_list = [];\n }\n }\n\n /**\n * Toggles the shuffle status globally.\n *\n * @access public\n */\n function toggleShuffle() {\n /*\n If shuffle is on, we toggle it off. If shuffle is off, we\n toggle on.\n */\n if (config.shuffle_on) {\n config.shuffle_on = false;\n config.shuffle_list = [];\n } else {\n config.shuffle_on = true;\n shuffleSongs();\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n * @param {boolean} shuffle True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n config.playlists[playlist].shuffle = shuffle;\n\n if (config.playlists[playlist].shuffle) {\n shufflePlaylistSongs(playlist);\n } else {\n config.playlists[playlist].shuffle_list = [];\n }\n }\n\n /**\n * Sets the shuffle state for a playlist\n *\n * @access public\n * @param {string} playlist The key of the playlist we are shuffling.\n */\n function toggleShufflePlaylist(playlist) {\n /*\n If the playlist shuffled is on, we toggle it off. If the\n playlist shuffled is off, we toggle it on.\n */\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle = false;\n config.playlists[playlist].shuffle_list = [];\n } else {\n config.playlists[playlist].shuffle = true;\n shufflePlaylistSongs(playlist);\n }\n }\n\n /**\n * Shuffles individual songs in the config\n * Based off of: http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html\n *\n * Public Accessor: Shuffle.shuffleSongs()\n *\n * @access public\n */\n function shuffleSongs() {\n /*\n\t\t\tBuilds a temporary array with the length of the config.\n\t\t*/\n let shuffleTemp = new Array(config.songs.length);\n\n /*\n\t\t\tSet the temporary array equal to the songs array.\n\t\t*/\n for (let i = 0; i < config.songs.length; i++) {\n shuffleTemp[i] = config.songs[i];\n }\n\n /*\n\t\t\tIterate ove rthe songs and generate random numbers to\n\t\t\tswap the indexes of the shuffle array.\n\t\t*/\n for (let i = config.songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(Math.random() * config.songs.length + 1);\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n\t\t\tSet the shuffle list to the shuffle temp.\n\t\t*/\n config.shuffle_list = shuffleTemp;\n }\n\n /**\n * Shuffle songs in a playlist\n *\n * Public Accessor: Shuffle.shufflePlaylistSongs( playlist )\n *\n * @access public\n * @param {string} playlist - The playlist we are shuffling.\n */\n function shufflePlaylistSongs(playlist) {\n /*\n Builds a temporary array with the length of the playlist songs.\n */\n let shuffleTemp = new Array(config.playlists[playlist].songs.length);\n\n /*\n Set the temporary array equal to the playlist array.\n */\n for (let i = 0; i < config.playlists[playlist].songs.length; i++) {\n shuffleTemp[i] = config.playlists[playlist].songs[i];\n }\n\n /*\n Iterate ove rthe songs and generate random numbers to\n swap the indexes of the shuffle array.\n */\n for (let i = config.playlists[playlist].songs.length - 1; i > 0; i--) {\n let randNum = Math.floor(\n Math.random() * config.playlists[playlist].songs.length + 1\n );\n shuffleSwap(shuffleTemp, i, randNum - 1);\n }\n\n /*\n Set the shuffle list to the shuffle temp.\n */\n config.playlists[playlist].shuffle_list = shuffleTemp;\n }\n\n /**\n * Swaps and randomizes the song shuffle.\n *\n * @access private\n * @param {object} shuffleList \t- The list of songs that is going to be shuffled\n * @param {number} original \t\t- The original index of he song in the songs array\n * @param {number} random \t\t\t- The randomized index that will be the new index of the song in the shuffle array.\n */\n function shuffleSwap(shuffleList, original, random) {\n let temp = shuffleList[original];\n shuffleList[original] = shuffleList[random];\n shuffleList[random] = temp;\n }\n\n /**\n * Returns public facing methods\n */\n return {\n setShuffle: setShuffle,\n toggleShuffle: toggleShuffle,\n setShufflePlaylist: setShufflePlaylist,\n toggleShufflePlaylist: toggleShufflePlaylist,\n shuffleSongs: shuffleSongs,\n shufflePlaylistSongs: shufflePlaylistSongs\n };\n})();\n\nexport default Shuffler;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/shuffler.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the visual representation of AmplitudeJS song slider elements.\n * @module visual/SongSliderElements\n */\nlet SongSliderElements = (function() {\n /**\n * Syncs all of the song slider elements.\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function sync(location, playlist, songIndex) {\n syncMain(location);\n syncPlaylist(location, playlist);\n syncSong(location, songIndex);\n syncSongInPlaylist(location, playlist);\n }\n\n /**\n * Syncs the main slider location\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n */\n function syncMain(location) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the main song sliders\n\t\t*/\n const mainSongSliders = document.querySelectorAll(\".amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the main sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < mainSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlist = mainSongSliders[i].getAttribute(\"data-amplitude-playlist\");\n let song = mainSongSliders[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n This method is responsible for only the global elements,\n so we make sure there are no playlist or songs defined on\n the element.\n */\n if (playlist == null && song == null) {\n mainSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs playlist song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\tGets the playlist song sliders\n\t\t*/\n const playlistSongSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterates over all of the playlist sliders and sets the value to the\n\t\t\tpercentage of the song played.\n\t\t*/\n for (let i = 0; i < playlistSongSliders.length; i++) {\n /*\n Grab the playlist and song attributes from the element.\n */\n let playlistAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = playlistSongSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\tin.\n\t\t\t*/\n if (playlistAttribute == playlist && songAttribute == null) {\n playlistSongSliders[i].value = location;\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {number} songIndex \t- The index of the song we are adjusting the song slider for.\n */\n function syncSong(location, songIndex) {\n /*\n\t\t\tWe only want to sync song sliders if the playlist is null.\n\t\t*/\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure we have a location that's a number\n\t\t\t*/\n location = !isNaN(location) ? location : 0;\n\n /*\n\t\t\t\tGets the individual song sliders\n\t\t\t*/\n const songSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-song-index=\"' + songIndex + '\"]'\n );\n\n /*\n\t\t\t\tIterates over all of the individual song sliders and sets the value\n\t\t\t\tto the percentage of the song played.\n\t\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n /*\n\t Grab the playlist and song attributes from the element.\n\t */\n let playlistAttribute = songSliders[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songAttribute = songSliders[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n\t\t\t\t\tThis method is responsible for only the playlist elements,\n\t\t\t\t\tso we make sure the playlist attribute matches what is passed\n\t\t\t\t\tin.\n\t\t\t\t*/\n if (playlistAttribute == null && songAttribute == songIndex) {\n songSliders[i].value = location;\n }\n }\n }\n }\n\n /**\n * Syncs individual song slider locations\n *\n * @access public\n * @param {number} location \t- The location of the song as a percentage.\n * @param {string} playlist \t- The playlist we are setting the song slider for.\n */\n function syncSongInPlaylist(location, playlist) {\n /*\n\t\t\tEnsure we have a location that's a number\n\t\t*/\n location = !isNaN(location) ? location : 0;\n\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets the song in playlist sliders\n\t\t*/\n const songInPlaylistSliders = document.querySelectorAll(\n '.amplitude-song-slider[data-amplitude-playlist=\"' +\n playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tIterates over all of the song in playlist sliders and sets the value\n\t\t\tto the percentage of the song played.\n\t\t*/\n for (let i = 0; i < songInPlaylistSliders.length; i++) {\n songInPlaylistSliders[i].value = location;\n }\n }\n\n /**\n * Visually syncs the song sliders back to 0. This usually happens when\n * a song has changed, we ensure that all song sliders get reset.\n *\n * @access public\n */\n function resetElements() {\n let songSliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterate over all of the song sliders and set them to\n\t\t\t0 essentially resetting them.\n\t\t*/\n for (let i = 0; i < songSliders.length; i++) {\n songSliders[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n syncMain: syncMain,\n syncPlaylist: syncPlaylist,\n syncSong: syncSong,\n syncSongInPlaylist: syncSongInPlaylist,\n resetElements: resetElements\n };\n})();\n\nexport default SongSliderElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songSliderElements.js","/**\n * Imports the AmplitudeJS Current Time\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentTimeElements from \"./time/currentTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Hour Elements\n * @module visual/time/CurrentHourElements\n */\nimport CurrentHourElements from \"./time/currentHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Minute Elements\n * @module visual/time/CurrentMinuteElements\n */\nimport CurrentMinuteElements from \"./time/currentMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Current Second Elements\n * @module visual/time/CurrentTimeElements\n */\nimport CurrentSecondElements from \"./time/currentSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Count Down Time Elements\n * @module visual/time/DurationCountDownTimeElements\n */\nimport DurationCountDownTimeElements from \"./time/durationCountDownTimeElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Hour Elements\n * @module visual/time/DurationHourElements\n */\nimport DurationHourElements from \"./time/durationHourElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Minute Elements\n * @module visual/time/DurationMinuteElements\n */\nimport DurationMinuteElements from \"./time/durationMinuteElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Second Elements\n * @module visual/time/DurationSecondElements\n */\nimport DurationSecondElements from \"./time/durationSecondElements.js\";\n\n/**\n * Imports the AmplitudeJS Duration Time Elements\n * @module visual/time/DurationTimeElements\n */\nimport DurationTimeElements from \"./time/durationTimeElements.js\";\n\n/**\n * Time Elements Interface. This allows us to update all of the sub time elements\n * through one central point.\n * @module visual/TimeElements\n */\nlet TimeElements = (function() {\n /**\n * Resets the current times.\n */\n function resetCurrentTimes() {\n CurrentTimeElements.resetTimes();\n CurrentHourElements.resetTimes();\n CurrentMinuteElements.resetTimes();\n CurrentSecondElements.resetTimes();\n }\n\n /**\n * Syncs the current time elements to the time provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n */\n function syncCurrentTimes(currentTime) {\n CurrentTimeElements.sync(currentTime);\n CurrentHourElements.sync(currentTime.hours);\n CurrentMinuteElements.sync(currentTime.minutes);\n CurrentSecondElements.sync(currentTime.seconds);\n }\n\n /**\n * Resets the duration times.\n */\n function resetDurationTimes() {\n DurationCountDownTimeElements.resetTimes();\n DurationHourElements.resetTimes();\n DurationMinuteElements.resetTimes();\n DurationSecondElements.resetTimes();\n DurationTimeElements.resetTimes();\n }\n\n /**\n * Syncs the duration times to the times provided.\n *\n * @param {Object} currentTime - An object representing the current time of the audio.\n * @param {Object} songDuration - An object representing the duration of the audio\n */\n function syncDurationTimes(currentTime, songDuration) {\n DurationCountDownTimeElements.sync(currentTime, songDuration);\n DurationTimeElements.sync(songDuration);\n DurationHourElements.sync(songDuration.hours);\n DurationMinuteElements.sync(songDuration.minutes);\n DurationSecondElements.sync(songDuration.seconds);\n }\n\n /**\n * Returns the publically accessible methods.\n */\n return {\n resetCurrentTimes: resetCurrentTimes,\n syncCurrentTimes: syncCurrentTimes,\n resetDurationTimes: resetDurationTimes,\n syncDurationTimes: syncDurationTimes\n };\n})();\n\nexport default TimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/timeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the debug module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Handles the visualizations elements.\n *\n * @module Visualizations\n */\nlet Visualizations = (function() {\n /**\n * Runs all of the visualizations on the screen.\n */\n function run() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n /*\n If the web audio API is available, we display the visualizations.\n */\n if (config.web_audio_api_available) {\n /*\n If the visualization has not started, there are visualizations available,\n and we have at least one visualization element, then we continue.\n */\n if (\n Object.keys(config.visualizations.available).length > 0 &&\n visualizationElements.length > 0\n ) {\n /*\n Iterate over all of the visualizations on the page and activate the\n ones we need.\n */\n for (let i = 0; i < visualizationElements.length; i++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n runGlobalVisualization(visualizationElements[i]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n runPlaylistVisualization(visualizationElements[i], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n runSongVisualization(visualizationElements[i], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n runSongInPlaylistVisualization(\n visualizationElements[i],\n playlist,\n song\n );\n }\n }\n }\n } else {\n displayBackups();\n }\n }\n\n /**\n * Runs a global visualization\n *\n * @param {Node} element The container element that handles the visualization.\n */\n function runGlobalVisualization(element) {\n /*\n Gets the global visualization index and the active song visualization indexes\n so we know which visualization to use. The song will override the global\n */\n let globalVisualizationIndex = config.visualization;\n let activeSongVisualizationIndex =\n config.active_index != null\n ? config.songs[config.active_index].visualization\n : config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n\n /*\n If the active song visualization is defined and the visualization exists,\n use that visualization.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the user defined a global visualization, use that one.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n\n /*\n If the user didn't define a global visualization, use the first visualization\n registered if there is one.\n */\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n\n /**\n * Run a specific playlist visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} playlist The key of the playlist we are running the visualization for.\n */\n function runPlaylistVisualization(element, playlist) {\n /*\n If the playlist is equal to the active playlist, then we continue.\n */\n if (playlist == config.active_playlist) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the actual song has a visualization, we run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the actual playlist has a visualization, run that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If a global visualization is defined, run that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song specific visualization.\n *\n * @param {Node} element The container element that handles the visualization.\n * @param {string} song The song index that we are running the visualization for.\n */\n function runSongVisualization(element, song) {\n /*\n If the song is equal to the active song, then we continue.\n */\n if (song == config.active_index) {\n /*\n Get the indexes of the song\n */\n let activeSongVisualizationIndex =\n config.songs[config.active_index].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the song has a visualization, run that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the global visualization is set, use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Run a song in playlist visualization.\n *\n * @param {Node} element - The element containing the visualization.\n * @param {string} playlist - The string of the playlist key.\n * @param {index} song - The index of the song in the playlist.\n */\n function runSongInPlaylistVisualization(element, playlist, song) {\n /*\n If the playlist is the same as the active playlist and the active\n index of the song is the same as the song, then we continue.\n */\n if (\n playlist == config.active_playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Checks if the song has a visualization and that visualization exists,\n run that visualization.\n */\n let activeSongVisualizationIndex =\n config.playlists[config.active_playlist].songs[\n config.playlists[config.active_playlist].active_index\n ].visualization;\n let activePlaylistVisualizationIndex =\n config.playlists[config.active_playlist].visualization;\n let globalVisualizationIndex = config.visualization;\n\n /*\n If the active song has a visualization, we use that.\n */\n if (\n activeSongVisualizationIndex != undefined &&\n config.visualizations.available[activeSongVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activeSongVisualizationIndex, element);\n\n /*\n If the active playlist has a visualization, we use that.\n */\n } else if (\n activePlaylistVisualizationIndex != undefined &&\n config.visualizations.available[activePlaylistVisualizationIndex] !=\n undefined\n ) {\n addToActiveVisualizations(activePlaylistVisualizationIndex, element);\n\n /*\n If the global visualization has been set, we use that.\n */\n } else if (\n globalVisualizationIndex != undefined &&\n config.visualizations.available[globalVisualizationIndex] != undefined\n ) {\n addToActiveVisualizations(globalVisualizationIndex, element);\n } else {\n /*\n Grab the first registered visualization. If it exists, use that one.\n */\n let firstVisualization =\n Object.keys(config.visualizations.available).length > 0\n ? Object.keys(config.visualizations.available)[0]\n : null;\n\n if (firstVisualization != null) {\n addToActiveVisualizations(firstVisualization, element);\n }\n }\n }\n }\n\n /**\n * Add a visualization to the array of active visualizations.\n *\n * @param {string} key - The key of the active visualization.\n * @param {Node} element - The element that the visualization will be applied to.\n */\n function addToActiveVisualizations(key, element) {\n let visualization = new config.visualizations.available[key][\"object\"]();\n visualization.setPreferences(\n config.visualizations.available[key][\"preferences\"]\n );\n visualization.startVisualization(element);\n config.visualizations.active.push(visualization);\n }\n\n /**\n * Stops all active visualizations.\n */\n function stop() {\n /*\n Iterates over all of the visualizations and stop the visualization.\n */\n for (let i = 0; i < config.visualizations.active.length; i++) {\n config.visualizations.active[i].stopVisualization();\n }\n\n /*\n Clear the active visualizations.\n */\n config.visualizations.active = [];\n }\n\n /**\n * Registers any visualization we can use.\n *\n * @param {object} visualization The visualization object itself\n * @param {object} preferences User preferences overrides.\n */\n function register(visualization, preferences) {\n /*\n Initialize the new visualization.\n */\n let newVisualization = new visualization();\n\n /*\n\t Adds the visualization to the global config so it knows\n\t it can be used when playing songs.\n\n\t getID is a public function for getting a visualization's id.\n\t It becomes the key to access the visualization.\n\t */\n config.visualizations.available[newVisualization.getID()] = new Array();\n config.visualizations.available[newVisualization.getID()][\n \"object\"\n ] = visualization;\n config.visualizations.available[newVisualization.getID()][\n \"preferences\"\n ] = preferences;\n }\n\n /**\n * Displays the backups for the visualizations.\n */\n function displayBackups() {\n /*\n Get all of the visualization elements on the page\n */\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if (visualizationElements.length > 0) {\n for (let x = 0; x < visualizationElements.length; x++) {\n /*\n Grab the playlist and song attributes from the visualization to\n determine which one we run.\n */\n let playlist = visualizationElements[x].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = visualizationElements[x].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n If the playlist and song are null, it's a global visualization element.\n */\n if (playlist == null && song == null) {\n displayGlobalBackup(visualizationElements[x]);\n }\n\n /*\n if the playlist is not null and the song is null it's a playlist visualization\n element.\n */\n if (playlist != null && song == null) {\n displayPlaylistBackup(visualizationElements[x], playlist);\n }\n\n /*\n If the playlist is null and the song is not null it's a song visualization element.\n */\n if (playlist == null && song != null) {\n displaySongBackup(visualizationElements[x], song);\n }\n\n /*\n If the playlist and song are not null then it's a song in playlist visualization\n element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistBackup(visualizationElements[x], playlist, song);\n }\n }\n }\n }\n\n /**\n * Displays the global backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayGlobalBackup(element) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n\n /**\n * Displays the playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displayPlaylistBackup(element, playlist) {\n if (config.active_playlist == playlist) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongBackup(element, song) {\n if (config.active_index == song) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /**\n * Displays the song in playlist backup which is the cover art of the image in the\n * visualization container.\n *\n * @param {node} element - The element we are adding the background image to.\n */\n function displaySongInPlaylistBackup(element, playlist, song) {\n if (\n config.active_playlist == playlist &&\n config.playlists[active_playlist].active_index == song\n ) {\n element.style.backgroundImage =\n \"url(\" + config.active_metadata.cover_art_url + \")\";\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n run: run,\n stop: stop,\n register: register\n };\n})();\n\nexport default Visualizations;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/visualizations.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the initializer\n * @module init/AmplitudeInitializer\n */\nimport AmplitudeInitializer from \"../init/init.js\";\n\n/**\n * These helpers wrap around the basic methods of the Soundcloud API\n * and get the information we need from SoundCloud to make the songs\n * streamable through Amplitude\n *\n * @module soundcloud/SoundCloud\n */\nlet SoundCloud = (function() {\n /**\n * Defines the temporary user config used while we configure soundcloud\n * @type {object}\n */\n let tempUserConfig = {};\n\n /**\n * Loads the soundcloud SDK for use with Amplitude so the user doesn't have\n * to load it themselves.\n * With help from: http://stackoverflow.com/questions/950087/include-a-javascript-file-in-another-javascript-file\n *\n * @access public\n * @param {object} userConfig \t- The config defined by the user for AmplitudeJS\n */\n function loadSoundCloud(userConfig) {\n /*\n\t\t\tSets the temporary config to the config passed by the user so we can make changes\n\t\t\tand not break the actual config.\n\t\t*/\n tempUserConfig = userConfig;\n\n /*\n\t\t\tGets the head tag for the document and create a script element.\n\t\t*/\n let head = document.getElementsByTagName(\"head\")[0];\n let script = document.createElement(\"script\");\n\n script.type = \"text/javascript\";\n\n /*\n\t\t\tURL to the remote soundcloud SDK\n\t\t*/\n script.src = \"https://connect.soundcloud.com/sdk.js\";\n script.onreadystatechange = initSoundcloud;\n script.onload = initSoundcloud;\n\n /*\n\t\t\tAdd the script to the head of the document.\n\t\t*/\n head.appendChild(script);\n }\n\n /**\n * Initializes soundcloud with the key provided.\n *\n * @access private\n */\n function initSoundcloud() {\n /*\n\t\t\tCalls the SoundCloud initialize function\n\t\t\tfrom their API and sends it the client_id\n\t\t\tthat the user passed in.\n\t\t*/\n SC.initialize({\n client_id: config.soundcloud_client\n });\n\n /*\n\t\t\tGets the streamable URLs to run through Amplitue. This is\n\t\t\tVERY important since Amplitude can't stream the copy and pasted\n\t\t\tlink from the SoundCloud page, but can resolve the streaming\n\t\t\tURLs from the link.\n\t\t*/\n getStreamableURLs();\n }\n\n /**\n * Gets the streamable URL from the URL provided for\n * all of the soundcloud links. This will loop through\n * and set all of the information for the soundcloud\n * urls.\n *\n * @access private\n */\n function getStreamableURLs() {\n /*\n\t\t\tDefine the regex to find the soundcloud URLs\n\t\t*/\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n for (let i = 0; i < config.songs.length; i++) {\n /*\n\t\t\t\tIf the URL matches soundcloud, we grab\n\t\t\t\tthat url and get the streamable link\n\t\t\t\tif there is one.\n\t\t\t*/\n if (config.songs[i].url.match(soundcloud_regex)) {\n config.soundcloud_song_count++;\n resolveStreamable(config.songs[i].url, i);\n }\n }\n }\n\n /**\n * Resolves an individual streamable URL.\n *\n * @param {string} url - The URL of the SoundCloud song to get the streamable URL from.\n * @param {string} playlist - The playlist we are getting the streamable URL for.\n * @param {Integer} index - The index of the song in the playlist or the songs array.\n * @param {boolean} addToShuffleList - Whether we add to the shuffle list for the songs or playlist.\n *\n */\n function resolveIndividualStreamableURL(\n url,\n playlist,\n index,\n addToShuffleList = false\n ) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n If streamable we get the url and bind the client ID to the end\n so Amplitude can just stream the song normally. We then overwrite\n the url the user provided with the streamable URL.\n */\n if (sound.streamable) {\n if (playlist != null) {\n config.playlists[playlist].songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n }\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.playlists[playlist].songs[index].cover_art_url =\n sound.artwork_url;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[index].cover_art_url =\n sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.playlists[playlist].songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.playlists[playlist].shuffle_list[\n index\n ].soundcloud_data = sound;\n }\n } else {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n if (addToShuffleList) {\n config.shuffle_list[index].stream_url +\n \"?client_id=\" +\n config.soundcloud_client;\n }\n\n /*\n If the user want's to use soundcloud art, we overwrite the\n cover_art_url with the soundcloud artwork url.\n */\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n\n if (addToShuffleList) {\n config.shuffle_list[index].cover_art_url = sound.artwork_url;\n }\n }\n\n /*\n Grab the extra metadata from soundcloud and bind it to the\n song. The user can get this through the public function:\n getActiveSongMetadata\n */\n config.songs[index].soundcloud_data = sound;\n\n if (addToShuffleList) {\n config.shuffle_list[index].soundcloud_data = sound;\n }\n }\n } else {\n if (playlist != null) {\n AmplitudeHelpers.writeDebugMessage(\n config.playlists[playlist].songs[index].name +\n \" by \" +\n config.playlists[playlist].songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n } else {\n /*\n If not streamable, then we print a message to the user stating\n that the song with name X and artist X is not streamable. This\n gets printed ONLY if they have debug turned on.\n */\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n }\n });\n }\n\n /**\n * Due to Soundcloud SDK being asynchronous, we need to scope the\n * index of the song in another function. The privateGetSoundcloudStreamableURLs\n * function does the actual iteration and scoping.\n *\n * @access private\n * @param {string} url \t\t- URL of the soundcloud song\n * @param {number} index \t- The index of the soundcloud song in the songs array.\n */\n function resolveStreamable(url, index) {\n SC.get(\"/resolve/?url=\" + url, function(sound) {\n /*\n\t\t\t\tIf streamable we get the url and bind the client ID to the end\n\t\t\t\tso Amplitude can just stream the song normally. We then overwrite\n\t\t\t\tthe url the user provided with the streamable URL.\n\t\t\t*/\n if (sound.streamable) {\n config.songs[index].url =\n sound.stream_url + \"?client_id=\" + config.soundcloud_client;\n\n /*\n\t\t\t\t\tIf the user want's to use soundcloud art, we overwrite the\n\t\t\t\t\tcover_art_url with the soundcloud artwork url.\n\t\t\t\t*/\n if (config.soundcloud_use_art) {\n config.songs[index].cover_art_url = sound.artwork_url;\n }\n\n /*\n\t\t\t\t\tGrab the extra metadata from soundcloud and bind it to the\n\t\t\t\t\tsong. The user can get this through the public function:\n\t\t\t\t\tgetActiveSongMetadata\n\t\t\t\t*/\n config.songs[index].soundcloud_data = sound;\n } else {\n /*\n\t\t\t\t\tIf not streamable, then we print a message to the user stating\n\t\t\t\t\tthat the song with name X and artist X is not streamable. This\n\t\t\t\t\tgets printed ONLY if they have debug turned on.\n\t\t\t\t*/\n AmplitudeHelpers.writeDebugMessage(\n config.songs[index].name +\n \" by \" +\n config.songs[index].artist +\n \" is not streamable by the Soundcloud API\"\n );\n }\n /*\n\t\t\t\tIncrements the song ready counter.\n\t\t\t*/\n config.soundcloud_songs_ready++;\n\n /*\n\t\t\t\tWhen all songs are accounted for, then amplitude is ready\n\t\t\t\tto rock and we set the rest of the config.\n\t\t\t*/\n if (config.soundcloud_songs_ready == config.soundcloud_song_count) {\n AmplitudeInitializer.setConfig(tempUserConfig);\n }\n });\n }\n\n /**\n * Determines if a given URL is a SoundCloud URL.\n *\n * @param {string} url - The URL to test if it's a SoundCloud URL.\n */\n function isSoundCloudURL(url) {\n let soundcloud_regex = /^https?:\\/\\/(soundcloud.com|snd.sc)\\/(.*)$/;\n\n return url.match(soundcloud_regex);\n }\n\n /*\n\t\tReturns the publically accessible methods\n\t*/\n return {\n loadSoundCloud: loadSoundCloud,\n resolveIndividualStreamableURL: resolveIndividualStreamableURL,\n isSoundCloudURL: isSoundCloudURL\n };\n})();\n\nexport default SoundCloud;\n\n\n\n// WEBPACK FOOTER //\n// ./src/soundcloud/soundcloud.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Defines the Playback Speed Visual Elements Handler\n * @module visual/PlaybackSpeedElements\n */\nlet PlaybackSpeedElements = (function() {\n /**\n * Sets all of the visual playback speed buttons to have the right class\n * to display the background image that represents the current playback\n * speed.\n *\n * @access public\n */\n function sync() {\n /*\n\t\t\tGets all of the playback speed classes.\n\t\t*/\n let playbackSpeedClasses = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes\n\t\t\tapplying the right speed class for visual purposes.\n\t\t*/\n for (let i = 0; i < playbackSpeedClasses.length; i++) {\n /*\n\t\t\t\tRemoves all of the old playback speed classes.\n\t\t\t*/\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-10\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-15\");\n playbackSpeedClasses[i].classList.remove(\"amplitude-playback-speed-20\");\n\n /*\n\t\t\t\tSwitch the current playback speed and apply the appropriate\n\t\t\t\tspeed class.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-10\");\n break;\n case 1.5:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-15\");\n break;\n case 2:\n playbackSpeedClasses[i].classList.add(\"amplitude-playback-speed-20\");\n break;\n }\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync\n };\n})();\n\nexport default PlaybackSpeedElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/playbackSpeedElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the shuffle elements\n * @module visual/ShuffleElements\n */\nlet ShuffleElements = (function() {\n /**\n * Syncs the global shuffle button visual state.\n *\n * @access public\n */\n function syncMain() {\n /*\n\t\t\tGets the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterate over all of the shuffle buttons.\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tEnsure the shuffle button doesn't belong to a playlist. We have\n\t\t\t\ta separate method for that.\n\t\t\t*/\n if (shuffleButtons[i].getAttribute(\"data-amplitude-playlist\") == null) {\n /*\n\t\t\t\t\tIf the state of the player is shuffled on, true, then\n\t\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\t\tthen we do the opposite.\n\t\t\t\t*/\n if (config.shuffle_on) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n }\n\n /**\n * Syncs the playlist shuffle button visual state.\n *\n * @access public\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function syncPlaylist(playlist) {\n /*\n\t\t\tGets all of the shuffle buttons.\n\t\t*/\n let shuffleButtons = document.querySelectorAll(\n '.amplitude-shuffle[data-amplitude-playlist=\"' + playlist + '\"]'\n );\n\n /*\n\t\t\tIterate over all of the shuffle buttons\n\t\t*/\n for (let i = 0; i < shuffleButtons.length; i++) {\n /*\n\t\t\t\tIf the state of the playlist is shuffled on, true, then\n\t\t\t\twe add the 'amplitude-shuffle-on' class and remove the\n\t\t\t\t'amplitude-shuffle-off' class. If the player is not shuffled\n\t\t\t\tthen we do the opposite.\n\t\t\t*/\n if (config.playlists[playlist].shuffle) {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-on\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-off\");\n } else {\n shuffleButtons[i].classList.add(\"amplitude-shuffle-off\");\n shuffleButtons[i].classList.remove(\"amplitude-shuffle-on\");\n }\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n syncMain: syncMain,\n syncPlaylist: syncPlaylist\n };\n})();\n\nexport default ShuffleElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/shuffleElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles the syncing of the song played progress elements.\n *\n * @module visual/SongPlayedProgressElements\n */\nlet SongPlayedProgressElements = (function() {\n /**\n * Syncs the song played progress bars. These are HTML5 progress elements.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percentage of the song that has been played.\n */\n function sync(songPlayedPercentage) {\n syncGlobal(songPlayedPercentage);\n syncPlaylist(songPlayedPercentage);\n syncSong(songPlayedPercentage);\n syncSongInPlaylist(songPlayedPercentage);\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the global progress bar.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncGlobal(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n \".amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is the playlist progress bar.\n *\n * @access public\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let song = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSong(percentage) {\n if (config.active_playlist == null) {\n /*\n\t\t\t\tEnsure that the song completion percentage is a number\n\t\t\t*/\n if (!isNaN(percentage)) {\n /*\n\t\t\t\t\tGet all of the song progress bars\n\t\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n }\n\n /**\n * Sync how much has been played with a progress bar. This is for an individual song in playlist.\n *\n * @access private\n * @param {number} songPlayedPercentage \t- The percent of the song completed.\n */\n function syncSongInPlaylist(percentage) {\n /*\n\t\t\tEnsure that the song completion percentage is a number\n\t\t*/\n if (!isNaN(percentage)) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\t\tGet all of the song progress bars\n\t\t\t*/\n let songPlayedProgressBars = document.querySelectorAll(\n '.amplitude-song-played-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n Iterates over all of the song played progress elements\n and sets them accordingly.\n */\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n let playlist = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = songPlayedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist != null && songIndex != null) {\n let max = songPlayedProgressBars[i].max;\n\n songPlayedProgressBars[i].value = (percentage / 100) * max;\n }\n }\n }\n }\n\n /**\n * Sets all of the song played progress bars to 0\n *\n * @access public\n */\n function resetElements() {\n let songPlayedProgressBars = document.getElementsByClassName(\n \"amplitude-song-played-progress\"\n );\n\n for (let i = 0; i < songPlayedProgressBars.length; i++) {\n songPlayedProgressBars[i].value = 0;\n }\n }\n\n return {\n sync: sync,\n resetElements: resetElements\n };\n})();\n\nexport default SongPlayedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/songPlayedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Core Module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * AmplitudeJS SoundCloud Module\n * @module soundcloud/SoundCloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Imports the utilities used by the main module.\n */\n/**\n * AmplitudeJS Config State Module\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Module\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * AmplitudeJS Events Module\n * @module events/Events\n */\nimport Events from \"../events/events.js\";\n\n/**\n * AmplitudeJS FX Module\n * @module fx/Fx\n */\nimport Fx from \"../fx/fx.js\";\n\n/**\n * AmplitudeJS Visualizations Module\n * @module fx/Visualizations\n */\nimport Visualizations from \"../fx/visualizations.js\";\n\n/**\n * AmplitudeJS WaveForm Module\n * @module fx/WaveForm\n */\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * AmplitudeJS Audio Navigation Module.\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Playlists Initializer Module\n * @module init/Playlists\n */\nimport PlaylistsInitializer from \"./playlists.js\";\n\n/**\n * Imports the AmplitudeJS Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Imports the AmplitudeJS Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Volume Slider\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Imports the AmplitudeJS Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the AmplitudeJS Play/Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS MetaData Elements Module.\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * Imports the AmplitudeJS PlaybackSpeedElements Module.\n * @module visual/PlayBackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Initializer Module. Helps with the handling of all of the\n * initialization for AmplitudeJS.\n *\n * @module init/Initializer\n */\nlet Initializer = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json )\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function initialize(userConfig) {\n let ready = false;\n\n /*\n\t\t\tReset the config on init so we have a clean slate. This is if the\n\t\t\tuser has to re-init.\n\t\t*/\n ConfigState.resetConfig();\n\n /*\n\t\t\tInitialize event handlers on init. This will clear any old\n\t\t\tevent handlers on the amplitude element and re-bind what is\n\t\t\tnecessary.\n\t\t*/\n Events.initialize();\n\n /*\n Initialize the callbacks we listen to for the audio object.\n */\n Callbacks.initialize();\n\n /*\n\t\t\tInitializes debugging right away so we can use it for the rest\n\t\t\tof the configuration.\n\t\t*/\n config.debug = userConfig.debug != undefined ? userConfig.debug : false;\n\n /*\n Set default artwork, if specified.\n */\n setArt(userConfig);\n\n /*\n\t\t\tChecks to see if the user has songs defined.\n\t\t*/\n if (userConfig.songs) {\n /*\n\t\t\t\tChecks to see if the user has some songs in the songs array.\n\t\t\t*/\n if (userConfig.songs.length != 0) {\n /*\n\t\t\t\t\tCopies over the user defined songs. and prepares\n\t\t\t\t\tAmplitude for the rest of the configuration.\n\t\t\t\t*/\n config.songs = userConfig.songs;\n /*\n\t\t\t\t\tFlag amplitude as ready.\n\t\t\t\t*/\n ready = true;\n } else {\n Debug.writeMessage(\"Please add some songs, to your songs object!\");\n }\n } else {\n Debug.writeMessage(\n \"Please provide a songs object for AmplitudeJS to run!\"\n );\n }\n\n /*\n\t\t\tInitializes the audio context. In this method it checks to see if the\n\t\t\tuser wants to use visualizations or not before proceeding.\n\t\t*/\n if (Fx.webAudioAPIAvailable()) {\n if (Fx.determineUsingAnyFX()) {\n /*\n Configure the Web Audio API If It's available.\n */\n Fx.configureWebAudioAPI();\n\n /*\n Activates the audio context after an event for the user.\n */\n document.documentElement.addEventListener(\"mousedown\", function() {\n if (config.context.state !== \"running\") {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\"keydown\", function() {\n if (config.context.state !== \"running\") {\n config.context.resume();\n }\n });\n\n document.documentElement.addEventListener(\"keyup\", function() {\n if (config.context.state !== \"running\") {\n config.context.resume();\n }\n });\n\n /*\n Set the user waveform settings if provided.\n */\n if (\n userConfig.waveforms != undefined &&\n userConfig.waveforms.sample_rate != undefined\n ) {\n config.waveforms.sample_rate = userConfig.waveforms.sample_rate;\n }\n\n /*\n Initialize the waveform.\n */\n WaveForm.init();\n\n /*\n If the user is registering visualizations on init,\n we set them right away.\n */\n if (\n userConfig.visualizations != undefined &&\n userConfig.visualizations.length > 0\n ) {\n /*\n Iterate over all of the visualizations and\n register them in our player.\n */\n for (let i = 0; i < userConfig.visualizations.length; i++) {\n Visualizations.register(\n userConfig.visualizations[i].object,\n userConfig.visualizations[i].params\n );\n }\n }\n }\n } else {\n Debug.writeMessage(\n \"The Web Audio API is not available on this platform. We are using your defined backups!\"\n );\n }\n\n /*\n Initialize default live settings\n */\n initializeDefaultLiveSettings();\n\n /*\n Initialize default song indexes\n */\n initializeDefaultSongIndexes();\n\n /*\n\t\t\tWhen the preliminary config is ready, we are ready to proceed.\n\t\t*/\n if (ready) {\n /*\n\t\t\t\tCopies over the soundcloud information to the global config\n\t\t\t\twhich will determine where we go from there.\n\t\t\t*/\n config.soundcloud_client =\n userConfig.soundcloud_client != undefined\n ? userConfig.soundcloud_client\n : \"\";\n\n /*\n\t\t\t\tChecks if we want to use the art loaded from soundcloud.\n\t\t\t*/\n config.soundcloud_use_art =\n userConfig.soundcloud_use_art != undefined\n ? userConfig.soundcloud_use_art\n : \"\";\n\n /*\n\t\t\t\tIf the user provides a soundcloud client then we assume that\n\t\t\t\tthere are URLs in their songs that will reference SoundCloud.\n\t\t\t\tWe then copy over the user config they provided to the\n\t\t\t\ttemp_user_config so we don't mess up the global or their configs\n\t\t\t\tand load the soundcloud information.\n\t\t\t*/\n let tempUserConfig = {};\n\n /*\n If there's a soundcloud_client key set, we load the SoundCloud data\n for all of the songs in the array.\n */\n if (config.soundcloud_client != \"\") {\n tempUserConfig = userConfig;\n\n /*\n\t\t\t\t\tLoad up SoundCloud for use with AmplitudeJS.\n\t\t\t\t*/\n SoundCloud.loadSoundCloud(tempUserConfig);\n } else {\n /*\n\t\t\t\t\tThe user is not using Soundcloud with Amplitude at this point\n\t\t\t\t\tso we just finish the configuration with the users's preferences.\n\t\t\t\t*/\n setConfig(userConfig);\n }\n }\n\n /*\n\t\t\tDebug out what was initialized with AmplitudeJS.\n\t\t*/\n Debug.writeMessage(\"Initialized With: \");\n Debug.writeMessage(config);\n }\n\n /**\n * Rebinds all of the elements in the display.\n *\n * Public Accessor: Amplitude.rebindDisplay()\n * @access public\n */\n function rebindDisplay() {\n Events.initialize();\n MetaDataElements.displayMetaData();\n }\n\n /**\n * Finishes the initalization of the config. Takes all of the user defined\n * parameters and makes sure they override the defaults. The important\n * config information is assigned in the publicInit() function.\n *\n * This function can be called from 2 different locations:\n * \t1. Right away on init after the important settings are defined.\n *\n * \t2. After all of the Soundcloud URLs are resolved properly and\n *\t \tsoundcloud is configured. We will need the proper URLs from Soundcloud\n * \t\tto stream through Amplitude so we get those right away before we\n * \t\tset the information and the active song\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setConfig(userConfig) {\n /*\n Checks if the user has any playlists defined. If they do\n we have to initialize the functionality for the playlists.\n */\n if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) {\n PlaylistsInitializer.initialize(userConfig.playlists);\n }\n\n /*\n\t\t\tCheck to see if the user entered a start song\n\t\t*/\n if (userConfig.start_song != undefined && !userConfig.starting_playlist) {\n /*\n\t\t\t\tEnsure what has been entered is an integer.\n\t\t\t*/\n if (Checks.isInt(userConfig.start_song)) {\n AudioNavigation.changeSong(\n config.songs[userConfig.start_song],\n userConfig.start_song\n );\n } else {\n Debug.writeMessage(\n \"You must enter an integer index for the start song.\"\n );\n }\n } else {\n AudioNavigation.changeSong(config.songs[0], 0);\n }\n\n /*\n If the shuffle is on by default, shuffle the songs and\n switch to the shuffled song.\n */\n if (userConfig.shuffle_on != undefined && userConfig.shuffle_on) {\n config.shuffle_on = true;\n Shuffler.shuffleSongs();\n\n AudioNavigation.changeSong(config.shuffle_list[0], 0);\n }\n\n /*\n\t\t\tAllows the user to set whether they want to continue to the next song\n\t\t\twhen the current song finishes or not. In any scenario that's not a playlist,\n\t\t\tcontining to the next song may not be desired.\n\t\t*/\n config.continue_next =\n userConfig.continue_next != undefined ? userConfig.continue_next : true;\n\n /*\n\t\t\tIf the user defined a playback speed, we copy over their\n\t\t\tpreference here, otherwise we default to normal playback\n\t\t\tspeed of 1.0.\n\t\t*/\n config.playback_speed =\n userConfig.playback_speed != undefined ? userConfig.playback_speed : 1.0;\n\n /*\n\t\t\tSets the audio playback speed.\n\t\t*/\n Core.setPlaybackSpeed(config.playback_speed);\n\n /*\n\t\t\tIf the user wants the song to be pre-loaded for instant\n\t\t\tplayback, they set it to true. By default it's set to just\n\t\t\tload the metadata.\n\t\t*/\n config.audio.preload =\n userConfig.preload != undefined ? userConfig.preload : \"auto\";\n\n /*\n\t\t\tInitializes the user defined callbacks. This should be a JSON\n\t\t\tobject that contains a key->value store of the callback name\n\t\t\tand the name of the function the user needs to call.\n\t\t*/\n config.callbacks =\n userConfig.callbacks != undefined ? userConfig.callbacks : {};\n\n /*\n\t\t\tInitializes the user defined key bindings. This should be a JSON\n\t\t\tobject that contains a key->value store of the key event number\n\t\t\tpressed and the method to be run.\n\t\t*/\n config.bindings =\n userConfig.bindings != undefined ? userConfig.bindings : {};\n\n /*\n\t\t\tThe user can define a starting volume in a range of 0-100 with\n\t\t\t0 being muted and 100 being the loudest. After the config is set\n\t\t\tAmplitude sets the active song's volume to the volume defined\n\t\t\tby the user.\n\t\t*/\n config.volume = userConfig.volume != undefined ? userConfig.volume : 50;\n\n /*\n\t\t\tSets the delay between songs if the user has it set. This should be in MS.\n\t\t*/\n config.delay = userConfig.delay != undefined ? userConfig.delay : 0;\n\n /*\n\t\t\tThe user can set the volume increment and decrement values between 1 and 100\n\t\t\tfor when the volume up or down button is pressed. The default is an increase\n\t\t\tor decrease of 5.\n\t\t*/\n config.volume_increment =\n userConfig.volume_increment != undefined\n ? userConfig.volume_increment\n : 5;\n\n config.volume_decrement =\n userConfig.volume_decrement != undefined\n ? userConfig.volume_decrement\n : 5;\n\n /*\n\t\t\tSet the volume to what is defined in the config. The user can define this,\n\t\t\tso we should set it up that way.\n\t\t*/\n Core.setVolume(config.volume);\n\n /*\n Set default artwork, if specified\n */\n setArt(userConfig);\n\n /*\n Initialize the visual elements\n */\n initializeElements();\n\n /*\n\t\t\tIf the user has selected a starting playlist, we need to set the starting playlist\n\t\t\tand sync the visuals\n\t\t*/\n if (\n userConfig.starting_playlist != undefined &&\n userConfig.starting_playlist != \"\"\n ) {\n /*\n\t\t\t\tSet the active playlist to the starting playlist by the user\n\t\t\t*/\n config.active_playlist = userConfig.starting_playlist;\n\n /*\n\t\t\t\tCheck if the user defined a song to start with in the playlist.\n\t\t\t*/\n if (\n userConfig.starting_playlist_song != undefined &&\n userConfig.starting_playlist_song != \"\"\n ) {\n /*\n\t\t\t\t\tEnsure the song is a valid index.\n\t\t\t\t*/\n if (\n typeof userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ] != undefined\n ) {\n /*\n\t\t\t\t\t\tSet the player to the song defined by the user.\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[\n parseInt(userConfig.starting_playlist_song)\n ],\n parseInt(userConfig.starting_playlist_song)\n );\n } else {\n /*\n\t\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n /*\n\t\t\t\t\t\tDebug that the song index doesn't exist\n\t\t\t\t\t*/\n Debug.writeMessage(\n \"The index of \" +\n userConfig.starting_playlist_song +\n \" does not exist in the playlist \" +\n userConfig.starting_playlist\n );\n }\n } else {\n /*\n\t\t\t\t\tSet the player to the first song in the playlist\n\t\t\t\t*/\n AudioNavigation.changeSong(\n config.active_playlist,\n userConfig.playlists[userConfig.starting_playlist].songs[0],\n 0\n );\n }\n\n /*\n\t\t\t\tSync the main and song play pause buttons.\n\t\t\t*/\n PlayPauseElements.sync();\n }\n\n /*\n\t\t\tRun after init callback\n\t\t*/\n Callbacks.run(\"initialized\");\n }\n\n /**\n * Sets the default_album_art and default_playlist_art from the\n * user supplied configuration.\n *\n * @access public\n * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.\n */\n function setArt(userConfig) {\n /*\n If the user defines default album art, this image will display if the active\n song doesn't have album art defined.\n */\n if (userConfig.default_album_art != undefined) {\n config.default_album_art = userConfig.default_album_art;\n } else {\n config.default_album_art = \"\";\n }\n\n /*\n\t\t\tIf the user defines default playlist art, this image will display if the user\n\t\t\ttries to set up a playlist meta data image tag but doesn't have one defined.\n\t\t*/\n if (userConfig.default_playlist_art != undefined) {\n config.default_playlist_art = userConfig.default_playlist_art;\n } else {\n config.default_playlist_art = \"\";\n }\n }\n\n /**\n * Initializes all of the elements on the page to the default starting point\n * to build from there.\n *\n * @access private\n */\n function initializeElements() {\n /*\n\t\t\tVisually sync the shuffle statuses\n\t\t*/\n ShuffleElements.syncMain();\n\n /*\n\t\t\tSync Mute Elements.\n\t\t*/\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync Volume Slider Elements\n\t\t*/\n VolumeSliderElements.sync();\n\n /*\n\t\t\tSyncs all of the playback speed elements.\n\t\t*/\n PlaybackSpeedElements.sync();\n\n /*\n\t\t\tSyncs all of the visual time elements to 00.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tSets all of the play pause buttons to pause.\n\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\tSets the meta data for the songs automatically.\n\t\t*/\n MetaDataElements.syncMetaData();\n\n /*\n\t\t\tSets the repeat buttons automatically.\n\t\t*/\n RepeatElements.syncRepeatSong();\n }\n\n /**\n * Counts the number of playlists the user has configured. This ensures\n * that the user has at least 1 playlist so we can validate the songs\n * defined in the playlist are correct and they didn't enter an invalid\n * ID.\n *\n * @access private\n * @param {object} playlists \t-\n */\n function countPlaylists(playlists) {\n /*\n\t\t\tInitialize the placeholders to iterate through the playlists\n\t\t\tand find out how many we have to account for.\n\t\t*/\n let size = 0,\n key;\n\n /*\n\t\t\tIterate over playlists and if the user has the playlist defined,\n\t\t\tincrement the size of playlists.\n\t\t*/\n for (key in playlists) {\n if (playlists.hasOwnProperty(key)) {\n size++;\n }\n }\n\n /*\n\t\t\tDebug how many playlists are in the config.\n\t\t*/\n Debug.writeMessage(\"You have \" + size + \" playlist(s) in your config\");\n\n /*\n\t\t\tReturn the number of playlists in the config.\n\t\t*/\n return size;\n }\n\n /**\n * Intializes the default live settings for all of the songs.\n *\n * @access private\n */\n function initializeDefaultLiveSettings() {\n for (let i = 0; i < config.songs.length; i++) {\n if (config.songs[i].live == undefined) {\n config.songs[i].live = false;\n }\n }\n }\n\n /**\n * Initializes the index of the song in the songs array so\n * we can reference it if needed\n *\n * @access private\n */\n function initializeDefaultSongIndexes() {\n for (let i = 0; i < config.songs.length; i++) {\n config.songs[i].index = i;\n }\n }\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n initialize: initialize,\n setConfig: setConfig,\n rebindDisplay: rebindDisplay\n };\n})();\n\nexport default Initializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/init.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Builds a waveform for the current audio.\n * Help from: https://robots.thoughtbot.com/javascript-audio-api\n * https://stackoverflow.com/questions/21347833/html-svg-not-drawing-works-in-other-pages\n */\nlet WaveForm = (function() {\n /*\n Initialize the local variables used in the Waveform.\n */\n let buffer = \"\";\n let sampleRate = \"\";\n let peaks = \"\";\n\n function init() {\n sampleRate = config.waveforms.sample_rate;\n\n /*\n Grabs all of the waveform elements on the page.\n */\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n If there are waveforms, we iterate over them and set them up to display\n properly.\n */\n if (waveforms.length > 0) {\n /*\n Iterate over all of the waveforms and build the SVG parts.\n */\n for (let i = 0; i < waveforms.length; i++) {\n /*\n Clear the inner HTML of the element if we are replacing the waveform.\n */\n waveforms[i].innerHTML = \"\";\n\n /*\n Inserts an SVG into the element.\n */\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.setAttribute(\"viewBox\", \"0 -1 \" + sampleRate + \" 2\");\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n\n /*\n Add a g component to the SVG\n */\n let g = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svg.appendChild(g);\n\n /*\n Add a path component to the g\n */\n let path = document.createElementNS(\n \"http://www.w3.org/2000/svg\",\n \"path\"\n );\n path.setAttribute(\"d\", \"\");\n path.setAttribute(\"id\", \"waveform\");\n\n g.appendChild(path);\n\n /*\n Append the SVG to the waveform.\n */\n waveforms[i].appendChild(svg);\n }\n }\n }\n\n /**\n * Builds each waveform for the page.\n */\n function build() {\n if (config.web_audio_api_available) {\n /*\n If we don't have the wave form built, we need to build the waveform by loading\n the src with an array buffer.\n */\n if (\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] == undefined\n ) {\n /*\n Initializes a new XML Http Request.\n */\n var req = new XMLHttpRequest();\n\n /*\n Opens the src parameter for the audio file to read in.\n */\n req.open(\"GET\", config.audio.src, true);\n req.responseType = \"arraybuffer\";\n\n /*\n When the ready state changes, check to see if we can render the\n wave form.\n */\n req.onreadystatechange = function(e) {\n /*\n When the request is complete, then we begin decoding the\n audio to build the waveform.\n */\n if (req.readyState == 4) {\n /*\n If the status is 200 means the response is a success and\n we decode the audio data.\n */\n if (req.status == 200) {\n /*\n Decode the audio data and process the waveform.\n */\n config.context.decodeAudioData(req.response, function(\n bufferedAudio\n ) {\n /*\n Set the buffer to the audio returned.\n */\n buffer = bufferedAudio;\n\n /*\n Get the peaks in the audio.\n */\n peaks = getPeaks(sampleRate, buffer);\n\n /*\n Build the SVG\n */\n process(sampleRate, buffer, peaks);\n });\n }\n }\n };\n req.send();\n } else {\n /*\n If we already have a waveform, we grab the waveform that\n was created for the song and display it. We do a simple hash\n of the song URL so it's already unique.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n }\n\n /**\n * Processes the audio and generates the waveform.\n *\n * @param {sampleRate} sampleRate - The rate we should sample the audio.\n * @param {arraybuffer} buffer - The Web Audio API\n * @param {array} peaks - The peaks in the audio.\n */\n function process(sampleRate, buffer, peaks) {\n /*\n If we have a buffer, we find the peaks in the audio.\n */\n if (buffer) {\n /*\n Get the total peaks in the song.\n */\n let totalPeaks = peaks.length;\n\n /*\n Figure out the depth of the peak.\n */\n let d = \"\";\n for (let peakNumber = 0; peakNumber < totalPeaks; peakNumber++) {\n if (peakNumber % 2 === 0) {\n d += ` M${~~(peakNumber / 2)}, ${peaks.shift()}`;\n } else {\n d += ` L${~~(peakNumber / 2)}, ${peaks.shift()}`;\n }\n }\n\n /*\n Add the waveform to the built waveforms array.\n */\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ] = d;\n\n /*\n Display the waveform.\n */\n displayWaveForms(\n config.waveforms.built[\n Math.abs(\n config.audio.src.split(\"\").reduce(function(a, b) {\n a = (a << 5) - a + b.charCodeAt(0);\n return a & a;\n }, 0)\n )\n ]\n );\n }\n }\n\n /**\n * Get the peaks of the audio for the waveform.\n *\n * @param {number} length - The sample size of the audio.\n * @param {array} buffer - The array buffer used to find the peaks in the audio.\n */\n function getPeaks(length, buffer) {\n /*\n Set the parameters needed to build the SVG.\n */\n const sampleSize = buffer.length / length;\n const sampleStep = ~~(sampleSize / 10) || 1;\n const numberOfChannels = buffer.numberOfChannels;\n const mergedPeaks = [];\n\n /*\n Iterate over the channels and find the peaks.\n */\n for (\n let channelNumber = 0;\n channelNumber < numberOfChannels;\n channelNumber++\n ) {\n /*\n Initialize the peaks array and set the channel data to what\n the buffer has in its channel data.\n */\n const peaks = [];\n const channelData = buffer.getChannelData(channelNumber);\n\n /*\n Iterate over peaks with respect to the sample size.\n */\n for (let peakNumber = 0; peakNumber < length; peakNumber++) {\n /*\n Gt the start and end peak.\n */\n const start = ~~(peakNumber * sampleSize);\n const end = ~~(start + sampleSize);\n\n /*\n Set min and max to the channel data first peak.\n */\n let min = channelData[0];\n let max = channelData[0];\n\n /*\n Iterate over the parts of the song starting to the\n ending to display the waveform.\n */\n for (\n let sampleIndex = start;\n sampleIndex < end;\n sampleIndex += sampleStep\n ) {\n const value = channelData[sampleIndex];\n\n if (value > max) {\n max = value;\n }\n if (value < min) {\n min = value;\n }\n }\n\n /*\n Set the max and min for the peak.\n */\n peaks[2 * peakNumber] = max;\n peaks[2 * peakNumber + 1] = min;\n\n /*\n Merge the peaks\n */\n if (channelNumber === 0 || max > mergedPeaks[2 * peakNumber]) {\n mergedPeaks[2 * peakNumber] = max;\n }\n\n if (channelNumber === 0 || min < mergedPeaks[2 * peakNumber + 1]) {\n mergedPeaks[2 * peakNumber + 1] = min;\n }\n }\n }\n\n /*\n Returns the merged peaks.\n */\n return mergedPeaks;\n }\n\n /**\n * Displays all of the waveforms necessary.\n *\n * @param {path} svg - The drawing of the waveform.\n */\n function displayWaveForms(svg) {\n let waveformElements = document.querySelectorAll(\".amplitude-wave-form\");\n\n /*\n Iterate over all of the waveform elements and\n display the waveform.\n */\n for (let i = 0; i < waveformElements.length; i++) {\n /*\n Get the playlist attribute of the waveform element.\n */\n let playlist = waveformElements[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Get the song index attribute of the waveform element.\n */\n let song = waveformElements[i].getAttribute(\"data-amplitude-song-index\");\n\n /*\n If the playlist is null and the song is null it's a global element.\n */\n if (playlist == null && song == null) {\n displayGlobalWaveform(waveformElements[i], svg);\n }\n\n /*\n If the playlist is defined but the song is null it's a playlist element.\n */\n if (playlist != null && song == null) {\n displayPlaylistWaveform(waveformElements[i], svg, playlist);\n }\n\n /*\n If the playlist is not defined and the song is not null it's a song\n element.\n */\n if (playlist == null && song != null) {\n displaySongWaveform(waveformElements[i], svg, song);\n }\n\n /*\n If the playlist and song are defined it's a song in the playlist element.\n */\n if (playlist != null && song != null) {\n displaySongInPlaylistWaveform(waveformElements[i], svg, playlist, song);\n }\n }\n }\n\n /**\n * Displays a global wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n */\n function displayGlobalWaveform(element, svg) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n\n /**\n * Displays a playlist wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {string} playlist - The playlist we are displaying the waveform for.\n */\n function displayPlaylistWaveform(element, svg, playlist) {\n /*\n Ensure the playlist is the active playlist.\n */\n if (config.active_playlist == playlist) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song wave form.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {Integer} song - The index of the song we are displaying the\n * waveform for.\n */\n function displaySongWaveform(element, svg, song) {\n /*\n Ensure it's the active song being displayed.\n */\n if (config.active_index == song) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Displays a song in playlist waveform.\n *\n * @param {Node} element - Element to display the waveform in.\n * @param {SVG} svg - The waveform path.\n * @param {String} playlist - The playlist the waveform is in.\n * @param {Integer} song - The index of the song we are displaying the waveform for.\n */\n function displaySongInPlaylistWaveform(element, svg, playlist, song) {\n /*\n Ensure it's the active song in the active playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[config.active_playlist].active_index == song\n ) {\n let waveformPath = element.querySelector(\"svg g path\");\n\n waveformPath.setAttribute(\"d\", svg);\n }\n }\n\n /**\n * Determines if the user is using waveforms\n */\n function determineIfUsingWaveforms() {\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n\n if (waveforms.length > 0) {\n return true;\n } else {\n return false;\n }\n }\n\n /*\n Return the public methods.\n */\n return {\n init: init,\n build: build,\n determineIfUsingWaveforms: determineIfUsingWaveforms\n };\n})();\n\nexport default WaveForm;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/waveform.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * The utility to handle the computation of time in AmplitudeJS.\n * @module utilities/Time\n */\nlet Time = (function() {\n /**\n * Computes the current song time. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeCurrentTimes() {\n /*\n\t\t\tInitialize the current time object that will be returned.\n\t\t*/\n let currentTime = {};\n\n /*\n\t\t\tComputes the current seconds for the song.\n\t\t*/\n let currentSeconds =\n (Math.floor(config.audio.currentTime % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.currentTime % 60);\n\n /*\n\t\t\tComputes the current minutes for the song.\n\t\t*/\n let currentMinutes = Math.floor(config.audio.currentTime / 60);\n\n /*\n\t\t\tInitialize the current hours variable.\n\t\t*/\n let currentHours = \"00\";\n\n /*\n\t\t\tIf the current minutes is less than 10, we add a leading 0.\n\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n\n /*\n\t\t\tIf the user is more than 60 minutes into the song, then\n\t\t\twe extract the hours.\n\t\t*/\n if (currentMinutes >= 60) {\n currentHours = Math.floor(currentMinutes / 60);\n currentMinutes = currentMinutes % 60;\n\n /*\n\t\t\t\tIf the user is less than 10 minutes in, we append the\n\t\t\t\tadditional 0 to the minutes.\n\t\t\t*/\n if (currentMinutes < 10) {\n currentMinutes = \"0\" + currentMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean current time object and send back the appropriate information.\n\t\t*/\n currentTime.seconds = currentSeconds;\n currentTime.minutes = currentMinutes;\n currentTime.hours = currentHours;\n\n return currentTime;\n }\n\n /**\n * Computes the current song duration. Breaks down where the song is into\n * hours, minutes, seconds and formats it to be displayed to the user.\n *\n * @access public\n */\n function computeSongDuration() {\n /*\n\t\t\tInitialize the song duration object that will be returned.\n\t\t*/\n let songDuration = {};\n\n /*\n\t\t\tComputes the duration of the song's seconds.\n\t\t*/\n let songDurationSeconds =\n (Math.floor(config.audio.duration % 60) < 10 ? \"0\" : \"\") +\n Math.floor(config.audio.duration % 60);\n\n /*\n\t\t\tComputes the duration of the song's minutes.\n\t\t*/\n let songDurationMinutes = Math.floor(config.audio.duration / 60);\n\n /*\n\t\t\tInitialize the hours duration variable.\n\t\t*/\n var songDurationHours = \"00\";\n\n /*\n\t\t\tIf the song duration minutes is less than 10, we add a leading 0.\n\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n\n /*\n\t\t\tIf there is more than 60 minutes in the song, then we\n\t\t\textract the hours.\n\t\t*/\n if (songDurationMinutes >= 60) {\n songDurationHours = Math.floor(songDurationMinutes / 60);\n songDurationMinutes = songDurationMinutes % 60;\n\n /*\n\t\t\t\tIf the song duration minutes is less than 10 we append\n\t\t\t\tthe additional 0.\n\t\t\t*/\n if (songDurationMinutes < 10) {\n songDurationMinutes = \"0\" + songDurationMinutes;\n }\n }\n\n /*\n\t\t\tBuild a clean song duration object and send back the appropriate information.\n\t\t*/\n songDuration.seconds = isNaN(songDurationSeconds)\n ? \"00\"\n : songDurationSeconds;\n songDuration.minutes = isNaN(songDurationMinutes)\n ? \"00\"\n : songDurationMinutes;\n songDuration.hours = isNaN(songDurationHours)\n ? \"00\"\n : songDurationHours.toString();\n\n return songDuration;\n }\n\n /**\n * Computes the song completion percentage.\n *\n * @access public\n */\n function computeSongCompletionPercentage() {\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Sets the current time for the audio.\n *\n * @access public\n */\n function setCurrentTime(time) {\n /*\n If the song is not live, we can set the current time.\n */\n if (!config.active_metadata.live) {\n /*\n Makes sure the number is finite to set the time.\n */\n if (isFinite(time)) {\n config.audio.currentTime = time;\n }\n }\n }\n\n /**\n * Defines what is returned by the module\n */\n return {\n computeCurrentTimes: computeCurrentTimes,\n computeSongDuration: computeSongDuration,\n computeSongCompletionPercentage: computeSongCompletionPercentage,\n setCurrentTime: setCurrentTime\n };\n})();\n\nexport default Time;\n\n\n\n// WEBPACK FOOTER //\n// ./src/utilities/time.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Visual Handler for Buffered Progress Elements\n *\n * @module visual/BufferedProgressElements\n */\nlet BufferedProgressElements = (function() {\n /**\n * Syncs the buffered progress bars to the current percentage in the config\n *\n * @access public\n */\n function sync() {\n syncGlobal();\n syncPlaylist();\n syncSong();\n syncSongInPlaylist();\n }\n\n /**\n * Sync the global song buffered progress elements.\n */\n function syncGlobal() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n let playlist = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let song = songBufferedProgressBars[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && song == null && !isNaN(config.buffered)) {\n songBufferedProgressBars[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the playlist song buffered progress elements.\n */\n function syncPlaylist() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsPlaylist.length; i++) {\n let song = songBufferedProgressBarsPlaylist[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (song == null && !isNaN(config.buffered)) {\n songBufferedProgressBarsPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song song buffered progress elements.\n */\n function syncSong() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongs = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongs.length; i++) {\n let playlist = songBufferedProgressBarsSongs[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null && !isNaN(config.buffered)) {\n songBufferedProgressBarsSongs[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sync the song in playlist song buffered progress elements.\n */\n function syncSongInPlaylist() {\n let activePlaylistIndex =\n config.active_playlist != null && config.active_playlist != \"\"\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n const songBufferedProgressBarsSongsInPlaylist = document.querySelectorAll(\n '.amplitude-buffered-progress[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBarsSongsInPlaylist.length; i++) {\n if (!isNaN(config.buffered)) {\n songBufferedProgressBarsSongsInPlaylist[i].value = parseFloat(\n parseFloat(config.buffered) / 100\n );\n }\n }\n }\n\n /**\n * Sets all of the song buffered progress bars to 0\n *\n * @access public\n */\n function reset() {\n /*\n\t\t\tGets all of the song buffered progress bars.\n\t\t*/\n let songBufferedProgressBars = document.getElementsByClassName(\n \"amplitude-buffered-progress\"\n );\n\n /*\n\t\t\tIterate over all of the song buffered progress bar and\n\t\t\tset them to 0 which is like re-setting them.\n\t\t*/\n for (let i = 0; i < songBufferedProgressBars.length; i++) {\n songBufferedProgressBars[i].value = 0;\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n sync: sync,\n reset: reset\n };\n})();\n\nexport default BufferedProgressElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/bufferedProgressElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Ended Module. Handles the ended event on the audio.\n *\n * @module events/Ended\n */\nlet Ended = (function() {\n /**\n * When the song has ended, handles what to do next\n *\n * HANDLER FOR: ended\n *\n * @access public\n */\n function handle() {\n /*\n Sets the time out for song ended. This determines if\n we should go to the next song or delay between songs.\n */\n setTimeout(function() {\n /*\n If we continue next, we should move to the next song in the playlist.\n */\n if (config.continue_next) {\n /*\n\t\t\t\t\tIf the active playlist is not set, we set the\n\t\t\t\t\tnext song that's in the songs array.\n\t\t\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext(true);\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist, true);\n }\n } else {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\t\t\tStops the active song.\n\t\t\t\t\t*/\n Core.stop();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n }, config.delay);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Ended;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/ended.js","/*\n\tImport the necessary classes and config to use\n\twith the events.\n*/\nimport config from \"../config.js\";\n\n/**\n * Imports all of the handler objects used by the events.\n */\nimport KeyDown from \"./keydown.js\";\nimport TimeUpdate from \"./timeUpdate.js\";\nimport Ended from \"./ended.js\";\nimport Progress from \"./progress.js\";\nimport Play from \"./play.js\";\nimport Pause from \"./pause.js\";\nimport PlayPause from \"./playPause.js\";\nimport Stop from \"./stop.js\";\nimport Mute from \"./mute.js\";\nimport VolumeUp from \"./volumeUp.js\";\nimport VolumeDown from \"./volumeDown.js\";\nimport SongSlider from \"./songSlider.js\";\nimport VolumeSlider from \"./volumeSlider.js\";\nimport Next from \"./next.js\";\nimport Prev from \"./prev.js\";\nimport Repeat from \"./repeat.js\";\nimport RepeatSong from \"./repeatSong.js\";\nimport PlaybackSpeed from \"./playbackSpeed.js\";\nimport Shuffle from \"./shuffle.js\";\nimport SkipTo from \"./skipTo.js\";\nimport WaveForm from \"../fx/waveform.js\";\n\n/**\n * Imports the utility classes used by the evnets.\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Events Module. Handles all of the events we listen to in\n * AmplitudeJS.\n *\n * @module events/Events\n */\nvar Events = (function() {\n /**\n * Initializes the handlers for the events listened to by Amplitude\n *\n * @access public\n */\n function initialize() {\n /*\n\t\t\tWrite out debug message\n\t\t*/\n Debug.writeMessage(\"Beginning initialization of event handlers..\");\n\n /*\n\t\t\tSets flag that the screen is moving and not a tap\n\t\t*/\n document.addEventListener(\"touchmove\", function() {\n config.is_touch_moving = true;\n });\n\n /*\n\t\t\tOn touch end if it was a touch move event, set moving to\n\t\t\tfalse\n\t\t*/\n document.addEventListener(\"touchend\", function() {\n if (config.is_touch_moving) {\n config.is_touch_moving = false;\n }\n });\n\n /*\n\t\t\tOn time update for the audio element, update visual displays that\n\t\t\trepresent the time on either a visualized element or time display.\n\t\t*/\n bindTimeUpdate();\n\n /*\n\t\t\tBinds key down event handlers for matching key codes to functions.\n\t\t*/\n bindKeyDownEventHandlers();\n\n /*\n\t\t\tWhen the audio element has ended playing, we handle the song\n\t\t\tending. In a single song or multiple modular song instance,\n\t\t\tthis just synchronizes the visuals for time and song time\n\t\t\tvisualization, but for a playlist it determines whether\n\t\t\tit should play the next song or not.\n\t\t*/\n bindSongEnded();\n\n /*\n\t\t\tBinds progress event so we can see how much of the song is loaded.\n\t\t*/\n bindProgress();\n\n /*\n\t\t\tBinds 'amplitude-play' event handlers\n\t\t*/\n bindPlay();\n\n /*\n\t\t\tBinds 'amplitude-pause' event handlers.\n\t\t*/\n bindPause();\n\n /*\n\t\t\tBinds 'amplitude-play-pause' event handlers.\n\t\t*/\n bindPlayPause();\n\n /*\n\t\t\tBinds 'amplitude-stop' event handlers.\n\t\t*/\n bindStop();\n\n /*\n\t\t\tBinds 'amplitude-mute' event handlers.\n\t\t*/\n bindMute();\n\n /*\n\t\t\tBinds 'amplitude-volume-up' event handlers\n\t\t*/\n bindVolumeUp();\n\n /*\n\t\t\tBinds 'amplitude-volume-down' event handlers\n\t\t*/\n bindVolumeDown();\n\n /*\n\t\t\tBinds 'amplitude-song-slider' event handlers\n\t\t*/\n bindSongSlider();\n\n /*\n\t\t\tBinds 'amplitude-volume-slider' event handlers.\n\t\t*/\n bindVolumeSlider();\n\n /*\n\t\t\tBinds 'amplitude-next' event handlers.\n\t\t*/\n bindNext();\n\n /*\n\t\t\tBinds 'amplitude-prev' event handlers.\n\t\t*/\n bindPrev();\n\n /*\n\t\t\tBinds 'amplitude-shuffle' event handlers.\n\t\t*/\n bindShuffle();\n\n /*\n\t\t\tBinds 'amplitude-repeat' event handlers.\n\t\t*/\n bindRepeat();\n\n /*\n\t\t\tBinds 'amplitude-repeat-song' event handlers.\n\t\t*/\n bindRepeatSong();\n\n /*\n\t\t\tBinds 'amplitude-playback-speed' event handlers.\n\t\t*/\n bindPlaybackSpeed();\n\n /*\n\t\t\tBinds 'amplitude-skip-to' event handlers.\n\t\t*/\n bindSkipTo();\n\n /*\n\t\t\tBinds `canplaythrough` event to build the waveform.\n\t\t*/\n bindCanPlayThrough();\n }\n\n /**\n * On time update for the audio element, update visual displays that\n * represent the time on either a visualized element or time display.\n *\n * @access private\n */\n function bindTimeUpdate() {\n /*\n\t\t\tBind for time update\n\t\t*/\n config.audio.removeEventListener(\"timeupdate\", TimeUpdate.handle);\n config.audio.addEventListener(\"timeupdate\", TimeUpdate.handle);\n\n /*\n\t\t\tBind for duration change\n\t\t*/\n config.audio.removeEventListener(\"durationchange\", TimeUpdate.handle);\n config.audio.addEventListener(\"durationchange\", TimeUpdate.handle);\n }\n\n /**\n * On keydown, we listen to what key got pressed so we can map the key to\n * a function. This allows the user to map pause and play, next, etc. to key\n * presses.\n *\n * @access private\n */\n function bindKeyDownEventHandlers() {\n document.removeEventListener(\"keydown\", KeyDown.handle);\n document.addEventListener(\"keydown\", KeyDown.handle);\n }\n\n /**\n * When the audio element has ended playing, we handle the song\n * ending. In a single song or multiple modular song instance,\n * this just synchronizes the visuals for time and song time\n * visualization, but for a playlist it determines whether\n * it should play the next song or not.\n *\n * @access private\n */\n function bindSongEnded() {\n config.audio.removeEventListener(\"ended\", Ended.handle);\n config.audio.addEventListener(\"ended\", Ended.handle);\n }\n\n /**\n * As the audio is loaded, the progress event gets fired. We bind into this\n * to grab the buffered percentage of the song. We can then add more elements\n * to show the buffered amount.\n *\n * @access private\n */\n function bindProgress() {\n config.audio.removeEventListener(\"progress\", Progress.handle);\n config.audio.addEventListener(\"progress\", Progress.handle);\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play buttons\n *\n * @access private\n */\n function bindPlay() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play\n\t\t*/\n var play_classes = document.getElementsByClassName(\"amplitude-play\");\n\n /*\n\t\t\tIterates over all of the play classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_classes[i].removeEventListener(\"touchend\", Play.handle);\n play_classes[i].addEventListener(\"touchend\", Play.handle);\n } else {\n play_classes[i].removeEventListener(\"click\", Play.handle);\n play_classes[i].addEventListener(\"click\", Play.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS pause buttons.\n *\n * @access private\n */\n function bindPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-pause\n\t\t*/\n var pause_classes = document.getElementsByClassName(\"amplitude-pause\");\n\n /*\n\t\t\tIterates over all of the pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n pause_classes[i].removeEventListener(\"touchend\", Pause.handle);\n pause_classes[i].addEventListener(\"touchend\", Pause.handle);\n } else {\n pause_classes[i].removeEventListener(\"click\", Pause.handle);\n pause_classes[i].addEventListener(\"click\", Pause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS play pause buttons\n *\n * @access private\n */\n function bindPlayPause() {\n /*\n\t\t\tGets all of the elements with the class amplitude-play-pause\n\t\t*/\n var play_pause_classes = document.getElementsByClassName(\n \"amplitude-play-pause\"\n );\n\n /*\n\t\t\tIterates over all of the play/pause classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < play_pause_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n play_pause_classes[i].removeEventListener(\"touchend\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"touchend\", PlayPause.handle);\n } else {\n play_pause_classes[i].removeEventListener(\"click\", PlayPause.handle);\n play_pause_classes[i].addEventListener(\"click\", PlayPause.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS stop buttons\n *\n * @access private\n */\n function bindStop() {\n /*\n\t\t\tGets all of the elements with the class amplitude-stop\n\t\t*/\n var stop_classes = document.getElementsByClassName(\"amplitude-stop\");\n\n /*\n\t\t\tIterates over all of the stop classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < stop_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n stop_classes[i].removeEventListener(\"touchend\", Stop.handle);\n stop_classes[i].addEventListener(\"touchend\", Stop.handle);\n } else {\n stop_classes[i].removeEventListener(\"click\", Stop.handle);\n stop_classes[i].addEventListener(\"click\", Stop.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS mute buttons\n *\n * @access private\n */\n function bindMute() {\n /*\n\t\t\tGets all of the elements with the class amplitue-mute\n\t\t*/\n var mute_classes = document.getElementsByClassName(\"amplitude-mute\");\n\n /*\n\t\t\tIterates over all of the mute classes and binds the event interaction\n\t\t\tmethod to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < mute_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n mute_classes[i].removeEventListener(\"touchend\", Mute.handle);\n mute_classes[i].addEventListener(\"touchend\", Mute.handle);\n }\n } else {\n mute_classes[i].removeEventListener(\"click\", Mute.handle);\n mute_classes[i].addEventListener(\"click\", Mute.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Up Buttons\n *\n * @access private\n */\n function bindVolumeUp() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-up\n\t\t*/\n var volume_up_classes = document.getElementsByClassName(\n \"amplitude-volume-up\"\n );\n\n /*\n\t\t\tIterates over all of the volume up classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_up_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_up_classes[i].removeEventListener(\"touchend\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"touchend\", VolumeUp.handle);\n }\n } else {\n volume_up_classes[i].removeEventListener(\"click\", VolumeUp.handle);\n volume_up_classes[i].addEventListener(\"click\", VolumeUp.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS Volume Down Buttons\n *\n * @access private\n */\n function bindVolumeDown() {\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-down\n\t\t*/\n var volume_down_classes = document.getElementsByClassName(\n \"amplitude-volume-down\"\n );\n\n /*\n\t\t\tIterates over all of the volume down classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < volume_down_classes.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n /*\n\t\t\t\t\tChecks for an iOS device and displays an error message if debugging\n\t\t\t\t\tis turned on.\n\t\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n volume_down_classes[i].removeEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n volume_down_classes[i].addEventListener(\n \"touchend\",\n VolumeDown.handle\n );\n }\n } else {\n volume_down_classes[i].removeEventListener(\"click\", VolumeDown.handle);\n volume_down_classes[i].addEventListener(\"click\", VolumeDown.handle);\n }\n }\n }\n\n /**\n * Binds change and input events for AmplitudeJS Song Slider Inputs\n *\n * @access private\n */\n function bindSongSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-song-slider\n\t\t*/\n var song_sliders = document.getElementsByClassName(\"amplitude-song-slider\");\n\n /*\n\t\t\tIterates over all of the song slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < song_sliders.length; i++) {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n song_sliders[i].removeEventListener(\"change\", SongSlider.handle);\n song_sliders[i].addEventListener(\"change\", SongSlider.handle);\n } else {\n song_sliders[i].removeEventListener(\"input\", SongSlider.handle);\n song_sliders[i].addEventListener(\"input\", SongSlider.handle);\n }\n }\n }\n\n /**\n * Binds change and input events fro AmplitudeJS Volume Slider inputs\n *\n * @access private\n */\n function bindVolumeSlider() {\n /*\n\t\t\tGets browser so if we need to apply overrides, like we usually\n\t\t\thave to do for anything cool in IE, we can do that.\n\t\t*/\n var ua = window.navigator.userAgent;\n var msie = ua.indexOf(\"MSIE \");\n\n /*\n\t\t\tGets all of the elements with the class amplitude-volume-slider\n */\n var volume_sliders = document.getElementsByClassName(\n \"amplitude-volume-slider\"\n );\n\n /*\n\t\t\tIterates over all of the volume slider classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is IE we listen to the change event\n\t\t\twhere if it is anything else, it's the input method.\n\t\t*/\n for (var i = 0; i < volume_sliders.length; i++) {\n /*\n\t\t\t\tWARNING: If iOS, we don't do anything because iOS does not allow the\n\t\t\t\tvolume to be adjusted through anything except the buttons on the side of\n\t\t\t\tthe device.\n\t\t\t*/\n if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {\n Debug.writeMessage(\n \"iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4\"\n );\n } else {\n if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\\:11\\./)) {\n volume_sliders[i].removeEventListener(\"change\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"change\", VolumeSlider.handle);\n } else {\n volume_sliders[i].removeEventListener(\"input\", VolumeSlider.handle);\n volume_sliders[i].addEventListener(\"input\", VolumeSlider.handle);\n }\n }\n }\n }\n\n /**\n * Binds click and touchend events fro AmplitudeJS Next buttons\n *\n * @access private\n */\n function bindNext() {\n /*\n\t\t\tGets all of the elements with the class amplitude-next\n */\n var next_classes = document.getElementsByClassName(\"amplitude-next\");\n\n /*\n\t\t\tIterates over all of the next classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < next_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n next_classes[i].removeEventListener(\"touchend\", Next.handle);\n next_classes[i].addEventListener(\"touchend\", Next.handle);\n } else {\n next_classes[i].removeEventListener(\"click\", Next.handle);\n next_classes[i].addEventListener(\"click\", Next.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS prev buttons.\n *\n * @access private\n */\n function bindPrev() {\n /*\n\t\t\tGets all of the elements with the class amplitude-prev\n\t\t*/\n var prev_classes = document.getElementsByClassName(\"amplitude-prev\");\n\n /*\n\t\t\tIterates over all of the prev classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < prev_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n prev_classes[i].removeEventListener(\"touchend\", Prev.handle);\n prev_classes[i].addEventListener(\"touchend\", Prev.handle);\n } else {\n prev_classes[i].removeEventListener(\"click\", Prev.handle);\n prev_classes[i].addEventListener(\"click\", Prev.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS shuffle buttons.\n *\n * @access private\n */\n function bindShuffle() {\n /*\n\t\t\tGets all of the elements with the class amplitude-shuffle\n\t\t*/\n var shuffle_classes = document.getElementsByClassName(\"amplitude-shuffle\");\n\n /*\n\t\t\tIterates over all of the shuffle classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < shuffle_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the shuffle control.\n\t\t\t*/\n shuffle_classes[i].classList.remove(\"amplitude-shuffle-on\");\n shuffle_classes[i].classList.add(\"amplitude-shuffle-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n shuffle_classes[i].removeEventListener(\"touchend\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"touchend\", Shuffle.handle);\n } else {\n shuffle_classes[i].removeEventListener(\"click\", Shuffle.handle);\n shuffle_classes[i].addEventListener(\"click\", Shuffle.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat buttons.\n *\n * @access private\n */\n function bindRepeat() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat\n\t\t*/\n var repeat_classes = document.getElementsByClassName(\"amplitude-repeat\");\n\n /*\n\t\t\tIterates over all of the repeat classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_classes[i].removeEventListener(\"touchend\", Repeat.handle);\n repeat_classes[i].addEventListener(\"touchend\", Repeat.handle);\n } else {\n repeat_classes[i].removeEventListener(\"click\", Repeat.handle);\n repeat_classes[i].addEventListener(\"click\", Repeat.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS repeat song buttons.\n *\n * @access private\n */\n function bindRepeatSong() {\n /*\n\t\t\tGets all of the elements with the class amplitude-repeat-song\n\t\t*/\n var repeat_song_classes = document.getElementsByClassName(\n \"amplitude-repeat-song\"\n );\n\n /*\n\t\t\tIterates over all of the repeat song classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < repeat_song_classes.length; i++) {\n /*\n\t\t\t\tSince we are re-binding everything we remove any classes that signify\n\t\t\t\ta state of the repeat control.\n\t\t\t*/\n repeat_song_classes[i].classList.remove(\"amplitude-repeat-on\");\n repeat_song_classes[i].classList.add(\"amplitude-repeat-off\");\n\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n repeat_song_classes[i].removeEventListener(\n \"touchend\",\n RepeatSong.handle\n );\n repeat_song_classes[i].addEventListener(\"touchend\", RepeatSong.handle);\n } else {\n repeat_song_classes[i].removeEventListener(\"click\", RepeatSong.handle);\n repeat_song_classes[i].addEventListener(\"click\", RepeatSong.handle);\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS playback speed buttons\n *\n * @access private\n */\n function bindPlaybackSpeed() {\n /*\n\t\t\tGets all of the elements with the class amplitude-playback-speed\n\t\t*/\n var playback_speed_classes = document.getElementsByClassName(\n \"amplitude-playback-speed\"\n );\n\n /*\n\t\t\tIterates over all of the playback speed classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it is click.\n\t\t*/\n for (var i = 0; i < playback_speed_classes.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n playback_speed_classes[i].removeEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"touchend\",\n PlaybackSpeed.handle\n );\n } else {\n playback_speed_classes[i].removeEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n playback_speed_classes[i].addEventListener(\n \"click\",\n PlaybackSpeed.handle\n );\n }\n }\n }\n\n /**\n * Binds click and touchend events for AmplitudeJS skip to buttons.\n *\n * @access private\n */\n function bindSkipTo() {\n /*\n\t\t\tGets all of the skip to elements with the class 'amplitude-skip-to'\n\t\t*/\n var skipToClasses = document.getElementsByClassName(\"amplitude-skip-to\");\n\n /*\n\t\t\tIterates over all of the skip to classes and binds the event interaction\n\t\t\tmethods to the element. If the browser is mobile, then the event is touchend\n\t\t\totherwise it's a click.\n\t\t*/\n for (var i = 0; i < skipToClasses.length; i++) {\n if (\n /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(\n navigator.userAgent\n )\n ) {\n skipToClasses[i].removeEventListener(\"touchend\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"touchend\", SkipTo.handle);\n } else {\n skipToClasses[i].removeEventListener(\"click\", SkipTo.handle);\n skipToClasses[i].addEventListener(\"click\", SkipTo.handle);\n }\n }\n }\n\n /**\n * Binds can play through to a song.\n *\n * @access private\n */\n function bindCanPlayThrough() {\n if (WaveForm.determineIfUsingWaveforms()) {\n config.audio.removeEventListener(\"canplaythrough\", WaveForm.build);\n config.audio.addEventListener(\"canplaythrough\", WaveForm.build);\n }\n }\n\n /*\n\t\tReturns the public facing functions.\n\t*/\n return {\n initialize: initialize\n };\n})();\n\nexport default Events;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/events.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the core of AmplitudeJS\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Shuffle Utility\n * @module utilities/Shuffle\n */\nimport Shuffle from \"../utilities/shuffler.js\";\n\n/**\n * Imports the Repeater Utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the Repeat Elements Visual Handler\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Imports the Play Pause Elements Visual Handler\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * AmplitudeJS Key Down event handler\n *\n * @module events/KeyDown\n */\nlet KeyDown = (function() {\n /**\n * When the keydown event is fired, we determine which function should be run\n * based on what was passed in.\n *\n * HANDLER FOR: keydown\n *\n * @access public\n * @prop {object} event The event object being passed in.\n */\n function handle(event) {\n runKeyEvent(event.which);\n }\n\n /**\n * Runs an event on key down\n *\n * @access public\n * @param {number} key \t- The key code the event is bound to.\n */\n function runKeyEvent(key) {\n /*\n\t\t\tChecks to see if the user bound an event to the code pressed.\n\t\t*/\n if (config.bindings[key] != undefined) {\n /*\n\t\t\t\tDetermine which event should be run if bound.\n\t\t\t*/\n switch (config.bindings[key]) {\n /*\n\t\t\t\t\tFires a play pause event.\n\t\t\t\t*/\n case \"play_pause\":\n runPlayPauseKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a next event.\n\t\t\t\t*/\n case \"next\":\n runNextKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a previous event.\n\t\t\t\t*/\n case \"prev\":\n runPrevKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a stop event.\n\t\t\t\t*/\n case \"stop\":\n runStopKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a shuffle event.\n\t\t\t\t*/\n case \"shuffle\":\n runShuffleKeyDownEvent();\n break;\n\n /*\n\t\t\t\t\tFires a repeat event.\n\t\t\t\t*/\n case \"repeat\":\n runRepeatKeyDownEvent();\n break;\n }\n }\n }\n\n /**\n * Runs the play pause method for key down.\n */\n function runPlayPauseKeyDownEvent() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Runs the next method for key down.\n */\n function runNextKeyDownEvent() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the previous method for key down.\n */\n function runPrevKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Runs the stop method for key down.\n */\n function runStopKeyDownEvent() {\n /*\n Syncs all of the play pause elements to pause.\n */\n PlayPauseElements.syncToPause();\n\n /*\n Stops the active song.\n */\n Core.stop();\n }\n\n /**\n * Runs the shuffle method for key down.\n */\n function runShuffleKeyDownEvent() {\n /*\n Check to see if the current playlist has been set\n or null and set the previous song.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n Shuffle.toggleShuffle();\n } else {\n Shuffle.toggleShufflePlaylist(config.active_playlist);\n }\n }\n\n /**\n * Run the repeat method for key down.\n */\n function runRepeatKeyDownEvent() {\n /*\n Toggles the repeat\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Returns the public methods for the handler.\n */\n return {\n handle: handle\n };\n})();\n\nexport default KeyDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/keydown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a mute event.\n * @module events/Mute\n */\nlet Mute = (function() {\n /**\n * Handles an event for a mute element\n *\n * HANDLER FOR: class=\"amplitude-mute\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tIf the current volume in the config is 0, we set the volume to the\n\t\t\t\tpre_mute level. This means that the audio is already muted and\n\t\t\t\tneeds to be restored to the pre_mute level.\n\n\t\t\t\tOtherwise, we set pre_mute volume to the current volume\n\t\t\t\tand set the config volume to 0, muting the audio.\n\t\t\t*/\n if (config.volume == 0) {\n Core.setVolume(config.pre_mute_volume);\n } else {\n config.pre_mute_volume = config.volume;\n Core.setVolume(0);\n }\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\t\tSyncs the volume sliders so the visuals align up with the functionality.\n\t\t\t\tIf the volume is at 0, then the sliders should represent that so the user\n\t\t\t\thas the right starting point.\n\t\t\t*/\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Mute;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/mute.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core module.\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Play Pause Elements Module.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the Callbacks Module\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Next Event Handler\n *\n * @module events/Next\n */\nlet Next = (function() {\n /**\n * Handles an event on the next button\n *\n * HANDLER FOR: class=\"amplitude-next\"\n *\n * GLOBAL: class=\"amplitude-next\"\n * PLAYLIST: class=\"amplitude-next\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global next.\n */\n if (playlist == null) {\n handleGlobalNext();\n }\n\n /*\n If the playlist is set, we handle the playlist next.\n */\n if (playlist != null) {\n handlePlaylistNext(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global enxt button.\n *\n * @access private\n */\n function handleGlobalNext() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set next on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a next playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the next for.\n */\n function handlePlaylistNext(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setNextPlaylist(playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the next song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Next;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/next.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the ConfigState module.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the pause events\n * @module events/Pause\n */\nlet Pause = (function() {\n /**\n * Handles an event on a pause button\n *\n * HANDLER FOR: class=\"amplitude-pause\"\n *\n * GLOBAL: class=\"amplitude-pause\"\n * PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple pause classes on the page. In that\n case it is possible the user could click a different pause\n class.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global pause button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPause();\n }\n\n /*\n Handle a playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPause(playlistAttribute);\n }\n\n /*\n Handle a song pause button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPause(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist pause button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPause(playlistAttribute, songIndexAttribute);\n }\n }\n }\n\n /**\n * Handles global pause button which pauses whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPause() {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n */\n function handlePlaylistPause(playlist) {\n /*\n Checks to see if the active playlist is the same\n */\n if (config.active_playlist == playlist) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song pause.\n *\n * @access private\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongPause(song) {\n /*\n Checks to see if the active playlist is null and the song matches\n the active index.\n */\n if (\n (config.active_playlist == \"\" || config.active_playlist == null) &&\n config.active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /**\n * Handles the song in playlist pause.\n *\n * @access private\n * @param {string} playlist The playlist the pause button belongs to.\n * @param {integer} song The song the pause button belongs to.\n */\n function handleSongInPlaylistPause(playlist, song) {\n /*\n Checks to see if the active song matches the song and the\n active playlist matches the playlist. This means the pause button is\n for the song in the playlist.\n */\n if (\n config.active_playlist == playlist &&\n config.playlists[playlist].active_index == song\n ) {\n /*\n Pauses the song.\n */\n Core.pause();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Pause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/pause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state utility.\n * @module utilities/ConfigState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play events\n * @module events/Play\n */\nlet Play = (function() {\n /**\n * Handles an event on a play button in Amplitude.\n *\n * HANDLER FOR: class=\"amplitude-play\"\n *\n * GLOBAL: class=\"amplitude-play\"\n * PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Gets the attribute for song index so we can check if\n there is a need to change the song. In some scenarios\n there might be multiple play classes on the page. In that\n case it is possible the user could click a different play\n class and change the song.\n */\n let songIndexAttribute = this.getAttribute(\"data-amplitude-song-index\");\n let playlistAttribute = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n Handle a global play button.\n */\n if (playlistAttribute == null && songIndexAttribute == null) {\n handleGlobalPlay();\n }\n\n /*\n Handle a playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute == null) {\n handlePlaylistPlay(playlistAttribute);\n }\n\n /*\n Handle a song play button.\n */\n if (playlistAttribute == null && songIndexAttribute != null) {\n handleSongPlay(songIndexAttribute);\n }\n\n /*\n Handle a song in playlist play button.\n */\n if (playlistAttribute != null && songIndexAttribute != null) {\n handleSongInPlaylistPlay(playlistAttribute, songIndexAttribute);\n }\n }\n }\n\n /**\n * Handles global play button which plays whatever song is\n * active.\n *\n * @access private\n */\n function handleGlobalPlay() {\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Sync the play pause elements.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handle the playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n */\n function handlePlaylistPlay(playlist) {\n /*\n Checks if we have a new playlist.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n Sets the active playlist to what belongs to the playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n Plays the song.\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song play button.\n *\n * @access private\n * @param {integer} song The index of the song we are playing.\n */\n function handleSongPlay(song) {\n /*\n There can be multiple playlists on the page and there can be\n multiple songs on the page AND there can be songs in multiple\n playlists, so we have some checking to do.\n */\n\n /*\n Check to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n */\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n We then change the song to the index selected.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Check to see if the song has changed. If it has,\n set the active song. If it was in a playlist, the\n song wouldn't change here, since we already set the\n song when we checked for a playlist.\n */\n if (Checks.newSong(null, song)) {\n /*\n The song selected is different, so we change the\n song.\n */\n AudioNavigation.changeSong(config.songs[song], song);\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Syncs the play pause elements since they are dependent upon this state\n of the player.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Handles the song in playlist play.\n *\n * @access private\n * @param {string} playlist The playlist the play button belongs to.\n * @param {integer} song The song the play button belongs to.\n */\n function handleSongInPlaylistPlay(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song\n );\n }\n\n /*\n Plays the song\n */\n Core.play();\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /*\n Returns the public facing elements\n */\n return {\n handle: handle\n };\n})();\n\nexport default Play;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/play.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Import the config state utility.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles all of the play pause events\n * @module events/PlayPause\n */\nlet PlayPause = (function() {\n /**\n * Handles an event on a play/pause button\n *\n * HANDLER FOR: class=\"amplitude-play-pause\"\n *\n * GLOBAL: class=\"amplitude-play-pause\"\n * PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-play-pause\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-play-pause\" amplitude-playlist=\"playlist-key\" amplitude-song-index=\"playlist_index\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist and song from the element. It's alright if these\n are null.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n Handle a global play pause button\n */\n if (playlist == null && song == null) {\n handleGlobalPlayPause();\n }\n\n /*\n Handle a playlist play pause button\n */\n if (playlist != null && song == null) {\n handlePlaylistPlayPause(playlist);\n }\n\n /*\n Handle a song play pause button\n */\n if (playlist == null && song != null) {\n handleSongPlayPause(song);\n }\n\n /*\n Handle a song in playlist play pause button\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistPlayPause(playlist, song);\n }\n }\n }\n\n /**\n * Sets the main play pause buttons to the current state of the song.\n * @access private\n */\n function handleGlobalPlayPause() {\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} playlist The playlist the main play pause button controls\n */\n function handlePlaylistPlayPause(playlist) {\n /*\n The only thing that can change when you click a playlist\n play pause is the playlist. Main play pauses have no change\n in song, song play pauses can change playlist and song.\n */\n if (Checks.newPlaylist(playlist)) {\n /*\n If there's a new playlist, then we set the new playlist.\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n Play first song in the playlist since we just\n switched playlists, we start from the first song.\n\n If the user has shuffle on for the playlist, then\n we go from the first song in the shuffle playlist array.\n */\n if (config.playlists[playlist].shuffle) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].shuffle_list[0],\n 0,\n true\n );\n } else {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[0],\n 0\n );\n }\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the playlist main play pause buttons to the current state of the song.\n * @access private\n * @param {string} song The index of the song being played/paused\n */\n function handleSongPlayPause(song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(null);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song, true);\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(null, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSong(config.songs[song], song, true);\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Sets the song in playlist play pause buttons to the current\n * state of the song.\n * @access private\n * @param {string} playlist The playlist the song is a part of\n * @param {number} song The index of the song being played/paused\n */\n function handleSongInPlaylistPlayPause(playlist, song) {\n /*\n\t\t\tThere can be multiple playlists on the page and there can be\n\t\t\tmultiple songs on the page AND there can be songs in multiple\n\t\t\tplaylists, so we have some checking to do.\n\t\t*/\n\n /*\n\t\t\tCheck to see if the playlist has changed. Essentially, if we are moving\n out of a playlist context.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n /*\n We've moved out of the playlist context, so we set the active playlist\n to null\n */\n AudioNavigation.setActivePlaylist(playlist);\n\n /*\n\t\t\t\tWe then change the song to the index selected.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song,\n true\n );\n }\n\n /*\n\t\t\tCheck to see if the song has changed. If it has,\n\t\t\tset the active song. If it was in a playlist, the\n\t\t\tsong wouldn't change here, since we already set the\n\t\t\tsong when we checked for a playlist.\n\t\t*/\n if (Checks.newSong(playlist, song)) {\n /*\n\t\t\t\tThe song selected is different, so we change the\n\t\t\t\tsong.\n\t\t\t*/\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[song],\n song,\n true\n );\n }\n\n /*\n If the song is paused, we play the song. If the song is playing,\n we pause the song.\n */\n if (config.audio.paused) {\n Core.play();\n } else {\n Core.pause();\n }\n\n /*\n Now we sync all the elements to match the state of the audio.\n We don't need to do any checks on new songs or changed playlists\n in the global since it's whatever song is playing.\n */\n PlayPauseElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlayPause;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playPause.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Core module\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the Playback Speed Visual Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"../visual/playbackSpeedElements.js\";\n\n/**\n * AmplitudeJS Playback Speed Event Handler\n *\n * @module events/PlaybackSpeed\n */\nlet PlaybackSpeed = (function() {\n /**\n * Handles an event on the playback speed button\n *\n * HANDLER FOR: class=\"amplitude-playback-speed\"\n *\n * @access public\n */\n function handle() {\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tWe increment the speed by .5 everytime we click\n\t\t\t\tthe button to change the playback speed. Once we are\n\t\t\t\tactively playing back at 2, we start back at 1 which\n\t\t\t\tis normal speed.\n\t\t\t*/\n switch (config.playback_speed) {\n case 1:\n Core.setPlaybackSpeed(1.5);\n break;\n case 1.5:\n Core.setPlaybackSpeed(2);\n break;\n case 2:\n Core.setPlaybackSpeed(1);\n break;\n }\n\n /*\n\t\t\t\tVisually sync the playback speed.\n\t\t\t*/\n PlaybackSpeedElements.sync();\n }\n }\n\n /*\n Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default PlaybackSpeed;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/playbackSpeed.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Amplitude Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Prev Event Handler\n *\n * @module events/Prev\n */\nlet Prev = (function() {\n /**\n * Handles an event on the previous button\n *\n * HANDLER FOR: class=\"amplitude-prev\"\n *\n * GLOBAL: class=\"amplitude-prev\"\n * PLAYLIST: class=\"amplitude-prev\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global prev.\n */\n if (playlist == null) {\n handleGlobalPrev();\n }\n\n /*\n If the playlist is set, we handle the playlist prev.\n */\n if (playlist != null) {\n handlePlaylistPrev(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global previous button.\n *\n * @access private\n */\n function handleGlobalPrev() {\n /*\n Check to see if the current state of the player\n is in playlist mode or not playlist mode. If we are in playlist mode,\n we set prev on the playlist.\n */\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n }\n\n /**\n * Handles an event on a previous playlist button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the previous for.\n */\n function handlePlaylistPrev(playlist) {\n /*\n Ensure the playlist is the same as the active playlist. To get to change\n the scope to a new playlist, you need to play that playlist.\n */\n if (playlist == config.active_playlist) {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n } else {\n Debug.writeMessage(\n \"You can not go to the previous song on a playlist that is not being played!\"\n );\n }\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Prev;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/prev.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the BufferedProgressElements visual handler\n * @module visual/bufferedProgressElements.js\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * AmplitudeJS Event Handler for progress\n *\n * @module events/Progress\n */\nlet Progress = (function() {\n /**\n * As the song is buffered, we can display the buffered percentage in\n * a progress bar.\n *\n * HANDLER FOR: progress\n *\n * @access public\n */\n function handle() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n /*\n Set the computed song buffered value to the config.\n */\n config.buffered = (bufferedEnd / duration) * 100;\n }\n\n /*\n Sync the buffered progress bars.\n */\n BufferedProgressElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Progress;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/progress.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeater utility module.\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the visual repeat elements module\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * AmplitudeJS Repeat Event Handler\n *\n * @module events/Repeat\n */\nlet Repeat = (function() {\n /**\n * Handles an event on the repeat button\n *\n * HANDLER FOR: class=\"amplitude-repeat\"\n *\n * GLOBAL: class=\"amplitude-repeat\"\n * PLAYLIST: class=\"amplitude-repeat\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n Gets the playlist attribute from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n If the playlist is null, we handle the global repeat.\n */\n if (playlist == null) {\n handleGlobalRepeat();\n }\n\n /*\n If the playlist is set, we handle the playlist repeat.\n */\n if (playlist != null) {\n handlePlaylistRepeat(playlist);\n }\n }\n }\n\n /**\n * Handles an event on a global repeat button.\n *\n * @access private\n */\n function handleGlobalRepeat() {\n /*\n Sets repeat to the opposite of what it was set to\n */\n Repeater.setRepeat(!config.repeat);\n\n /*\n Visually sync repeat\n */\n RepeatElements.syncRepeat();\n }\n\n /**\n * Handles an event on a playlist repeat button.\n *\n * @access private\n * @prop {string} playlist - The playlist we are handling the repeat store.\n */\n function handlePlaylistRepeat(playlist) {\n /*\n Sets repeat to the opposite of what it was set to for the playlist.\n */\n Repeater.setRepeatPlaylist(!config.playlists[playlist].repeat, playlist);\n\n /*\n Visually sync playlist repeat\n */\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /*\n Returns the public facing methods.\n */\n return {\n handle: handle\n };\n})();\n\nexport default Repeat;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeat.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the repeat utility\n * @module utilities/Repeater\n */\nimport Repeater from \"../utilities/repeater.js\";\n\n/**\n * Imports the AmplitudeJS Repeat Element\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"../visual/repeatElements.js\";\n\n/**\n * Handles an event on the Amplitude Repeat Song.\n *\n * @module events/RepeatSong\n */\nlet RepeatSong = (function() {\n /**\n * Handles an event on the repeat song button\n *\n * HANDLER FOR: 'amplitude-repeat-song'\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets repeat song to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default RepeatSong;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/repeatSong.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the shuffler utility\n * @module utilities/Shuffler\n */\nimport Shuffler from \"../utilities/shuffler.js\";\n\n/**\n * Imports the visual shuffle elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"../visual/shuffleElements.js\";\n\n/**\n * Handles all of the shuffle events\n * @module events/Shuffle\n */\nlet Shuffle = (function() {\n /**\n * Handles an event on the shuffle button\n *\n * HANDLER FOR: class=\"amplitude-shuffle\"\n *\n * GLOBAL: class=\"amplitude-shuffle\"\n * PLAYLIST: class=\"amplitude-shuffle\" amplitude-playlist=\"playlist_key\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Get the playlist attribute\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n\n /*\n\t\t\t\tCheck to see if the shuffle button belongs to a playlist\n\t\t\t*/\n if (playlist == null) {\n handleGlobalShuffle();\n } else {\n handlePlaylistShuffle(playlist);\n }\n }\n }\n\n /**\n * Handles the event on the global shuffle button.\n */\n function handleGlobalShuffle() {\n /*\n Either shuffles or removes shuffle on the global state.\n */\n Shuffler.toggleShuffle();\n\n /*\n Visualize the shuffle state change.\n */\n ShuffleElements.syncMain(config.shuffle_on);\n }\n\n /**\n * Handles the event on the playlist shuffle button.\n *\n * @param {string} playlist - The playlist string the shuffle button belongs to.\n */\n function handlePlaylistShuffle(playlist) {\n /*\n Either shuffles or removes shuffle on the playlist state.\n */\n Shuffler.toggleShufflePlaylist(playlist);\n\n /*\n Visually sync the playlist shuffle statuses.\n */\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Shuffle;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/shuffle.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports AmplitudeJS Debug Utility\n * @module utilities/debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * Imports the AmplitudeJS Audio Navigation Utility\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"../utilities/audioNavigation.js\";\n\n/**\n * Imports the AmplitudeJS Checks Utility\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS play pause elements.\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Handles the skip to event.\n *\n * @module events/SkipTo\n */\nlet SkipTo = (function() {\n /**\n * Handles an event on a skip to button.\n *\n * HANDLER FOR: class=\"amplitude-skip-to\"\n *\n * GLOBAL: class=\"amplitude-skip-to\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n * PLAYLIST: class=\"amplitude-skip-to\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\" amplitude-location=\"seconds\"\n *\n * @access public\n */\n function handle() {\n /*\n If the touch is moving, we do not want to accidentally touch the play\n pause element and fire an event.\n */\n if (!config.is_touch_moving) {\n /*\n Extracts the needed attributes from the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let songIndex = this.getAttribute(\"data-amplitude-song-index\");\n let location = this.getAttribute(\"data-amplitude-location\");\n\n /*\n If the location is null, write a message. We can't skip to a location\n that is null\n */\n if (location == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the song index is null, write a debug message. We can't skip to a location\n of a null song.\n */\n if (songIndex == null) {\n Debug.writeMessage(\n \"You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element.\"\n );\n }\n\n /*\n If the location and song index are set, continue.\n */\n if (location != null && songIndex != null) {\n /*\n \t\t\t\tDetermines if the skip to button is in the scope of a playlist.\n \t\t\t*/\n if (playlist == null) {\n handleSkipToSong(parseInt(songIndex), parseInt(location));\n } else {\n handleSkipToPlaylist(\n playlist,\n parseInt(songIndex),\n parseInt(location)\n );\n }\n }\n }\n }\n\n /**\n * Handles the skipping to a specific song\n *\n * @access private\n * @param {string} songIndex - The index of the song being skipped to\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToSong(songIndex, location) {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Handles the skipping to a song that's in a playlist.\n *\n * @access private\n * @param {string} playlist - The playlist being skipped to\n * @param {string} songIndex - The index of the song in the playlist\n * @param {number} location - The seconds location of the song in the playlist.\n */\n function handleSkipToPlaylist(playlist, songIndex, location) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(location);\n }\n\n /**\n * Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SkipTo;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/skipTo.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the time utility\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the song slider elements.\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Handles the song slider to event.\n *\n * @module events/SongSlider\n */\nlet SongSlider = (function() {\n /**\n * Handles a song slider element.\n *\n * HANDLER FOR: class=\"amplitude-song-slider\"\n *\n * GLOBAL: class=\"amplitude-song-slider\"\n * PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\"\n * SONG: class=\"amplitude-song-slider\" amplitude-song-index=\"song_index\"\n * SONG IN PLAYLIST: class=\"amplitude-song-slider\" amplitude-playlist=\"playlist_key\" amplitude-song-index=\"song_index\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tGets the percentage of the song we will be setting the location for.\n\t\t*/\n let locationPercentage = this.value;\n\n /*\n Computes the time in seconds for the current song.\n */\n let computedTime = config.audio.duration * (locationPercentage / 100);\n\n /*\n Gets the attributes for playlist and index for the element.\n */\n let playlist = this.getAttribute(\"data-amplitude-playlist\");\n let song = this.getAttribute(\"data-amplitude-song-index\");\n\n /*\n If no playlist or song is defined, then it's a global song slider.\n */\n if (playlist == null && song == null) {\n handleGlobalSongSlider(computedTime, locationPercentage);\n }\n\n /*\n If a playlist but no song is defined, then it's playlist slider.\n */\n if (playlist != null && song == null) {\n handlePlaylistSongSlider(computedTime, locationPercentage, playlist);\n }\n\n /*\n If no playlist but a song is defined, then it's a song slider.\n */\n if (playlist == null && song != null) {\n handleSongSongSlider(computedTime, locationPercentage, song);\n }\n\n /*\n If playlist and song are defined then it's a song in a playlist\n slider.\n */\n if (playlist != null && song != null) {\n handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n song\n );\n }\n }\n\n /**\n * Handles a change on a global audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n */\n function handleGlobalSongSlider(computedTime, locationPercentage) {\n /*\n\t\t\tIf the active song is not live, set the current time and adjust the slider.\n\t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n config.active_index\n );\n }\n }\n\n /**\n * Handles a change on a playlist audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {string} playlist = The playlist the song slider belongs to.\n */\n function handlePlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist\n ) {\n /*\n\t\t\tWe don't want to song slide a playlist that's not the\n\t\t\tactive placylist.\n\t\t*/\n if (config.active_playlist == playlist) {\n /*\n \t\t\tIf the active song is not live, set the current time\n \t\t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n playlist,\n config.active_index\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongSongSlider(computedTime, locationPercentage, songIndex) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected.\n */\n if (config.active_index == songIndex && config.active_playlist == null) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(\n locationPercentage,\n config.active_playlist,\n songIndex\n );\n }\n }\n }\n\n /**\n * Handles a change on a song audio slider\n *\n * @access private\n * @param {integer} computedTime - The time we will set the audio to.\n * @param {float} locationPercentage - The percent through the song.\n * @param {integer} playlist = The playlist the song belongs to.\n * @param {integer} songIndex = The song being navigated.\n */\n function handleSongInPlaylistSongSlider(\n computedTime,\n locationPercentage,\n playlist,\n songIndex\n ) {\n /*\n We only want to move the slider if the active song is the\n same as the song being selected and the active playlist is the same\n as the playlist selected.\n */\n if (\n config.playlists[playlist].active_index == songIndex &&\n config.active_playlist == playlist\n ) {\n /*\n \t\tIf the active song is not live, set the current time\n \t*/\n if (!config.active_metadata.live) {\n Time.setCurrentTime(computedTime);\n\n /*\n Sync song slider elements.\n */\n SongSliderElements.sync(locationPercentage, playlist, songIndex);\n }\n }\n }\n\n /*\n Return public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default SongSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/songSlider.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the config state module.\n * @module utilities/configState\n */\nimport ConfigState from \"../utilities/configState.js\";\n\n/**\n * Imports the AmplitudeJS Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"../visual/playPauseElements.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/Core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Handles all of the stop events\n * @module events/Stop\n */\nlet Stop = (function() {\n /**\n * Handles an event on a stop element.\n *\n * HANDLER FOR: class=\"amplitude-stop\"\n *\n * @access public\n */\n function handle() {\n /*\n If touch is not moving, we run. We don't want to accidentally press\n stop if touch is moving.\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tSets all of the play/pause buttons to pause\n\t\t\t*/\n PlayPauseElements.syncToPause();\n\n /*\n\t\t\t\tStops the active song.\n\t\t\t*/\n Core.stop();\n }\n }\n\n /**\n * Returns public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default Stop;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/stop.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the Buffered Progress Elements visual class\n * @module visual/bufferedProgressElements\n */\nimport BufferedProgressElements from \"../visual/bufferedProgressElements.js\";\n\n/**\n * Imports the Time Elements visual class.\n * @module visual/timeElements\n */\nimport TimeElements from \"../visual/timeElements.js\";\n\n/**\n * Imports the Song Slider Elements visual class.\n * @module visual/songSliderElements\n */\nimport SongSliderElements from \"../visual/songSliderElements.js\";\n\n/**\n * Imports the Song Played Progress Elements visual class.\n * @module visual/songPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"../visual/songPlayedProgressElements.js\";\n\n/**\n * Imports the Time utility class\n * @module utilities/Time\n */\nimport Time from \"../utilities/time.js\";\n\n/**\n * Imports the Callback utility class\n * @module utilities/Callbacks\n */\nimport Callbacks from \"../utilities/callbacks.js\";\n\n/**\n * AmplitudeJS Event Handler for Time Update\n *\n * @module events/TimeUpdate\n */\nlet TimeUpdate = (function() {\n /**\n * When the time updates on the active song, we sync the current time displays\n *\n * HANDLER FOR: timeupdate\n *\n * @access public\n */\n function handle() {\n /*\n Computes the buffered time.\n */\n computeBufferedTime();\n\n /*\n Sync the buffered progress elements.\n */\n BufferedProgressElements.sync();\n\n /*\n Updates the current time information.\n */\n updateTimeInformation();\n\n /*\n Run time callbacks\n */\n runTimeCallbacks();\n }\n\n /**\n * Computes the buffered time\n */\n function computeBufferedTime() {\n /*\n Help from: http://jsbin.com/badimipi/1/edit?html,js,output\n */\n if (config.audio.buffered.length - 1 >= 0) {\n let bufferedEnd = config.audio.buffered.end(\n config.audio.buffered.length - 1\n );\n let duration = config.audio.duration;\n\n config.buffered = (bufferedEnd / duration) * 100;\n }\n }\n\n /**\n * Updates the current time information.\n * @access private\n */\n function updateTimeInformation() {\n /*\n If the current song is not live, then\n we can update the time information. Otherwise the\n current time updates wouldn't mean much since the time\n is infinite.\n */\n if (!config.active_metadata.live) {\n /*\n Compute the current time\n */\n let currentTime = Time.computeCurrentTimes();\n\n /*\n Compute the song completion percentage\n */\n let songCompletionPercentage = Time.computeSongCompletionPercentage();\n\n /*\n Computes the song duration\n */\n let songDuration = Time.computeSongDuration();\n\n /*\n Sync the current time elements with the current\n location of the song and the song duration elements with\n the duration of the song.\n */\n TimeElements.syncCurrentTimes(currentTime);\n\n /*\n Sync the song slider elements.\n */\n SongSliderElements.sync(\n songCompletionPercentage,\n config.active_playlist,\n config.active_index\n );\n\n /*\n Sync the song played progress elements.\n */\n SongPlayedProgressElements.sync(songCompletionPercentage);\n\n /*\n Sync the duration time elements.\n */\n TimeElements.syncDurationTimes(currentTime, songDuration);\n }\n }\n\n /**\n * Runs a callback at a certain time in the song.\n */\n function runTimeCallbacks() {\n /*\n Gets the current seconds into the song.\n */\n let currentSeconds = Math.floor(config.audio.currentTime);\n\n /*\n Checks to see if there is a callback at the certain seconds into the song.\n */\n if (\n config.active_metadata.time_callbacks != undefined &&\n config.active_metadata.time_callbacks[currentSeconds] != undefined\n ) {\n /*\n Checks to see if the callback has been run. Since the time updates more than\n one second, we don't want the callback to run X times.\n */\n if (!config.active_metadata.time_callbacks[currentSeconds].run) {\n config.active_metadata.time_callbacks[currentSeconds].run = true;\n config.active_metadata.time_callbacks[currentSeconds]();\n }\n } else {\n /*\n Iterate over all of the callbacks for a song. If the song has one, we flag\n the run as false. This occurs because we have passed the active second for\n the callback, so we flag it as not run. It will either run again if the user\n seeks back or not run in the future.\n */\n for (var seconds in config.active_metadata.time_callbacks) {\n if (config.active_metadata.time_callbacks.hasOwnProperty(seconds)) {\n config.active_metadata.time_callbacks[seconds].run = false;\n }\n }\n }\n }\n /**\n * Returns public functions\n */\n return {\n handle: handle\n };\n})();\n\nexport default TimeUpdate;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/timeUpdate.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume down event.\n * @module events/VolumeDown\n */\nlet VolumeDown = (function() {\n /**\n * Handles a click on a volume down element.\n *\n * HANDLER FOR: class=\"amplitude-volume-down\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume - config.volume_increment > 0) {\n volume = config.volume - config.volume_increment;\n } else {\n volume = 0;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeDown;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeDown.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeSlider\n */\nlet VolumeSlider = (function() {\n /**\n * Handles a change on the volume slider\n *\n * HANDLER FOR: class=\"amplitude-volume-slider\"\n *\n * @access public\n */\n function handle() {\n /*\n\t\t\tCalls the core function to set the volume to the computed value\n\t\t\tbased on the user's intent.\n\t\t*/\n Core.setVolume(this.value);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync the volume slider locations\n\t\t*/\n VolumeSliderElements.sync();\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeSlider;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeSlider.js","/**\n * Imports the config to use the values\n */\nimport config from \"../config.js\";\n\n/**\n * Imports the AmplitudeJS Core Methods\n * @module core/core\n */\nimport Core from \"../core/core.js\";\n\n/**\n * Imports the AmplitudeJS Visual Mute Elements\n * @module visual/MuteElements\n */\nimport MuteElements from \"../visual/muteElements.js\";\n\n/**\n * Imports the AmplitudeJS Visual Volume Slider Elements\n * @module visual/VolumeSliderElements\n */\nimport VolumeSliderElements from \"../visual/volumeSliderElements.js\";\n\n/**\n * Handles all events for a volume up event.\n * @module events/VolumeUp\n */\nlet VolumeUp = (function() {\n /**\n * Handles a click on a volume up element.\n *\n * HANDLER FOR: class=\"amplitude-volume-up\"\n *\n * @access public\n */\n function handle() {\n /*\n We don't fire this if the user is touching the screen and it's moving.\n This could lead to a mis-fire\n */\n if (!config.is_touch_moving) {\n /*\n\t\t\t\tThe volume range is from 0 to 1 for an audio element. We make this\n\t\t\t\ta base of 100 for ease of working with.\n\n\t\t\t\tIf the new value is less than 100, we use the new calculated\n\t\t\t\tvalue which gets converted to the proper unit for the audio element.\n\n\t\t\t\tIf the new value is greater than 100, we set the volume to 1 which\n\t\t\t\tis the max for the audio element.\n\t\t\t*/\n let volume = null;\n\n if (config.volume + config.volume_increment <= 100) {\n volume = config.volume + config.volume_increment;\n } else {\n volume = 100;\n }\n\n /*\n\t\t\t\tCalls the core function to set the volume to the computed value\n\t\t\t\tbased on the user's intent.\n\t\t\t*/\n Core.setVolume(volume);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n Sync Volume Slider Elements\n */\n VolumeSliderElements.sync();\n }\n }\n\n /**\n * Returns the public facing methods\n */\n return {\n handle: handle\n };\n})();\n\nexport default VolumeUp;\n\n\n\n// WEBPACK FOOTER //\n// ./src/events/volumeUp.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS FX Module. Helps with configuring and setting up visualizations\n * and any other features of the Web Audio API that Amplitude takes advantage\n * of.\n *\n * @module fx/FX\n */\nlet Fx = (function() {\n /**\n * Configures the Web Audio API to work with AmplitudeJS\n */\n function configureWebAudioAPI() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n\n /*\n\t\t\tIf we have a context, the Web Audio API is available and we can continue,\n\t\t\totherwise, we alert the user if they have debug turned on.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tWeb Audio API is available, set the context in our config.\n\t\t\t*/\n config.context = new browserContext();\n \n /*\n\t\t\t\tCreate an analyzer that we will use in the context.\n\t\t\t*/\n config.analyser = config.context.createAnalyser();\n\n /*\n\t\t\t\tSet cross origin to anonymous so we have a better chance of being able\n\t\t\t\tto use the power of the Web Audio API.\n\t\t\t*/\n config.audio.crossOrigin = \"anonymous\";\n \n /*\n\t\t\t\tBind the source to the Javascript Audio Element.\n\t\t\t*/\n config.source = config.context.createMediaElementSource(config.audio);\n\n /*\n\t\t\t\tConnect the analyser to the source\n\t\t\t*/\n config.source.connect(config.analyser);\n\n /*\n\t\t\t\tConnect the context destination to the analyser.\n\t\t\t*/\n config.analyser.connect(config.context.destination);\n } else {\n AmplitudeHelpers.writeDebugMessage(\n \"Web Audio API is unavailable! We will set any of your visualizations with your back up definition!\"\n );\n }\n }\n\n /**\n * Determines if the web audio API is available or not.\n */\n function webAudioAPIAvailable() {\n /*\n\t\t\tGets the context for the browser. If this is null, the Web Audio\n\t\t\tAPI is unavailable.\n\t\t*/\n let browserContext =\n window.AudioContext ||\n window.webkitAudioContext ||\n window.mozAudioContext ||\n window.oAudioContext ||\n window.msAudioContext;\n config.web_audio_api_available = false;\n\n /*\n\t\t\tDetermines if the Web Audio API is available or not.\n\t\t*/\n if (browserContext) {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is available\n\t\t\t*/\n config.web_audio_api_available = true;\n return true;\n } else {\n /*\n\t\t\t\tSet the flag in the config that the Web Audio API is not available\n\t\t\t*/\n config.web_audio_api_available = false;\n return false;\n }\n }\n\n /**\n * Determines if the user is using any of the web audio API features.\n */\n function determineUsingAnyFX(){\n let waveforms = document.querySelectorAll(\".amplitude-wave-form\");\n let visualizationElements = document.querySelectorAll(\n \".amplitude-visualization\"\n );\n\n if( waveforms.length > 0 || visualizationElements.length > 0 ){\n return true;\n }else{\n return false;\n }\n }\n\n /*\n\t\tReturns the publicly accessible methods\n\t*/\n return {\n configureWebAudioAPI: configureWebAudioAPI,\n webAudioAPIAvailable: webAudioAPIAvailable,\n determineUsingAnyFX: determineUsingAnyFX\n };\n})();\n\nexport default Fx;\n\n\n\n// WEBPACK FOOTER //\n// ./src/fx/fx.js","/**\n * @name \t\tAmplitudeJS\n * @author \tDan Pastori (Server Side Up) \n */\n/**\n * AmplitudeJS Initializer Module\n *\n * @module init/AmplitudeInitializer\n */\nimport Initializer from \"./init/init.js\";\n\n/****************************************************\n * Config\n ****************************************************/\n/**\n * Imports the config module\n * @module config\n */\nimport config from \"./config.js\";\n\n/****************************************************\n * Core\n ****************************************************/\n/**\n * AmplitudeJS Core Module\n *\n * @module core/Core\n */\nimport Core from \"./core/core.js\";\n\n/****************************************************\n * Utilities\n ****************************************************/\n/**\n * Shuffler Module\n * @module utilities/Shuffler\n */\nimport Shuffler from \"./utilities/shuffler.js\";\n\n/**\n * Imports the config state module.\n * @module ConfigState\n */\nimport ConfigState from \"./utilities/configState.js\";\n\n/**\n * Imports the audio navigation\n * @module utilities/AudioNavigation\n */\nimport AudioNavigation from \"./utilities/audioNavigation.js\";\n\n/**\n * Repeater Module\n *\n * @module utilities/Repeater\n */\nimport Repeater from \"./utilities/repeater.js\";\n\n/**\n * Imports the checks\n * @module utilities/Checks\n */\nimport Checks from \"./utilities/checks.js\";\n\n/****************************************************\n * FX Modules\n ****************************************************/\n/**\n * Imports the visualizations module\n * @module fx/Visualizations\n */\nimport Visualizations from \"./fx/visualizations.js\";\n\n/****************************************************\n * Elements\n ****************************************************/\n/**\n * Visual Shuffle Elements\n * @module visual/ShuffleElements\n */\nimport ShuffleElements from \"./visual/shuffleElements.js\";\n\n/**\n * Visual Repeat Elements\n * @module visual/RepeatElements\n */\nimport RepeatElements from \"./visual/repeatElements.js\";\n\n/**\n * Song Slider Elements\n * @module visual/SongSliderElements\n */\nimport SongSliderElements from \"./visual/songSliderElements.js\";\n\n/**\n * Song Played Progress Elements\n * @module visual/SongPlayedProgressElements\n */\nimport SongPlayedProgressElements from \"./visual/songPlayedProgressElements.js\";\n\n/**\n * Time Elements\n * @module visual/TimeElements\n */\nimport TimeElements from \"./visual/timeElements.js\";\n\n/**\n * Play Pause Elements\n * @module visual/PlayPauseElements\n */\nimport PlayPauseElements from \"./visual/playPauseElements.js\";\n\n/**\n * Meta Data Elements\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"./visual/metaDataElements.js\";\n\n/**\n * Playback Speed Elements\n * @module visual/PlaybackSpeedElements\n */\nimport PlaybackSpeedElements from \"./visual/playbackSpeedElements.js\";\n\nimport Debug from \"./utilities/debug.js\";\n\nimport SoundCloud from \"./soundcloud/soundcloud.js\";\n\n/**\n * Amplitude should just be an interface to the public functions.\n * Everything else should be handled by other objects\n *\n * @module Amplitude\n */\nlet Amplitude = (function() {\n /**\n * The main init function. The user will call this through\n * Amplitude.init({}) and pass in their settings.\n *\n * Public Accessor: Amplitude.init( user_config_json );\n *\n * @access public\n * @param {object} userConfig \t- A JSON object of user defined values that helps configure and initialize AmplitudeJS.\n */\n function init(userConfig) {\n Initializer.initialize(userConfig);\n }\n\n /**\n * Returns the current config for AmplitudeJS\n */\n function getConfig() {\n return config;\n }\n\n /**\n * Binds new elements that were added to the page.\n *\n * Public Accessor: Amplitude.bindNewElements()\n *\n * @access public\n */\n function bindNewElements() {\n Initializer.rebindDisplay();\n }\n\n /**\n * Returns the active playlist.\n *\n * Public Accessor: Amplitude.getActivePlaylist()\n *\n * @access public\n */\n function getActivePlaylist() {\n return config.active_playlist;\n }\n\n /**\n * Returns the current playback speed.\n *\n * Public Accessor: Amplitude.getPlaybackSpeed()\n *\n * @access public\n */\n function getPlaybackSpeed() {\n return config.playback_speed;\n }\n\n /**\n * Sets the playback speed\n *\n * Public Accessor: Amplitude.setPlaybackSpeed( speed )\n *\n * @access public\n */\n function setPlaybackSpeed(speed) {\n /*\n Increments are set in .5 We only accept values\n 1, 1.5, 2\n\n 1 -> Regular Speed\n 1.5 -> 50% faster\n 2 -> Twice as fast\n */\n Core.setPlaybackSpeed(speed);\n\n /*\n Visually sync the playback speed.\n */\n PlaybackSpeedElements.sync();\n }\n\n /**\n * Gets the repeat state of the player.\n *\n * Public Accessor: Amplitude.getRepeat()\n *\n * @access public\n */\n function getRepeat() {\n return config.repeat;\n }\n\n /**\n * Gets the repeat state for a playlist\n *\n * Public Accessor: Amplitude.getRepeatPlaylist()\n *\n * @access public\n */\n function getRepeatPlaylist(playlistKey) {\n return config.playlists[playlistKey].repeat;\n }\n\n /**\n * Returns the shuffle state of the player.\n *\n * Public Accessor: Amplitude.getShuffle()\n *\n * @access public\n */\n function getShuffle() {\n return config.shuffle_on;\n }\n\n /**\n * Returns the shuffle state of the playlist.\n *\n * Public Accessor: Amplitude.getShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to see if it's shuffled or not.\n */\n function getShufflePlaylist(playlist) {\n return config.playlists[playlist].shuffle;\n }\n\n /**\n * Sets the shuffle state for the player.\n *\n * Public Accessor: Amplitude.setShuffle()\n *\n * @param {boolean} shuffle \t- True when we are shuffling the songs, false when we turn off shuffle.\n *\n * @access public\n */\n function setShuffle(shuffle) {\n Shuffler.setShuffle(shuffle);\n\n ShuffleElements.syncMain();\n }\n\n /**\n * Sets the shuffle state for the playlist\n *\n * Public Accessor: Amplitude.setShufflePlaylist( playlist )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} shuffle \t- True when we are shuffling the playlist, false when we turn off shuffle.\n */\n function setShufflePlaylist(playlist, shuffle) {\n Shuffler.setShufflePlaylist(playlist, shuffle);\n\n ShuffleElements.syncMain();\n ShuffleElements.syncPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the player.\n *\n * Public Accessor: Amplitude.setRepeat()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song to be in.\n */\n function setRepeat(repeatState) {\n Repeater.setRepeat(repeatState);\n RepeatElements.syncRepeat();\n }\n\n /**\n * Sets the repeat state for a playlist.\n *\n * Public Accessor: Amplitude.setRepeatPlaylist( playlistKey )\n *\n * @access public\n * @param {string} playlist \t- The key representing the playlist ID to to shuffle the playlist.\n * @param {boolean} repeatState - The state you want the repeat playlist to be in.\n */\n function setRepeatPlaylist(playlist, repeatState) {\n Repeater.setRepeatPlaylist(repeatState, playlist);\n RepeatElements.syncRepeatPlaylist(playlist);\n }\n\n /**\n * Sets the repeat state for the song.\n *\n * Public Accessor: Amplitude.setRepeatSong()\n *\n * @access public\n * @param {boolean} repeatState \t- The state you want the repeat song status to be in.\n */\n function setRepeatSong(repeatState) {\n if (!config.is_touch_moving) {\n /*\n\t\t\t Sets repeat to the opposite of what it was set to\n\t\t\t*/\n Repeater.setRepeatSong(!config.repeat_song);\n\n /*\n\t\t\t\tVisually sync repeat song\n\t\t\t*/\n RepeatElements.syncRepeatSong();\n }\n }\n\n /**\n * Gets the default album art for the player\n *\n * Public Accessor: Amplitude.getDefaultAlbumArt()\n *\n * @access public\n */\n function getDefaultAlbumArt() {\n return config.default_album_art;\n }\n\n /**\n * Gets the default playlist art for the playlists\n *\n * Public Accessor: Amplitude.getDefaultPlaylistArt()\n *\n * @access public\n */\n function getDefaultPlaylistArt() {\n return config.default_playlist_art;\n }\n\n /**\n * Sets the default album art for the player\n *\n * Public Accessor: Amplitude.setDefaultAlbumArt( url )\n *\n * @access public\n * @param {string} url \t- A string representing the URL of the new default album art.\n */\n function setDefaultAlbumArt(url) {\n config.default_album_art = url;\n }\n\n /**\n * Sets the default playlist art for the player\n *\n * Public Accessor: Amplitude.setDefaultPlaylistArt( url )\n *\n * @access public\n * @param {string} url - A string representing the URL of the new default playlist art.\n */\n function setDefaultPlaylistArt(url) {\n config.default_plalist_art = url;\n }\n\n /**\n * Allows the user to get the percentage of the song played.\n *\n * Public Accessor: Amplitude.getSongPlayedPercentage();\n *\n * @access public\n */\n function getSongPlayedPercentage() {\n /*\n\t\t\tReturns the percentage of the song played.\n\t\t*/\n return (config.audio.currentTime / config.audio.duration) * 100;\n }\n\n /**\n * Allows the user to get the amount of seconds the song has played.\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongPlayedSeconds() {\n /*\n\t\t\tReturns the amount of seconds the song has played.\n\t\t*/\n return config.audio.currentTime;\n }\n\n /**\n * Allows the user to get the duration of the current song\n *\n * Public Accessor: Amplitude.getSongPlayed();\n *\n * @access public\n */\n function getSongDuration() {\n /*\n\t\t\tReturns the duration of the current song\n\t\t*/\n return config.audio.duration;\n }\n\n /**\n * Allows the user to set how far into the song they want to be. This is\n * helpful for implementing custom range sliders. Only works on the current song.\n *\n * Public Accessor: Amplitude.setSongPlayedPercentage( float );\n *\n * @access public\n * @param {number} percentage \t- The percentage of the song played\n */\n function setSongPlayedPercentage(percentage) {\n /*\n\t\t\tEnsures the percentage is a number and is between 0 and 100.\n\t\t*/\n if (typeof percentage == \"number\" && (percentage > 0 && percentage < 100)) {\n /*\n\t\t\t\t\tSets the current time of the song to the percentage.\n\t\t\t\t*/\n config.audio.currentTime = config.audio.duration * (percentage / 100);\n }\n }\n\n /**\n * Allows the user to turn on debugging.\n *\n * Public Accessor: Amplitude.setDebug( bool );\n *\n * @access public\n * @param {boolean} state \t\t- Turns debugging on and off.\n */\n function setDebug(state) {\n /*\n\t\t\tSets the global config debug on or off.\n\t\t*/\n config.debug = state;\n }\n\n /**\n * Returns the active song meta data for the user to do what is\n * needed.\n *\n * Public Accessor: Amplitude.getActiveSongMetadata();\n *\n * @access public\n * @returns {object} JSON Object with the active song information\n */\n function getActiveSongMetadata() {\n return config.active_metadata;\n }\n\n /**\n * Returns the active playlist meta data for the for the user to use.\n *\n * Public Accessor: Amplitude.getActivePlaylistMetadata();\n *\n * @access public\n * @returns {object} JSON representation for the active playlist\n */\n function getActivePlaylistMetadata() {\n return config.playlists[config.active_playlist];\n }\n\n /**\n * Returns a song in the songs array at that index\n *\n * Public Accessor: Amplitude.getSongAtIndex( song_index )\n *\n * @access public\n * @param {number} index \t- The integer for the index of the song in the songs array.\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtIndex(index) {\n return config.songs[index];\n }\n\n /**\n * Returns a song at a playlist index\n *\n * Public Accessor: Amplitude.getSongAtPlaylistIndex( playlist, index\n *\n * @access public\n * @param {number} index \t\t\t- The integer for the index of the song in the playlist.\n * @param {string} playlist\t\t- The key of the playlist we are getting the song at the index for\n * @returns {object} JSON representation for the song at a specific index.\n */\n function getSongAtPlaylistIndex(playlist, index) {\n let song = config.playlists[playlist].songs[index];\n\n return song;\n }\n\n /**\n * Adds a song to the end of the config array. This will allow Amplitude\n * to play the song in a playlist type setting.\n *\n * Public Accessor: Amplitude.addSong( song_json )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n * @returns {number} New index of the song.\n */\n function addSong(song) {\n /*\n\t\t\tEnsures we have a songs array to push to.\n\t\t*/\n if (config.songs == undefined) {\n config.songs = [];\n }\n\n config.songs.push(song);\n\n if (config.shuffle_on) {\n config.shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n null,\n config.songs.length - 1,\n config.shuffle_on\n );\n }\n\n return config.songs.length - 1;\n }\n\n /**\n * Adds a song to the beginning of the config array.\n * This will allow Amplitude to play the song in a\n * playlist type setting.\n *\n * Public Accessor: Amplitude.addSong( song_json )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n * @returns {number} New index of the song (0)\n */\n function prependSong(song) {\n /*\n\t\t\tEnsures we have a songs array to push to.\n\t\t*/\n if (config.songs == undefined) {\n config.songs = [];\n }\n\n config.songs.unshift(song);\n\n if (config.shuffle_on) {\n config.shuffle_list.unshift(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n null,\n config.songs.length - 1,\n config.shuffle_on\n );\n }\n\n return 0;\n }\n\n /**\n * Adds a song to a playlist. This will allow Amplitude to play the song in the\n * playlist\n *\n * Public Accessor: Amplitude.addSongToPlaylist( song_json, playlist_key )\n *\n * @access public\n * @param {object} song \t\t\t- JSON representation of a song.\n * @param {string} playlist\t\t- Playlist we are adding the song to.\n * @returns {mixed} New index of song in playlist or null if no playlist exists\n */\n function addSongToPlaylist(song, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.push(song);\n\n if (config.playlists[playlist].shuffle) {\n config.playlists[playlist].shuffle_list.push(song);\n }\n\n if (SoundCloud.isSoundCloudURL(song.url)) {\n SoundCloud.resolveIndividualStreamableURL(\n song.url,\n playlist,\n config.playlists[playlist].songs.length - 1,\n config.playlists[playlist].shuffle\n );\n }\n\n return config.playlists[playlist].songs.length - 1;\n } else {\n Debug.writeMessage(\"Playlist doesn't exist!\");\n return null;\n }\n }\n\n /**\n * Adds a playlist to Amplitude.\n *\n * @param {string} key - The key of the playlist we are adding.\n * @param {object} data - The data relating to the playlist\n * @param {array} songs - The songs to add to the playlist\n */\n function addPlaylist(key, data, songs) {\n /*\n Ensures the playlist is not already defined.\n */\n if (config.playlists[key] == undefined) {\n /*\n Initialize the new playlist object.\n */\n config.playlists[key] = {};\n\n /*\n Define the ignored keys that we don't want to copy over.\n */\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n /*\n Iterate over all of the keys defined by the user and\n set them on the playlist.\n */\n for (let dataKey in data) {\n if (ignoredKeys.indexOf(dataKey) < 0) {\n config.playlists[key][dataKey] = data[dataKey];\n }\n }\n\n /*\n Initialize the default parameters for the playlist and set the songs.\n */\n config.playlists[key].songs = songs;\n config.playlists[key].active_index = null;\n config.playlists[key].repeat = false;\n config.playlists[key].shuffle = false;\n config.playlists[key].shuffle_list = [];\n\n return config.playlists[key];\n } else {\n Debug.writeMessage(\"A playlist already exists with that key!\");\n return null;\n }\n }\n\n /**\n * Removes a song from the song array\n *\n * Public Accessor: Amplitude.removeSong( index )\n *\n * @access public\n * @param {integer} index - Index of the song being removed\n * @returns {boolean} True if removed false if not.\n */\n function removeSong(index) {\n config.songs.splice(index, 1);\n }\n\n /**\n * Removes a song from the playlist\n *\n * Public Accessor: Amplitude.removeSongFromPlaylist( index, playlist )\n *\n * @access public\n * @param {integer} index \t\t\t- Index of the song being removed from the playlist.\n * @param {string} playlist\t\t\t- Playlist we are removing the song from.\n * @returns {boolean} True if removed false if not.\n */\n function removeSongFromPlaylist(index, playlist) {\n if (config.playlists[playlist] != undefined) {\n config.playlists[playlist].songs.splice(index, 1);\n }\n }\n\n /**\n * When you pass a song object it plays that song right awawy. It sets\n * the active song in the config to the song you pass in and synchronizes\n * the visuals.\n *\n * Public Accessor: Amplitude.playNow( song )\n *\n * @access public\n * @param {object} song \t- JSON representation of a song.\n */\n function playNow(song) {\n /*\n\t\t\tMakes sure the song object has a URL associated with it\n\t\t\tor there will be nothing to play.\n\t\t*/\n if (song.url) {\n config.audio.src = song.url;\n config.active_metadata = song;\n config.active_album = song.album;\n } else {\n /*\n\t\t\t\tWrite error message since the song passed in doesn't\n\t\t\t\thave a URL.\n\t\t\t*/\n Debug.writeMessage(\"The song needs to have a URL!\");\n }\n\n /*\n\t\t\tPlays the song.\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSets the main song control status visual\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tUpdate the song meta data\n\t\t*/\n MetaDataElements.displayMetaData();\n\n /*\n\t\t\tReset the song sliders, song progress bar info, and\n\t\t\treset times. This ensures everything stays in sync.\n\t\t*/\n SongSliderElements.resetElements();\n\n /*\n\t\t\tReset the song played progress elements.\n\t\t*/\n SongPlayedProgressElements.resetElements();\n\n /*\n\t\t\tReset all of the current time elements.\n\t\t*/\n TimeElements.resetCurrentTimes();\n\n /*\n\t\t\tReset all of the duration time elements.\n\t\t*/\n TimeElements.resetDurationTimes();\n\n }\n\n /**\n * Plays a song at the index passed in from the songs array.\n *\n * Public Accessor: Amplitude.playSongAtIndex( index )\n *\n * @access public\n * @param {number} index \t- The number representing the song in the songs array.\n */\n function playSongAtIndex(index) {\n /*\n\t\t\t Stop the current song.\n\t\t*/\n Core.stop();\n\n /*\n\t\t\t Determine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(null)) {\n AudioNavigation.setActivePlaylist(null);\n\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\t Check if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(null, index)) {\n AudioNavigation.changeSong(config.songs[index], index);\n }\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n }\n\n /**\n * Plays a song at the index passed in for the playlist provided. The index passed\n * in should be the index of the song in the playlist and not the songs array.\n *\n * @access public\n * @param {number} index \t\t- The number representing the song in the playlist array.\n * @param {string} playlist - The key string representing the playlist we are playing the song from.\n *\n */\n function playPlaylistSongAtIndex(index, playlist) {\n Core.stop();\n\n /*\n\t\t\tDetermine if there is a new playlist, if so set the active playlist and change the song.\n\t\t*/\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tCheck if the song is new. If so, change the song.\n\t\t*/\n if (Checks.newSong(playlist, index)) {\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[index],\n index\n );\n }\n\n /*\n\t\t\tSync all of the play pause buttons.\n\t\t*/\n PlayPauseElements.sync();\n\n /*\n\t\t\tPlay the song\n\t\t*/\n Core.play();\n }\n\n /**\n * Allows the user to play whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.play();\n *\n * @access public\n */\n function play() {\n Core.play();\n }\n\n /**\n * Allows the user to pause whatever the active song is directly\n * through Javascript. Normally ALL of Amplitude functions that access\n * the core features are called through event handlers.\n *\n * Public Accessor: Amplitude.pause();\n *\n * @access public\n */\n function pause() {\n Core.pause();\n }\n\n /**\n * Allows the user to stop whatever the active song is directly\n * through Javascript.\n *\n * Public Accessor: Amplitude.stop();\n *\n * @access public\n */\n function stop() {\n Core.stop();\n }\n\n /**\n * Returns the audio object used to play the audio\n *\n * Public Accessor: Amplitude.getAudio();\n *\n * @access public\n */\n function getAudio() {\n return config.audio;\n }\n\n /**\n * Returns the Web Audio API ANalyser used for visualizations.\n *\n * Public Accessor: Amplitude.getAnalyser()\n *\n * @access public\n */\n function getAnalyser() {\n return config.analyser;\n }\n\n /**\n * Plays the next song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.next( playlist );\n *\n * @access public\n * @param {string} [playlist = null \t- The playlist key\n */\n function next(playlist = null) {\n let nextData = {};\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the next global\n\t\t\t\tsong or we set the next in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setNext();\n } else {\n AudioNavigation.setNextPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setNextPlaylist(playlist);\n }\n }\n\n /**\n * Plays the prev song either in the playlist or globally.\n *\n * Public Accessor: Amplitude.prev( playlist );\n *\n * @access public\n * @param {string} [playlist = null] \t- The playlist key\n */\n function prev(playlist = null) {\n let prevData = {};\n\n /*\n\t\t\tIf the playlist is empty or null, then we check the active\n\t\t\tplaylist\n\t\t*/\n if (playlist == \"\" || playlist == null) {\n /*\n\t\t\t\tIf the active playlist is null, then we set the prev global\n\t\t\t\tsong or we set the prev in the playlist.\n\t\t\t*/\n if (config.active_playlist == null || config.active_playlist == \"\") {\n AudioNavigation.setPrevious();\n } else {\n AudioNavigation.setPreviousPlaylist(config.active_playlist);\n }\n } else {\n AudioNavigation.setPreviousPlaylist(playlist);\n }\n }\n\n /**\n * Gets all of the songs in the songs array\n *\n * Public Accessor: Amplitude.getSongs( );\n *\n * @access public\n */\n function getSongs() {\n return config.songs;\n }\n\n /**\n * Gets all of the songs in a playlist\n *\n * Public Accessor: Amplitude.getSongsInPlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsInPlaylist(playlist) {\n return config.playlists[playlist].songs;\n }\n\n /**\n * Get current state of songs. If shuffled, this will return the shuffled\n * songs.\n *\n * Public Accessor: Amplitude.getSongsState();\n *\n * @access public\n */\n function getSongsState() {\n if (config.shuffle_on) {\n return config.shuffle_list;\n } else {\n return config.songs;\n }\n }\n\n /**\n * Get current state of songs in playlist. If shuffled, this will return the\n * shuffled songs.\n *\n * Public Accessor: Amplitude.getSongsStatePlaylist( playlist );\n *\n * @access public\n * @param {string} playlist \t- The playlist key\n */\n function getSongsStatePlaylist(playlist) {\n if (config.playlists[playlist].shuffle) {\n return config.playlists[playlist].shuffle_list;\n } else {\n return config.playlists[playlist].songs;\n }\n }\n\n /**\n * Gets the active index of the player\n *\n * Public Accessor: Amplitude.getActiveIndex()\n *\n * @access public\n */\n function getActiveIndex() {\n return parseInt(config.active_index);\n }\n\n /**\n * Get the version of AmplitudeJS\n *\n * Public Accessor: Amplitude.getVersion()\n *\n * @access public\n */\n function getVersion() {\n return config.version;\n }\n\n /**\n * Get the buffered amount for the current song\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n */\n function getBuffered() {\n return config.buffered;\n }\n\n /**\n * Skip to a certain location in a selected song.\n *\n * Public Accessor: Amplitude.getBuffered()\n *\n * @access public\n * @param {number} seconds \t\t\t\t\t\t- The amount of seconds we should skip to in the song.\n * @param {number} songIndex \t\t\t\t\t- The index of the song in the songs array.\n * @param {string} [playlist = null]\t- The playlist the song we are skipping to belogns to.\n */\n function skipTo(seconds, songIndex, playlist = null) {\n seconds = parseInt(seconds);\n\n if (playlist != null) {\n /*\n Checks if we are skipping to a new playlist\n */\n if (Checks.newPlaylist(playlist)) {\n AudioNavigation.setActivePlaylist(playlist);\n }\n\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSongPlaylist(\n playlist,\n config.playlists[playlist].songs[songIndex],\n songIndex\n );\n Core.play();\n\n /*\n Sync all of the play pause elements.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncPlaylist();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n } else {\n /*\n Changes the song to where it's being skipped and then\n play the song.\n */\n AudioNavigation.changeSong(config.songs[songIndex], songIndex);\n Core.play();\n\n /*\n Syncs all of the play pause buttons now that we've skipped.\n */\n PlayPauseElements.syncGlobal();\n PlayPauseElements.syncSong();\n\n /*\n Skip to the location in the song.\n */\n Core.skipToLocation(seconds);\n }\n }\n\n /**\n * Sets the meta data for a song in the songs array. This will set any\n * meta data for a song besides the URL. The URL could cause issues if the\n * song was playing.\n *\n * Public Accessor: Amplitude.setSongMetaData()\n *\n * @access public\n * @param {number} index\t\t\t\t\t- The index of the song in the songs array.\n * @param {object} metaData \t\t\t- The object containing the meta data we are updating.\n * @param {string} playlist - The playlist we are updating the song meta data for.\n */\n function setSongMetaData(index, metaData, playlist = null) {\n /*\n Update the meta data for a song in a playlist.\n */\n if (\n playlist != \"\" &&\n playlist != null &&\n config.playlists[playlist] != undefined\n ) {\n /*\n Set all of the defined meta data properties\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.playlists[playlist].songs[index][key] = metaData[key];\n }\n }\n }\n } else {\n /*\n Update the meta data for a song.\n */\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (key != \"url\" && key != \"URL\" && key != \"live\" && key != \"LIVE\") {\n config.songs[index][key] = metaData[key];\n }\n }\n }\n }\n\n /*\n Display the updates on the screen.\n */\n MetaDataElements.displayMetaData();\n MetaDataElements.syncMetaData();\n }\n\n function setPlaylistMetaData(playlist, metaData) {\n if (config.playlists[playlist] != undefined) {\n /*\n \t\t\tThese are the ignored keys that we won't be worrying about displaying.\n \t\t\tEvery other key in the playlist object can be displayed.\n \t\t*/\n let ignoredKeys = [\"repeat\", \"shuffle\", \"shuffle_list\", \"songs\", \"src\"];\n\n for (var key in metaData) {\n if (metaData.hasOwnProperty(key)) {\n if (ignoredKeys.indexOf(key) < 0) {\n config.playlists[playlist][key] = metaData[key];\n }\n }\n }\n\n MetaDataElements.displayPlaylistMetaData();\n } else {\n Debug.writeMessage(\"You must provide a valid playlist key!\");\n }\n }\n\n /**\n * Sets the delay between the songs when they are finished.\n *\n * Public Accessor: Amplitude.setDelay()\n *\n * @access public\n * @param {number} delay \t- The millisecond delay time between songs\n */\n function setDelay(time) {\n config.delay = time;\n }\n\n /**\n * Returns the current delay between songs.\n *\n * Public Accessor: Amplitude.getDelay()\n *\n * @access public\n */\n function getDelay() {\n return config.delay;\n }\n\n /**\n * Returns the state of the player.\n *\n * Public Accessor: Amplitude.getPlayerState();\n */\n function getPlayerState() {\n return config.player_state;\n }\n\n /**\n * Registers a visualization and sets that visualization's\n * preferences. When creating a visualization, you can set certain\n * preferences that the user can overwrite similar to Amplitude.\n * Public Accessor: Amplitude.registerVisualization( visualization, preferences )\n *\n * @param {object} visualzation A visualization object that gets registered\n * with Amplitude\n *\n * @param {object} preferences A JSON object of preferences relating to the\n * visualization\n */\n function registerVisualization(visualization, preferences) {\n Visualizations.register(visualization, preferences);\n }\n\n /**\n * Set the visualization for the playlist\n *\n * @param {string} playlist - The playlist we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setPlaylistVisualization(playlist, visualizationKey) {\n if (config.playlists[playlist] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The playlist for the key provided does not exist\");\n }\n }\n\n /**\n * Set a visualization for the song.\n *\n * @param {number} songIndex - The index of the song in the songs array we are setting the visualization for.\n * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.\n */\n function setSongVisualization(songIndex, visualizationKey) {\n if (config.songs[songIndex]) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.songs[songIndex].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"A song at that index is undefined\");\n }\n }\n\n /**\n * Set song in playlist visualization.\n *\n * @param {string} playlist - The playlist we are setting the song visualization for.\n * @param {number} songIndex - The index we are setting the visualization for.\n * @param {strong} visualizationKey - The key of the visualization we are adding to the song in the playlist.\n */\n function setSongInPlaylistVisualization(\n playlist,\n songIndex,\n visualizationKey\n ) {\n if (config.playlists[playlist].songs[songIndex] != undefined) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.playlists[playlist].songs[\n songIndex\n ].visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n } else {\n Debug.writeMessage(\"The song in the playlist at that key is not defined\");\n }\n }\n\n /**\n * Sets the global visualization default.\n */\n function setGlobalVisualization(visualizationKey) {\n if (config.visualizations.available[visualizationKey] != undefined) {\n config.visualization = visualizationKey;\n } else {\n Debug.writeMessage(\n \"A visualization does not exist for the key provided.\"\n );\n }\n }\n\n /**\n * Sets the active volume.\n * @param {number} volumeLevel - A number between 1 and 100 as a percentage of\n * min to max for a volume level.\n */\n function setVolume(volumeLevel) {\n Core.setVolume(volumeLevel);\n }\n\n /**\n * Gets the active volume.\n */\n function getVolume() {\n return config.volume;\n }\n\n /*\n\t\tReturns all of the publically accesible methods.\n\t*/\n return {\n init: init,\n getConfig: getConfig,\n bindNewElements: bindNewElements,\n getActivePlaylist: getActivePlaylist,\n getPlaybackSpeed: getPlaybackSpeed,\n setPlaybackSpeed: setPlaybackSpeed,\n getRepeat: getRepeat,\n getRepeatPlaylist: getRepeatPlaylist,\n getShuffle: getShuffle,\n getShufflePlaylist: getShufflePlaylist,\n setShuffle: setShuffle,\n setShufflePlaylist: setShufflePlaylist,\n setRepeat: setRepeat,\n setRepeatSong: setRepeatSong,\n setRepeatPlaylist: setRepeatPlaylist,\n getDefaultAlbumArt: getDefaultAlbumArt,\n setDefaultAlbumArt: setDefaultAlbumArt,\n getDefaultPlaylistArt: getDefaultPlaylistArt,\n setDefaultPlaylistArt: setDefaultPlaylistArt,\n getSongPlayedPercentage: getSongPlayedPercentage,\n setSongPlayedPercentage: setSongPlayedPercentage,\n getSongPlayedSeconds: getSongPlayedSeconds,\n getSongDuration: getSongDuration,\n setDebug: setDebug,\n getActiveSongMetadata: getActiveSongMetadata,\n getActivePlaylistMetadata: getActivePlaylistMetadata,\n getSongAtIndex: getSongAtIndex,\n getSongAtPlaylistIndex: getSongAtPlaylistIndex,\n addSong: addSong,\n prependSong: prependSong,\n addSongToPlaylist: addSongToPlaylist,\n removeSong: removeSong,\n removeSongFromPlaylist: removeSongFromPlaylist,\n playNow: playNow,\n playSongAtIndex: playSongAtIndex,\n playPlaylistSongAtIndex: playPlaylistSongAtIndex,\n play: play,\n pause: pause,\n stop: stop,\n getAudio: getAudio,\n getAnalyser: getAnalyser,\n next: next,\n prev: prev,\n getSongs: getSongs,\n getSongsInPlaylist: getSongsInPlaylist,\n getSongsState: getSongsState,\n getSongsStatePlaylist: getSongsStatePlaylist,\n getActiveIndex: getActiveIndex,\n getVersion: getVersion,\n getBuffered: getBuffered,\n skipTo: skipTo,\n setSongMetaData: setSongMetaData,\n setPlaylistMetaData: setPlaylistMetaData,\n setDelay: setDelay,\n getDelay: getDelay,\n getPlayerState: getPlayerState,\n addPlaylist: addPlaylist,\n registerVisualization: registerVisualization,\n setPlaylistVisualization: setPlaylistVisualization,\n setSongVisualization: setSongVisualization,\n setSongInPlaylistVisualization: setSongInPlaylistVisualization,\n setGlobalVisualization: setGlobalVisualization,\n getVolume: getVolume,\n setVolume: setVolume\n };\n})();\n\nexport default Amplitude;\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * AmplitudeJS Debug Module\n * @module utilities/Debug\n */\nimport Debug from \"../utilities/debug.js\";\n\n/**\n * AmplitudeJS Checks Utility.\n * @module utilities/Checks\n */\nimport Checks from \"../utilities/checks.js\";\n\n/**\n * AmplitudeJS Visual Meta Data Elements Module\n * @module visual/MetaDataElements\n */\nimport MetaDataElements from \"../visual/metaDataElements.js\";\n\n/**\n * AmplitudeJS SoundCloud Meta module\n * @module soundcloud/Soundcloud\n */\nimport SoundCloud from \"../soundcloud/soundcloud.js\";\n\n/**\n * Handles the initialization of the playlists.\n *\n * @module init/PlaylistsInitializer\n */\nlet PlaylistsInitializer = (function() {\n /**\n * Initializes the playlists for AmplitudeJS\n *\n * @param {Object} playlists - The playlists defined by the user.\n */\n function initialize(playlists) {\n /*\n Copy the playlists over to Amplitude\n */\n config.playlists = playlists;\n\n /*\n Copy songs over from songs array.\n */\n copySongsToPlaylists();\n\n /*\n Grab any SoundCloud Data for the playlist songs if needed.\n */\n grabSoundCloudData();\n\n /*\n Initialize a scoped active index for each playlist.\n */\n initializePlaylistActiveIndexes();\n\n /*\n Initialize the shuffle status of the playlists.\n */\n initializePlaylistShuffleStatuses();\n\n /*\n Initialize the repeat status for the playlits.\n */\n initializePlaylistsRepeatStatuses();\n\n /*\n Initialize temporary place holders for shuffle lists.\n */\n initializePlaylistShuffleLists();\n\n /*\n Initializes the first song in the playlist\n */\n initializeFirstSongInPlaylistMetaData();\n }\n\n /**\n * Initializes a scoped active index for each playlist.\n *\n * @access private\n */\n function initializePlaylistActiveIndexes() {\n /*\n \t\tIterate over all of the playlists defined by the user\n and add an active index.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].active_index = null;\n }\n }\n\n /**\n * Ensures the indexes in the playlists are valid indexes. The song has\n * to exist in the Amplitude config to be played correctly. If the index\n * is an integer, we ensure it exists and coy it to the array.\n *\n * @access private\n */\n function copySongsToPlaylists() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Checks if the playlist has songs.\n */\n if (config.playlists[key].songs) {\n /*\n Iterate over all of the songs in the playlist\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n if (Checks.isInt(config.playlists[key].songs[i])) {\n config.playlists[key].songs[i] =\n config.songs[config.playlists[key].songs[i]];\n\n config.playlists[key].songs[i].index = i;\n }\n /*\n Check to see if the index for the song in the playlist\n exists in the songs config.\n */\n if (\n Checks.isInt(config.playlists[key].songs[i]) &&\n !config.songs[config.playlists[key].songs[i]]\n ) {\n Debug.writeMessage(\n \"The song index: \" +\n config.playlists[key].songs[i] +\n \" in playlist with key: \" +\n key +\n \" is not defined in your songs array!\"\n );\n }\n\n /*\n If not an int, then is a dedicated song, just set the index.\n */\n if (!Checks.isInt(config.playlists[key].songs[i]) ){\n config.playlists[key].songs[i].index = i;\n }\n }\n }\n }\n }\n }\n\n /**\n * Grabs the SoundCloud data for any song in the playlist that\n * the user needs to grab data for.\n *\n * @access private\n */\n function grabSoundCloudData() {\n /*\n Iterate over all of the config's playlists\n */\n for (let key in config.playlists) {\n /*\n Checks if the playlist key is accurate.\n */\n if (config.playlists.hasOwnProperty(key)) {\n /*\n Iterate over all of the songs in the playlist and see if\n they need to grab the SoundCloud data for the song.\n */\n for (let i = 0; i < config.playlists[key].songs.length; i++) {\n /*\n Only Grab the data if the URL is a SoundCloud URL.\n */\n if (SoundCloud.isSoundCloudURL(config.playlists[key].songs[i].url)) {\n /*\n Only grab the data if the SoundCloud data has not already been\n grabbed for the audio. This could happen if the user defined the\n song in the songs array and was grabbed before.\n */\n if (config.playlists[key].songs[i].soundcloud_data == undefined) {\n SoundCloud.resolveIndividualStreamableURL(\n config.playlists[key].songs[i].url,\n key,\n i\n );\n }\n }\n }\n }\n }\n }\n\n /**\n * Initializes the shuffle statuses for each of the playlists. These will\n * be referenced when we shuffle individual playlists.\n *\n * @access private\n */\n function initializePlaylistShuffleStatuses() {\n /*\n\t\t\tIterate over all of the playlists the user defined adding\n\t\t\tthe playlist key to the shuffled playlist array and creating\n\t\t\tand empty object to house the statuses.\n\t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle = false;\n }\n }\n\n /**\n * Initializes the repeat statuses for each of the playlists. These will\n * be referenced when we repeat individual playlits.\n *\n * @access private\n */\n function initializePlaylistsRepeatStatuses() {\n /*\n Iterate over all of the playlists the user defined adding\n the playlist key to the repeated playlist array and creating\n and empty object to house the statuses.\n */\n for (let key in config.playlists) {\n config.playlists[key].repeat = false;\n }\n }\n\n /**\n * Initializes the shuffled playlist placeholders. These will be set for\n * playlists that are shuffled and contain the shuffled songs.\n *\n * @access private\n */\n function initializePlaylistShuffleLists() {\n /*\n \t\t\tIterate over all of the playlists the user defined adding\n \t\t\tthe playlist key to the shuffled playlists array and creating\n \t\t\tand empty object to house the shuffled playlists\n \t\t*/\n for (let key in config.playlists) {\n config.playlists[key].shuffle_list = [];\n }\n }\n\n /**\n * Intializes the display for the first song in the playlist meta data.\n *\n * @access private\n */\n function initializeFirstSongInPlaylistMetaData() {\n /*\n\t\t\tIterates over all of the playlists setting the meta data for the\n\t\t\tfirst song.\n\t\t*/\n for (let key in config.playlists) {\n MetaDataElements.setFirstSongInPlaylist(\n config.playlists[key].songs[0],\n key\n );\n }\n }\n\n /*\n Returns the public facing methods\n */\n return {\n initialize: initialize\n };\n})();\n\nexport default PlaylistsInitializer;\n\n\n\n// WEBPACK FOOTER //\n// ./src/init/playlists.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../config.js\";\n\n/**\n * Handles all of the container elements.\n *\n * @param visual/ContainerElements\n */\nlet ContainerElements = (function() {\n /**\n * Applies the class 'amplitude-active-song-container' to the element\n * containing visual information regarding the active song.\n *\n * @prop {boolean} direct - Determines if it was a direct click on the song. We\n * then don't care if shuffle is on or not.\n *\n * @access public\n */\n function setActive(direct) {\n /*\n Gets all of the song container elements.\n */\n let songContainers = document.getElementsByClassName(\n \"amplitude-song-container\"\n );\n\n /*\n\t\t\tRemoves all of the active song containrs.\n\t\t*/\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.remove(\"amplitude-active-song-container\");\n }\n\n /*\n\t\t\tFinds the active index and adds the active song container to the element\n\t\t\tthat represents the song at the index.\n\t\t*/\n if (config.active_playlist == \"\" || config.active_playlist == null) {\n let activeIndex = \"\";\n\n /*\n If we click directly on the song element, we ignore\n whether it's in shuffle or not.\n */\n if (direct) {\n activeIndex = config.active_index;\n } else {\n if (config.shuffle_on) {\n activeIndex = config.shuffle_list[config.active_index].index;\n } else {\n activeIndex = config.active_index;\n }\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activeIndex +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n if (!songContainers[i].hasAttribute(\"data-amplitude-playlist\")) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n } else {\n /*\n If we have an active playlist or the action took place directly on the\n song element, we ignore the shuffle.\n */\n if (\n (config.active_playlist != null && config.active_playlist != \"\") ||\n direct\n ) {\n var activePlaylistIndex =\n config.playlists[config.active_playlist].active_index;\n } else {\n var activePlaylistIndex = \"\";\n\n if (config.playlists[config.active_playlist].shuffle) {\n activePlaylistIndex =\n config.playlists[config.active_playlist].shuffle_list[\n config.playlists[config.active_playlist].active_index\n ].index;\n } else {\n activePlaylistIndex =\n config.playlists[config.active_playlist].active_index;\n }\n }\n\n if (\n document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n )\n ) {\n let songContainers = document.querySelectorAll(\n '.amplitude-song-container[data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"][data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < songContainers.length; i++) {\n songContainers[i].classList.add(\"amplitude-active-song-container\");\n }\n }\n }\n }\n\n return {\n setActive: setActive\n };\n})();\n\nexport default ContainerElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/containerElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time hour elements.\n *\n * @module visual/time/CurrentHourElements\n */\nlet CurrentHourElements = (function() {\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Updates any elements that display the current hour for the song.\n *\n * @access public\n * @param {number} hours \t- An integer conaining how many hours into the song.\n */\n function syncGlobal(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourSelectors = document.querySelectorAll(\n \".amplitude-current-hours\"\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourSelectors.length; i++) {\n let playlist = currentHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist current hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncPlaylist(hours) {\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSelectors.length; i++) {\n let songIndex = currentHourPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (songIndex == null) {\n currentHourPlaylistSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the hour selectors\n \t\t*/\n const currentHourSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current hour selector's inner html to hours passed in.\n \t\t*/\n for (let i = 0; i < currentHourSongSelectors.length; i++) {\n let playlist = currentHourSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current hour selector for a global display.\n */\n if (playlist == null) {\n currentHourSongSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist song hour elements.\n *\n * @param {Integer} hour - The current audio hour.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the hour selectors\n\t\t*/\n const currentHourPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current hour selector's inner html to hours passed in.\n\t\t*/\n for (let i = 0; i < currentHourPlaylistSongSelectors.length; i++) {\n currentHourPlaylistSongSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Reset the current hour elements.\n */\n function resetTimes() {\n /*\n Gets the hour display elements\n */\n let hourSelectors = document.querySelectorAll(\".amplitude-current-hours\");\n\n /*\n Iterates over all of the hour selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < hourSelectors.length; i++) {\n hourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time minutes elements.\n *\n * @module visual/time/CurrentMinuteElements\n */\nlet CurrentMinuteElements = (function() {\n /**\n * Syncs the current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global current minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncGlobal(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinuteSelectors.length; i++) {\n let playlist = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncPlaylist(minutes) {\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSelectors.length; i++) {\n let songIndex = currentMinutePlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (songIndex == null) {\n currentMinutePlaylistSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the current song minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the minute selectors\n \t\t*/\n const currentMinuteSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current minute selector's inner html to minutes passed in.\n \t\t*/\n for (let i = 0; i < currentMinuteSongSelectors.length; i++) {\n let playlist = currentMinuteSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current minute selector for a global display.\n */\n if (playlist == null) {\n currentMinuteSongSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist minutes elements.\n *\n * @param {Integer} minutes - The current audio minutes.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n /*\n\t\t\tGet all of the minute selectors\n\t\t*/\n const currentMinutePlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current minute selector's inner html to minutes passed in.\n\t\t*/\n for (let i = 0; i < currentMinutePlaylistSongSelectors.length; i++) {\n currentMinutePlaylistSongSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Reset the current times.\n */\n function resetTimes() {\n /*\n Gets the minute display elements\n */\n let minuteSelectors = document.querySelectorAll(\n \".amplitude-current-minutes\"\n );\n\n /*\n Iterates over all of the minute selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < minuteSelectors.length; i++) {\n minuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the current time seconds elements.\n *\n * @module visual/time/CurrentSecondElements\n */\nlet CurrentSecondElements = (function() {\n /**\n * Syncs the current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global current seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncGlobal(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondSelectors.length; i++) {\n let playlist = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null && songIndex == null) {\n currentSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncPlaylist(seconds) {\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSelectors.length; i++) {\n let songIndex = currentSecondPlaylistSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (songIndex == null) {\n currentSecondPlaylistSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the current song seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the second selectors\n \t\t*/\n const currentSecondSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the current second selector's inner html to seconds passed in.\n \t\t*/\n for (let i = 0; i < currentSecondSongSelectors.length; i++) {\n let playlist = currentSecondSongSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n /*\n Updates the current second selector for a global display.\n */\n if (playlist == null) {\n currentSecondSongSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the current song in playlist seconds elements.\n *\n * @param {Integer} seconds - The current audio seconds.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the second selectors\n\t\t*/\n const currentSecondPlaylistSongSelectors = document.querySelectorAll(\n '.amplitude-current-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the current second selector's inner html to seconds passed in.\n\t\t*/\n for (let i = 0; i < currentSecondPlaylistSongSelectors.length; i++) {\n currentSecondPlaylistSongSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Reset the current seconds elements.\n */\n function resetTimes() {\n /*\n Gets the second display elements\n */\n let secondSelectors = document.querySelectorAll(\n \".amplitude-current-seconds\"\n );\n\n /*\n Iterates over all of the second selectors and sets the inner HTML\n to 00.\n */\n for (var i = 0; i < secondSelectors.length; i++) {\n secondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * These methods help sync visual time elements.\n *\n * @module visual/CurrentTimeElements\n */\nlet CurrentTimeElements = (function() {\n /**\n * Visually displays the current time on the screen. This is called on\n * time update for the current song.\n *\n * @access public\n * @param {object} currentTime \t\t\t\t\t- An object containing the current time for the song in seconds, minutes, and hours.\n */\n function sync(currentTime) {\n /*\n\t\t\tSet current time display.\n\t\t*/\n syncGlobal(currentTime);\n syncPlaylist(currentTime);\n syncSong(currentTime);\n syncSongInPlaylist(currentTime);\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncGlobal(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n \".amplitude-current-time\"\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncPlaylist(time) {\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let songIndex = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSong(time) {\n if (config.active_playlist == null) {\n /*\n \t\t\tGet all of the time selectors.\n \t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n /*\n \t\t\tSet the time selector's inner html to the current time for the song. The current\n \t\t\ttime is computed by joining minutes and seconds.\n \t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n let playlist = currentTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n }\n }\n\n /**\n * Updates any elements that display the current time for the song. This\n * is a computed field that will be commonly used.\n *\n * @access public\n * @param {object} time \t- A json object conaining the parts for the current time for the song.\n */\n function syncSongInPlaylist(time) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n /*\n\t\t\tGet all of the time selectors.\n\t\t*/\n let currentTimeSelectors = document.querySelectorAll(\n '.amplitude-current-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n /*\n\t\t\tSet the time selector's inner html to the current time for the song. The current\n\t\t\ttime is computed by joining minutes and seconds.\n\t\t*/\n var timeText = time.minutes + \":\" + time.seconds;\n\n if (time.hours > 0) {\n timeText = time.hours + \":\" + timeText;\n }\n\n for (let i = 0; i < currentTimeSelectors.length; i++) {\n currentTimeSelectors[i].innerHTML = timeText;\n }\n }\n\n /**\n * Resets the current time displays to 00:00\n *\n * @access public\n */\n function resetTimes() {\n /*\n\t\t\tGets the time selector display elements\n\t\t*/\n let timeSelectors = document.querySelectorAll(\".amplitude-current-time\");\n\n /*\n\t\t\tIterates over all of the time selectors and sets the inner HTML\n\t\t\tto 00.\n\t\t*/\n for (let i = 0; i < timeSelectors.length; i++) {\n timeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Returns the publically facing methods\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default CurrentTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/currentTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration countdown elements.\n *\n * @module visual/time/DurationCountDownTimeElements.\n */\nlet DurationCountDownTimeElements = (function() {\n /**\n * Syncs all of the countdown time elements.\n *\n * @param {object} countDownTime - The current time of the audio.\n * @param {object} songDuration - The song duration of the audio.\n */\n function sync(countDownTime, songDuration) {\n let timeRemaining = computeTimeRemaining(countDownTime, songDuration);\n\n syncGlobal(timeRemaining);\n syncPlaylist(timeRemaining);\n syncSong(timeRemaining);\n syncSongInPlaylist(timeRemaining);\n }\n\n /**\n * Syncs the global count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncGlobal(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncPlaylist(timeRemaining) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let songIndex = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n\n /**\n * Syncs the song count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSong(timeRemaining) {\n if (config.active_playlist == null) {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n let playlist = durationTimeRemainingSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist count down time elements.\n *\n * @param {string} timeRemaining - The time remaining for the audio.\n */\n function syncSongInPlaylist(timeRemaining) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeRemainingSelectors = document.querySelectorAll(\n '.amplitude-time-remaining[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = timeRemaining;\n }\n }\n\n /**\n * Resets the count down times.\n */\n function resetTimes() {\n let durationTimeRemainingSelectors = document.querySelectorAll(\n \".amplitude-time-remaining\"\n );\n\n for (let i = 0; i < durationTimeRemainingSelectors.length; i++) {\n durationTimeRemainingSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Computes the time remaining for the audio.\n *\n * @param {object} currentTime - The current time of the audio.\n * @param {object} songDuration - The duration of the audio.\n */\n function computeTimeRemaining(currentTime, songDuration) {\n let timeRemaining = \"00:00\";\n\n /*\n Initialize the total current seconds and total duration seconds\n */\n let totalCurrentSeconds =\n parseInt(currentTime.seconds) +\n parseInt(currentTime.minutes) * 60 +\n parseInt(currentTime.hours) * 60 * 60;\n let totalDurationSeconds =\n parseInt(songDuration.seconds) +\n parseInt(songDuration.minutes) * 60 +\n parseInt(songDuration.hours) * 60 * 60;\n\n /*\n If the two variables are numbers we continue the computing.\n */\n if (!isNaN(totalCurrentSeconds) && !isNaN(totalDurationSeconds)) {\n /*\n Find the total remaining seconds.\n */\n let timeRemainingTotalSeconds =\n totalDurationSeconds - totalCurrentSeconds;\n\n var remainingHours = Math.floor(timeRemainingTotalSeconds / 3600);\n var remainingMinutes = Math.floor(\n (timeRemainingTotalSeconds - remainingHours * 3600) / 60\n );\n var remainingSeconds =\n timeRemainingTotalSeconds -\n remainingHours * 3600 -\n remainingMinutes * 60;\n\n timeRemaining =\n (remainingMinutes < 10 ? \"0\" + remainingMinutes : remainingMinutes) +\n \":\" +\n (remainingSeconds < 10 ? \"0\" + remainingSeconds : remainingSeconds);\n\n if (remainingHours > 0) {\n timeRemaining = remainingHours + \":\" + timeRemaining;\n }\n }\n\n return timeRemaining;\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationCountDownTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationCountDownTimeElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration hours elements.\n *\n * @module visual/time/DurationHourElements.\n */\nlet DurationHourElements = (function() {\n /**\n * Sync the duration hours elements.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function sync(hours) {\n syncGlobal(hours);\n syncPlaylist(hours);\n syncSong(hours);\n syncSongInPlaylist(hours);\n }\n\n /**\n * Syncs the global duration hours elements.\n *\n * @param {Integer} hours - the duration hours for the audio.\n */\n function syncGlobal(hours) {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the playlist duration hours for the audio.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncPlaylist(hours) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let songIndex = durationHourSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n\n /**\n * Syncs the song duration hours.\n *\n * @param {Integer} hours - The duration hours for the audio.\n */\n function syncSong(hours) {\n if (config.active_playlist == null) {\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n let playlist = durationHourSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration hours.\n *\n * @param {Integer} hours - The duration hours of the audio.\n */\n function syncSongInPlaylist(hours) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationHourSelectors = document.querySelectorAll(\n '.amplitude-duration-hours[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = hours;\n }\n }\n\n /**\n * Resets the duration shours elements to '00'\n */\n function resetTimes() {\n let durationHourSelectors = document.querySelectorAll(\n \".amplitude-duration-hours\"\n );\n\n for (let i = 0; i < durationHourSelectors.length; i++) {\n durationHourSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationHourElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationHourElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration minutes elements.\n *\n * @module visual/time/DurationMinuteElements.\n */\nlet DurationMinuteElements = (function() {\n /**\n * Sync the duration minutes elements.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function sync(minutes) {\n syncGlobal(minutes);\n syncPlaylist(minutes);\n syncSong(minutes);\n syncSongInPlaylist(minutes);\n }\n\n /**\n * Syncs the global duration minutes elements.\n *\n * @param {Integer} minutes - the duration minutes for the audio.\n */\n function syncGlobal(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the playlist duration minutes for the audio.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncPlaylist(minutes) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let songIndex = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n\n /**\n * Syncs the song duration minutes.\n *\n * @param {Integer} minutes - The duration minutes for the audio.\n */\n function syncSong(minutes) {\n if (config.active_playlist == null) {\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n let playlist = durationMinuteSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration minutes.\n *\n * @param {Integer} minutes - The duration minutes of the audio.\n */\n function syncSongInPlaylist(minutes) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationMinuteSelectors = document.querySelectorAll(\n '.amplitude-duration-minutes[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = minutes;\n }\n }\n\n /**\n * Resets the duration minutes elements to '00'\n */\n function resetTimes() {\n let durationMinuteSelectors = document.querySelectorAll(\n \".amplitude-duration-minutes\"\n );\n\n for (let i = 0; i < durationMinuteSelectors.length; i++) {\n durationMinuteSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationMinuteElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationMinuteElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration seconds elements.\n *\n * @module visual/time/DurationSecondElements.\n */\nlet DurationSecondElements = (function() {\n /**\n * Sync the duration seconds elements.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function sync(seconds) {\n syncGlobal(seconds);\n syncPlaylist(seconds);\n syncSong(seconds);\n syncSongInPlaylist(seconds);\n }\n\n /**\n * Syncs the global duration seconds elements.\n *\n * @param {Integer} seconds - the duration seconds for the audio.\n */\n function syncGlobal(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the playlist duration seconds for the audio.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncPlaylist(seconds) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let songIndex = durationSecondSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n\n /**\n * Syncs the song duration seconds.\n *\n * @param {Integer} seconds - The duration seconds for the audio.\n */\n function syncSong(seconds) {\n if (config.active_playlist == null) {\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n let playlist = durationSecondSelectors[i].getAttribute(\n \"data--amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n }\n }\n\n /**\n * Syncs the song in playlist duration seconds.\n *\n * @param {Integer} seconds - The duration seconds of the audio.\n */\n function syncSongInPlaylist(seconds) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationSecondSelectors = document.querySelectorAll(\n '.amplitude-duration-seconds[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = seconds;\n }\n }\n\n /**\n * Resets the duration seconds elements to '00'\n */\n function resetTimes() {\n let durationSecondSelectors = document.querySelectorAll(\n \".amplitude-duration-seconds\"\n );\n\n for (let i = 0; i < durationSecondSelectors.length; i++) {\n durationSecondSelectors[i].innerHTML = \"00\";\n }\n }\n\n /**\n * Returns the publically facing methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationSecondElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationSecondElements.js","/**\n * Imports the config module\n * @module config\n */\nimport config from \"../../config.js\";\n\n/**\n * Handles all of the duration time elements.\n *\n * @module visual/time/DurationTimeElements.\n */\nlet DurationTimeElements = (function() {\n /**\n * Syncs the duration time for all elements.\n *\n * @param {Object} durationTime - The object containing all of the song duration times.\n */\n function sync(durationTime) {\n let durationText = computeDurationText(durationTime);\n\n syncGlobal(durationText);\n syncPlaylist(durationText);\n syncSong(durationText);\n syncSongInPlaylist(durationText);\n }\n\n /**\n * Sync the global song duration elements.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncGlobal(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (playlist == null && songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the playlist duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncPlaylist(durationText) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let songIndex = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-song-index\"\n );\n\n if (songIndex == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n\n /**\n * Sync the song duration times.\n *\n * @param {Object} durationText - The text for the song duration.\n */\n function syncSong(durationText) {\n if (config.active_playlist == null) {\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-song-index=\"' +\n config.active_index +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n let playlist = durationTimeSelectors[i].getAttribute(\n \"data-amplitude-playlist\"\n );\n\n if (playlist == null) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n }\n }\n\n /**\n * Sync the song in playlist duration times.\n *\n * @param {Object} durationText - An object containing the duration text.\n */\n function syncSongInPlaylist(durationText) {\n let activePlaylistIndex =\n config.active_playlist != \"\" && config.active_playlist != null\n ? config.playlists[config.active_playlist].active_index\n : null;\n\n let durationTimeSelectors = document.querySelectorAll(\n '.amplitude-duration-time[data-amplitude-playlist=\"' +\n config.active_playlist +\n '\"][data-amplitude-song-index=\"' +\n activePlaylistIndex +\n '\"]'\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = durationText;\n }\n }\n\n /**\n * Resets all of the duration times to empty.\n */\n function resetTimes() {\n let durationTimeSelectors = document.querySelectorAll(\n \".amplitude-duration-time\"\n );\n\n for (let i = 0; i < durationTimeSelectors.length; i++) {\n durationTimeSelectors[i].innerHTML = \"00:00\";\n }\n }\n\n /**\n * Computes the duration text\n *\n * @param {Object} durationTime - An object containint the duration times.\n */\n function computeDurationText(durationTime) {\n var durationText = \"00:00\";\n\n if (!isNaN(durationTime.minutes) && !isNaN(durationTime.seconds)) {\n durationText = durationTime.minutes + \":\" + durationTime.seconds;\n if (!isNaN(durationTime.hours) && durationTime.hours > 0) {\n durationText = durationTime.hours + \":\" + durationText;\n }\n }\n\n return durationText;\n }\n\n /**\n * Return publically accessible methods.\n */\n return {\n sync: sync,\n resetTimes: resetTimes\n };\n})();\n\nexport default DurationTimeElements;\n\n\n\n// WEBPACK FOOTER //\n// ./src/visual/time/durationTimeElements.js","module.exports = {\"name\":\"amplitudejs\",\"version\":\"5.3.2\",\"description\":\"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs\",\"main\":\"dist/amplitude.js\",\"devDependencies\":{\"babel-core\":\"^6.26.3\",\"babel-loader\":\"^7.1.5\",\"babel-plugin-add-module-exports\":\"0.2.1\",\"babel-polyfill\":\"^6.26.0\",\"babel-preset-es2015\":\"^6.18.0\",\"husky\":\"^1.3.1\",\"jest\":\"^23.6.0\",\"prettier\":\"1.15.1\",\"pretty-quick\":\"^1.11.1\",\"watch\":\"^1.0.2\",\"webpack\":\"^2.7.0\"},\"directories\":{\"doc\":\"docs\"},\"files\":[\"dist\"],\"funding\":{\"type\":\"opencollective\",\"url\":\"https://opencollective.com/amplitudejs\"},\"scripts\":{\"build\":\"node_modules/.bin/webpack\",\"prettier\":\"npx pretty-quick\",\"preversion\":\"npx pretty-quick && npm run test\",\"postversion\":\"git push && git push --tags\",\"test\":\"jest\",\"version\":\"npm run build && git add -A dist\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/521dimensions/amplitudejs.git\"},\"keywords\":[\"webaudio\",\"html5\",\"javascript\",\"audio-player\"],\"author\":\"521 Dimensions (https://521dimensions.com)\",\"license\":\"MIT\",\"bugs\":{\"url\":\"https://github.com/521dimensions/amplitudejs/issues\"},\"homepage\":\"https://github.com/521dimensions/amplitudejs#readme\"}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./package.json\n// module id = 59\n// module chunks = 0 1"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/amplitude.min.js b/dist/amplitude.min.js index e3a0b542..353ece0b 100644 --- a/dist/amplitude.min.js +++ b/dist/amplitude.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Amplitude",[],t):"object"==typeof exports?exports.Amplitude=t():e.Amplitude=t()}(this,function(){return function(e){function t(l){if(a[l])return a[l].exports;var u=a[l]={i:l,l:!1,exports:{}};return e[l].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var a={};return t.m=e,t.c=a,t.i=function(e){return e},t.d=function(e,a,l){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=47)}([function(e,t,a){"use strict";var l=a(59);e.exports={version:l.version,audio:new Audio,active_metadata:{},active_album:"",active_index:0,active_playlist:null,playback_speed:1,callbacks:{},songs:[],playlists:{},start_song:"",starting_playlist:"",starting_playlist_song:"",repeat:!1,repeat_song:!1,shuffle_list:{},shuffle_on:!1,default_album_art:"",default_playlist_art:"",debug:!1,volume:.5,pre_mute_volume:.5,volume_increment:5,volume_decrement:5,soundcloud_client:"",soundcloud_use_art:!1,soundcloud_song_count:0,soundcloud_songs_ready:0,is_touch_moving:!1,buffered:0,bindings:{},continue_next:!0,delay:0,player_state:"stopped",web_audio_api_available:!1,context:null,source:null,analyser:null,visualizations:{available:[],active:[],backup:""},waveforms:{sample_rate:100,built:[]}}},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(5),d=(l(i),a(3)),s=(l(d),a(2)),o=(l(s),a(7)),f=(l(o),a(9)),r=l(f),c=a(4),p=l(c),v=a(16),y=l(v),g=a(6),m=l(g),_=function(){function e(){y.default.stop(),y.default.run(),n.default.active_metadata.live&&s(),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&!n.default.paused&&s();var e=n.default.audio.play();void 0!==e&&e.then(function(e){}).catch(function(e){}),n.default.audio.play(),n.default.audio.playbackRate=n.default.playback_speed,m.default.setPlayerState()}function t(){y.default.stop(),n.default.audio.pause(),n.default.paused=!0,n.default.active_metadata.live&&d(),m.default.setPlayerState()}function a(){y.default.stop(),0!=n.default.audio.currentTime&&(n.default.audio.currentTime=0),n.default.audio.pause(),n.default.active_metadata.live&&d(),m.default.setPlayerState(),r.default.run("stop")}function l(e){n.default.audio.muted=0==e,n.default.volume=e,n.default.audio.volume=e/100}function u(e){n.default.active_metadata.live||(n.default.audio.currentTime=n.default.audio.duration*(e/100))}function i(e){n.default.audio.addEventListener("canplaythrough",function(){n.default.audio.duration>=e&&e>0?n.default.audio.currentTime=e:p.default.writeMessage("Amplitude can't skip to a location greater than the duration of the audio or less than 0")},{once:!0})}function d(){n.default.audio.src="",n.default.audio.load()}function s(){n.default.audio.src=n.default.active_metadata.url,n.default.audio.load()}function o(e){n.default.playback_speed=e,n.default.audio.playbackRate=n.default.playback_speed}return{play:e,pause:t,stop:a,setVolume:l,setSongLocation:u,skipToLocation:i,disconnectStream:d,reconnectStream:s,setPlaybackSpeed:o}}();t.default=_,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=u.default.audio.paused?"paused":"playing",t=document.querySelectorAll(".amplitude-play-pause"),a=0;a0&&void 0!==arguments[0]&&arguments[0],t=null,a={},l=!1;n.default.repeat_song?n.default.shuffle_on?(t=n.default.shuffle_list[n.default.active_index].index,a=n.default.shuffle_list[t]):(t=n.default.active_index,a=n.default.songs[t]):n.default.shuffle_on?(parseInt(n.default.active_index)+11&&void 0!==arguments[1]&&arguments[1],a=null,l={},u=!1;n.default.repeat_song?n.default.playlists[e].shuffle?(a=n.default.playlists[e].active_index,l=n.default.playlists[e].shuffle_list[a]):(a=n.default.playlists[e].active_index,l=n.default.playlists[e].songs[a]):n.default.playlists[e].shuffle?(parseInt(n.default.playlists[e].active_index)+1=0?parseInt(n.default.active_index-1):parseInt(n.default.songs.length-1),t=n.default.shuffle_on?n.default.shuffle_list[e]:n.default.songs[e]),u(t,e),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function l(e){var t=null,a={};n.default.repeat_song?n.default.playlists[e].shuffle?(t=n.default.playlists[e].active_index,a=n.default.playlists[e].shuffle_list[t]):(t=n.default.playlists[e].active_index,a=n.default.playlists[e].songs[t]):(t=parseInt(n.default.playlists[e].active_index)-1>=0?parseInt(n.default.playlists[e].active_index-1):parseInt(n.default.playlists[e].songs.length-1),a=n.default.playlists[e].shuffle?n.default.playlists[e].shuffle_list[t]:n.default.playlists[e].songs[t]),c(e),i(e,a,t),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function u(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];s(e),n.default.audio.src=e.url,n.default.active_metadata=e,n.default.active_album=e.album,n.default.active_index=parseInt(t),f(a)}function i(e,t,a){var l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];s(t),n.default.audio.src=t.url,n.default.active_metadata=t,n.default.active_album=t.album,n.default.active_index=null,n.default.playlists[e].active_index=parseInt(a),f(l)}function s(e){d.default.stop(),p.default.syncToPause(),y.default.resetElements(),m.default.resetElements(),h.default.resetCurrentTimes(),r.default.newAlbum(e)&&o.default.run("album_change")}function f(e){A.default.displayMetaData(),M.default.setActive(e),h.default.resetDurationTimes(),o.default.run("song_change")}function c(e){n.default.active_playlist!=e&&(o.default.run("playlist_changed"),n.default.active_playlist=e,null!=e&&(n.default.playlists[e].active_index=0))}return{setNext:e,setNextPlaylist:t,setPrevious:a,setPreviousPlaylist:l,changeSong:u,changeSongPlaylist:i,setActivePlaylist:c}}();t.default=P,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){u.default.debug&&console.log(e)}return{writeMessage:e}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,t){return u.default.active_playlist!=e||(null==u.default.active_playlist&&null==e?u.default.active_index!=t:u.default.active_playlist==e&&u.default.playlists[e].active_index!=t)}function t(e){return u.default.active_album!=e}function a(e){return u.default.active_playlist!=e}function l(e){return/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(e)}function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}return{newSong:e,newAlbum:t,newPlaylist:a,isURL:l,isInt:n}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){u.default.audio=new Audio,u.default.active_metadata={},u.default.active_album="",u.default.active_index=0,u.default.active_playlist=null,u.default.playback_speed=1,u.default.callbacks={},u.default.songs=[],u.default.playlists={},u.default.start_song="",u.default.starting_playlist="",u.default.starting_playlist_song="",u.default.repeat=!1,u.default.shuffle_list={},u.default.shuffle_on=!1,u.default.default_album_art="",u.default.default_playlist_art="",u.default.debug=!1,u.default.volume=.5,u.default.pre_mute_volume=.5,u.default.volume_increment=5,u.default.volume_decrement=5,u.default.soundcloud_client="",u.default.soundcloud_use_art=!1,u.default.soundcloud_song_count=0,u.default.soundcloud_songs_ready=0,u.default.continue_next=!0}function t(){u.default.audio.paused&&0==u.default.audio.currentTime&&(u.default.player_state="stopped"),u.default.audio.paused&&u.default.audio.currentTime>0&&(u.default.player_state="paused"),u.default.audio.paused||(u.default.player_state="playing")}return{resetConfig:e,setPlayerState:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],t=document.querySelectorAll("[data-amplitude-song-info]"),a=0;a=0?(d=d||u.default.default_album_art,t[a].setAttribute("src",d)):(d=d||"",t[a].innerHTML=d)}}}function t(){for(var e=["image_url"],t=document.querySelectorAll("[data-amplitude-playlist-info]"),a=0;a=0?t[a].setAttribute("src",u.default.playlists[n][l]):t[a].innerHTML=u.default.playlists[n][l]:e.indexOf(l)>=0?""!=u.default.default_playlist_art?t[a].setAttribute("src",u.default.default_playlist_art):t[a].setAttribute("src",""):t[a].innerHTML=""}}function a(e,t){for(var a=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],l=document.querySelectorAll('[data-amplitude-song-info][data-amplitude-playlist="'+t+'"]'),u=0;u=0?l[u].setAttribute("src",e[n]):l[u].innerHTML=e[n]:a.indexOf(n)>=0?""!=e.default_album_art?l[u].setAttribute("src",e.default_album_art):l[u].setAttribute("src",""):l[u].innerHTML="")}}function l(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],a=document.querySelectorAll("[data-amplitude-song-info]"),l=0;l=0?(s=s||u.default.default_album_art,a[l].setAttribute("src",s)):a[l].innerHTML=s}if(null!=n&&null!=i){var o=a[l].getAttribute("data-amplitude-song-info");void 0!=u.default.playlists[i].songs[n][o]&&(e.indexOf(o)>=0?a[l].setAttribute("src",u.default.playlists[i].songs[n][o]):a[l].innerHTML=u.default.playlists[i].songs[n][o])}}t()}return{displayMetaData:e,setFirstSongInPlaylist:a,syncMetaData:l,displayPlaylistMetaData:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-repeat"),t=0;t0;a--){d(e,a,Math.floor(Math.random()*u.default.songs.length+1)-1)}u.default.shuffle_list=e}function i(e){for(var t=new Array(u.default.playlists[e].songs.length),a=0;a0;l--){d(t,l,Math.floor(Math.random()*u.default.playlists[e].songs.length+1)-1)}u.default.playlists[e].shuffle_list=t}function d(e,t,a){var l=e[t];e[t]=e[a],e[a]=l}return{setShuffle:e,toggleShuffle:t,setShufflePlaylist:a,toggleShufflePlaylist:l,shuffleSongs:n,shufflePlaylistSongs:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,u,i){t(e),a(e,u),l(e,i),n(e,u)}function t(e){e=isNaN(e)?0:e;for(var t=document.querySelectorAll(".amplitude-song-slider"),a=0;a0&&e.length>0)for(var i=0;i0?Object.keys(n.default.visualizations.available)[0]:null;null!=l&&i(l,e)}}function a(e,t){if(t==n.default.active_playlist){var a=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,l=n.default.playlists[n.default.active_playlist].visualization,u=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else{var d=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=d&&i(d,e)}}}function l(e,t){if(t==n.default.active_index){var a=n.default.songs[n.default.active_index].visualization,l=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else{var u=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=u&&i(u,e)}}}function u(e,t,a){if(t==n.default.active_playlist&&n.default.playlists[t].active_index==a){var l=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,u=n.default.playlists[n.default.active_playlist].visualization,d=n.default.visualization;if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else if(void 0!=d&&void 0!=n.default.visualizations.available[d])i(d,e);else{var s=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=s&&i(s,e)}}}function i(e,t){var a=new n.default.visualizations.available[e].object;a.setPreferences(n.default.visualizations.available[e].preferences),a.startVisualization(t),n.default.visualizations.active.push(a)}function d(){for(var e=0;e0)for(var t=0;t3&&void 0!==arguments[3]&&arguments[3];SC.get("/resolve/?url="+e,function(e){e.streamable?null!=t?(n.default.playlists[t].songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.playlists[t].shuffle_list[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.playlists[t].songs[a].cover_art_url=e.artwork_url,l&&(n.default.playlists[t].shuffle_list[a].cover_art_url=e.artwork_url)),n.default.playlists[t].songs[a].soundcloud_data=e,l&&(n.default.playlists[t].shuffle_list[a].soundcloud_data=e)):(n.default.songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.shuffle_list[a].stream_url,n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.songs[a].cover_art_url=e.artwork_url,l&&(n.default.shuffle_list[a].cover_art_url=e.artwork_url)),n.default.songs[a].soundcloud_data=e,l&&(n.default.shuffle_list[a].soundcloud_data=e)):null!=t?AmplitudeHelpers.writeDebugMessage(n.default.playlists[t].songs[a].name+" by "+n.default.playlists[t].songs[a].artist+" is not streamable by the Soundcloud API"):AmplitudeHelpers.writeDebugMessage(n.default.songs[a].name+" by "+n.default.songs[a].artist+" is not streamable by the Soundcloud API")})}function u(e,t){SC.get("/resolve/?url="+e,function(e){e.streamable?(n.default.songs[t].url=e.stream_url+"?client_id="+n.default.soundcloud_client,n.default.soundcloud_use_art&&(n.default.songs[t].cover_art_url=e.artwork_url),n.default.songs[t].soundcloud_data=e):AmplitudeHelpers.writeDebugMessage(n.default.songs[t].name+" by "+n.default.songs[t].artist+" is not streamable by the Soundcloud API"),++n.default.soundcloud_songs_ready==n.default.soundcloud_song_count&&d.default.setConfig(s)})}function i(e){var t=/^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/;return e.match(t)}var s={};return{loadSoundCloud:e,resolveIndividualStreamableURL:l,isSoundCloudURL:i}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-playback-speed"),t=0;t0))for(var u=0;u0&&C.default.initialize(e.playlists),void 0==e.start_song||e.starting_playlist?E.default.changeSong(i.default.songs[0],0):g.default.isInt(e.start_song)?E.default.changeSong(i.default.songs[e.start_song],e.start_song):v.default.writeMessage("You must enter an integer index for the start song."),void 0!=e.shuffle_on&&e.shuffle_on&&(i.default.shuffle_on=!0,_.default.shuffleSongs(),E.default.changeSong(i.default.shuffle_list[0],0)),i.default.continue_next=void 0==e.continue_next||e.continue_next,i.default.playback_speed=void 0!=e.playback_speed?e.playback_speed:1,s.default.setPlaybackSpeed(i.default.playback_speed),i.default.audio.preload=void 0!=e.preload?e.preload:"auto",i.default.callbacks=void 0!=e.callbacks?e.callbacks:{},i.default.bindings=void 0!=e.bindings?e.bindings:{},i.default.volume=void 0!=e.volume?e.volume:50,i.default.delay=void 0!=e.delay?e.delay:0,i.default.volume_increment=void 0!=e.volume_increment?e.volume_increment:5,i.default.volume_decrement=void 0!=e.volume_decrement?e.volume_decrement:5,s.default.setVolume(i.default.volume),l(e),n(),void 0!=e.starting_playlist&&""!=e.starting_playlist&&(i.default.active_playlist=e.starting_playlist,void 0!=e.starting_playlist_song&&""!=e.starting_playlist_song?void 0!=u(e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)])?E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)],parseInt(e.starting_playlist_song)):(E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),v.default.writeMessage("The index of "+e.starting_playlist_song+" does not exist in the playlist "+e.starting_playlist)):E.default.changeSong(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),V.default.sync()),T.default.run("initialized")}function l(e){void 0!=e.default_album_art?i.default.default_album_art=e.default_album_art:i.default.default_album_art="",void 0!=e.default_playlist_art?i.default.default_playlist_art=e.default_playlist_art:i.default.default_playlist_art=""}function n(){j.default.syncMain(),q.default.setMuted(0==i.default.volume),H.default.sync(),G.default.sync(),D.default.resetCurrentTimes(),V.default.syncToPause(),F.default.syncMetaData(),X.default.syncRepeatSong()}function d(e){var t=0,a=void 0;for(a in e)e.hasOwnProperty(a)&&t++;return v.default.writeMessage("You have "+t+" playlist(s) in your config"),t}function o(){for(var e=0;e0)for(var t=0;tp&&(p=y),yn[2*o])&&(n[2*o]=p),(0===i||c0}var r="",c="",p="";return{init:e,build:t,determineIfUsingWaveforms:f}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e={},t=(Math.floor(u.default.audio.currentTime%60)<10?"0":"")+Math.floor(u.default.audio.currentTime%60),a=Math.floor(u.default.audio.currentTime/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=t,e.minutes=a,e.hours=l,e}function t(){var e={},t=(Math.floor(u.default.audio.duration%60)<10?"0":"")+Math.floor(u.default.audio.duration%60),a=Math.floor(u.default.audio.duration/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=isNaN(t)?"00":t,e.minutes=isNaN(a)?"00":a,e.hours=isNaN(l)?"00":l.toString(),e}function a(){return u.default.audio.currentTime/u.default.audio.duration*100}function l(e){u.default.active_metadata.live||isFinite(e)&&(u.default.audio.currentTime=e)}return{computeCurrentTimes:e,computeSongDuration:t,computeSongCompletionPercentage:a,setCurrentTime:l}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=document.getElementsByClassName("amplitude-buffered-progress"),t=0;t0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",k.default.handle),a[l].addEventListener("change",k.default.handle)):(a[l].removeEventListener("input",k.default.handle),a[l].addEventListener("input",k.default.handle))}function x(){for(var e=window.navigator.userAgent,t=e.indexOf("MSIE "),a=document.getElementsByClassName("amplitude-volume-slider"),l=0;l0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",O.default.handle),a[l].addEventListener("change",O.default.handle)):(a[l].removeEventListener("input",O.default.handle),a[l].addEventListener("input",O.default.handle))}function P(){for(var e=document.getElementsByClassName("amplitude-next"),t=0;t=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}d.default.sync()}return{handle:e}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(8),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e&&t(),null!=e&&a(e)}}function t(){d.default.setRepeat(!n.default.repeat),o.default.syncRepeat()}function a(e){d.default.setRepeatPlaylist(!n.default.playlists[e].repeat,e),o.default.syncRepeatPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(8),o=l(s),f=function(){function e(){n.default.is_touch_moving||(d.default.setRepeatSong(!n.default.repeat_song),o.default.syncRepeatSong())}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(13),d=l(i),s=a(19),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e?t():a(e)}}function t(){d.default.toggleShuffle(),o.default.syncMain(n.default.shuffle_on)}function a(e){d.default.toggleShufflePlaylist(e),o.default.syncPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(3),o=l(s),f=a(5),r=l(f),c=a(1),p=l(c),v=a(2),y=l(v),g=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist"),l=this.getAttribute("data-amplitude-song-index"),u=this.getAttribute("data-amplitude-location");null==u&&d.default.writeMessage("You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element."),null==l&&d.default.writeMessage("You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element."),null!=u&&null!=l&&(null==e?t(parseInt(l),parseInt(u)):a(e,parseInt(l),parseInt(u)))}}function t(e,t){o.default.changeSong(n.default.songs[e],e),p.default.play(),y.default.syncGlobal(),y.default.syncSong(),p.default.skipToLocation(t)}function a(e,t,a){r.default.newPlaylist(e)&&o.default.setActivePlaylist(e),o.default.changeSongPlaylist(e,n.default.playlists[e].songs[t],t),p.default.play(),y.default.syncGlobal(),y.default.syncPlaylist(),y.default.syncSong(),p.default.skipToLocation(a)}return{handle:e}}();t.default=g,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(23),d=l(i),s=a(14),o=l(s),f=function(){function e(){var e=this.value,i=n.default.audio.duration*(e/100),d=this.getAttribute("data-amplitude-playlist"),s=this.getAttribute("data-amplitude-song-index");null==d&&null==s&&t(i,e),null!=d&&null==s&&a(i,e,d),null==d&&null!=s&&l(i,e,s),null!=d&&null!=s&&u(i,e,d,s)}function t(e,t){n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,n.default.active_index))}function a(e,t,a){n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,n.default.active_index)))}function l(e,t,a){n.default.active_index==a&&null==n.default.active_playlist&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,a)))}function u(e,t,a,l){n.default.playlists[a].active_index==l&&n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,l)))}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(6),d=(l(i),a(2)),s=l(d),o=a(1),f=l(o),r=function(){function e(){n.default.is_touch_moving||(s.default.syncToPause(),f.default.stop())}return{handle:e}}();t.default=r,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(24),d=l(i),s=a(15),o=l(s),f=a(14),r=l(f),c=a(20),p=l(c),v=a(23),y=l(v),g=a(9),m=(l(g),function(){function e(){t(),d.default.sync(),a(),l()}function t(){if(n.default.audio.buffered.length-1>=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}}function a(){if(!n.default.active_metadata.live){var e=y.default.computeCurrentTimes(),t=y.default.computeSongCompletionPercentage(),a=y.default.computeSongDuration();o.default.syncCurrentTimes(e),r.default.sync(t,n.default.active_playlist,n.default.active_index),p.default.sync(t),o.default.syncDurationTimes(e,a)}}function l(){var e=Math.floor(n.default.audio.currentTime);if(void 0!=n.default.active_metadata.time_callbacks&&void 0!=n.default.active_metadata.time_callbacks[e])n.default.active_metadata.time_callbacks[e].run||(n.default.active_metadata.time_callbacks[e].run=!0,n.default.active_metadata.time_callbacks[e]());else for(var t in n.default.active_metadata.time_callbacks)n.default.active_metadata.time_callbacks.hasOwnProperty(t)&&(n.default.active_metadata.time_callbacks[t].run=!1)}return{handle:e}}());t.default=m,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume-n.default.volume_increment>0?n.default.volume-n.default.volume_increment:0,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){d.default.setVolume(this.value),o.default.setMuted(0==n.default.volume),r.default.sync()}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume+n.default.volume_increment<=100?n.default.volume+n.default.volume_increment:100,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;e?(u.default.context=new e,u.default.analyser=u.default.context.createAnalyser(),u.default.audio.crossOrigin="anonymous",u.default.source=u.default.context.createMediaElementSource(u.default.audio),u.default.source.connect(u.default.analyser),u.default.analyser.connect(u.default.context.destination)):AmplitudeHelpers.writeDebugMessage("Web Audio API is unavailable! We will set any of your visualizations with your back up definition!")}function t(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;return u.default.web_audio_api_available=!1,e?(u.default.web_audio_api_available=!0,!0):(u.default.web_audio_api_available=!1,!1)}function a(){var e=document.querySelectorAll(".amplitude-wave-form"),t=document.querySelectorAll(".amplitude-visualization");return e.length>0||t.length>0}return{configureWebAudioAPI:e,webAudioAPIAvailable:t,determineUsingAnyFX:a}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(21),n=l(u),i=a(0),d=l(i),s=a(1),o=l(s),f=a(13),r=l(f),c=a(6),p=(l(c),a(3)),v=l(p),y=a(12),g=l(y),m=a(5),_=l(m),h=a(16),b=l(h),A=a(19),x=l(A),M=a(8),P=l(M),S=a(14),L=l(S),w=a(20),E=l(w),k=a(15),T=l(k),O=a(2),C=l(O),N=a(7),j=l(N),I=a(18),q=l(I),z=a(4),H=l(z),B=a(17),D=l(B),R=function(){function e(e){n.default.initialize(e)}function t(){return d.default}function a(){n.default.rebindDisplay()}function l(){return d.default.active_playlist}function u(){return d.default.playback_speed}function i(e){o.default.setPlaybackSpeed(e),q.default.sync()}function s(){return d.default.repeat}function f(e){return d.default.playlists[e].repeat}function c(){return d.default.shuffle_on}function p(e){return d.default.playlists[e].shuffle}function y(e){r.default.setShuffle(e),x.default.syncMain()}function m(e,t){r.default.setShufflePlaylist(e,t),x.default.syncMain(),x.default.syncPlaylist(e)}function h(e){g.default.setRepeat(e),P.default.syncRepeat()}function A(e,t){g.default.setRepeatPlaylist(t,e),P.default.syncRepeatPlaylist(e)}function M(e){d.default.is_touch_moving||(g.default.setRepeatSong(!d.default.repeat_song),P.default.syncRepeatSong())}function S(){return d.default.default_album_art}function w(){return d.default.default_playlist_art}function k(e){d.default.default_album_art=e}function O(e){d.default.default_plalist_art=e}function N(){return d.default.audio.currentTime/d.default.audio.duration*100}function I(){return d.default.audio.currentTime}function z(){return d.default.audio.duration}function B(e){"number"==typeof e&&e>0&&e<100&&(d.default.audio.currentTime=d.default.audio.duration*(e/100))}function R(e){d.default.debug=e}function V(){return d.default.active_metadata}function U(){return d.default.playlists[d.default.active_playlist]}function F(e){return d.default.songs[e]}function W(e,t){return d.default.playlists[e].songs[t]}function G(e){return void 0==d.default.songs&&(d.default.songs=[]),d.default.songs.push(e),d.default.shuffle_on&&d.default.shuffle_list.push(e),D.default.isSoundCloudURL(e.url)&&D.default.resolveIndividualStreamableURL(e.url,null,d.default.songs.length-1,d.default.shuffle_on),d.default.songs.length-1}function Y(e){return void 0==d.default.songs&&(d.default.songs=[]),d.default.songs.unshift(e),d.default.shuffle_on&&d.default.shuffle_list.unshift(e),D.default.isSoundCloudURL(e.url)&&D.default.resolveIndividualStreamableURL(e.url,null,d.default.songs.length-1,d.default.shuffle_on),0}function X(e,t){return void 0!=d.default.playlists[t]?(d.default.playlists[t].songs.push(e),d.default.playlists[t].shuffle&&d.default.playlists[t].shuffle_list.push(e),D.default.isSoundCloudURL(e.url)&&D.default.resolveIndividualStreamableURL(e.url,t,d.default.playlists[t].songs.length-1,d.default.playlists[t].shuffle),d.default.playlists[t].songs.length-1):(H.default.writeMessage("Playlist doesn't exist!"),null)}function J(e,t,a){if(void 0==d.default.playlists[e]){d.default.playlists[e]={};var l=["repeat","shuffle","shuffle_list","songs","src"];for(var u in t)l.indexOf(u)<0&&(d.default.playlists[e][u]=t[u]);return d.default.playlists[e].songs=a,d.default.playlists[e].active_index=null,d.default.playlists[e].repeat=!1,d.default.playlists[e].shuffle=!1,d.default.playlists[e].shuffle_list=[],d.default.playlists[e]}return H.default.writeMessage("A playlist already exists with that key!"),null}function $(e){d.default.songs.splice(e,1)}function Q(e,t){void 0!=d.default.playlists[t]&&d.default.playlists[t].songs.splice(e,1)}function K(e){e.url?(d.default.audio.src=e.url,d.default.active_metadata=e,d.default.active_album=e.album):H.default.writeMessage("The song needs to have a URL!"),o.default.play(),C.default.sync(),j.default.displayMetaData(),L.default.resetElements(),E.default.resetElements(),T.default.resetCurrentTimes(),T.default.resetDurationTimes()}function Z(e){o.default.stop(),_.default.newPlaylist(null)&&(v.default.setActivePlaylist(null),v.default.changeSong(d.default.songs[e],e)),_.default.newSong(null,e)&&v.default.changeSong(d.default.songs[e],e),o.default.play(),C.default.sync()}function ee(e,t){o.default.stop(),_.default.newPlaylist(t)&&(v.default.setActivePlaylist(t),v.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e)),_.default.newSong(t,e)&&v.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e),C.default.sync(),o.default.play()}function te(){o.default.play()}function ae(){o.default.pause()}function le(){o.default.stop()}function ue(){return d.default.audio}function ne(){return d.default.analyser}function ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?v.default.setNext():v.default.setNextPlaylist(d.default.active_playlist):v.default.setNextPlaylist(e)}function de(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?v.default.setPrevious():v.default.setPreviousPlaylist(d.default.active_playlist):v.default.setPreviousPlaylist(e)}function se(){return d.default.songs}function oe(e){return d.default.playlists[e].songs}function fe(){return d.default.shuffle_on?d.default.shuffle_list:d.default.songs}function re(e){return d.default.playlists[e].shuffle?d.default.playlists[e].shuffle_list:d.default.playlists[e].songs}function ce(){return parseInt(d.default.active_index)}function pe(){return d.default.version}function ve(){return d.default.buffered}function ye(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e=parseInt(e),null!=a?(_.default.newPlaylist(a)&&v.default.setActivePlaylist(a),v.default.changeSongPlaylist(a,d.default.playlists[a].songs[t],t),o.default.play(),C.default.syncGlobal(),C.default.syncPlaylist(),C.default.syncSong(),o.default.skipToLocation(e)):(v.default.changeSong(d.default.songs[t],t),o.default.play(),C.default.syncGlobal(),C.default.syncSong(),o.default.skipToLocation(e))}function ge(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(""!=a&&null!=a&&void 0!=d.default.playlists[a])for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.playlists[a].songs[e][l]=t[l]);else for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.songs[e][l]=t[l]);j.default.displayMetaData(),j.default.syncMetaData()}function me(e,t){if(void 0!=d.default.playlists[e]){var a=["repeat","shuffle","shuffle_list","songs","src"];for(var l in t)t.hasOwnProperty(l)&&a.indexOf(l)<0&&(d.default.playlists[e][l]=t[l]);j.default.displayPlaylistMetaData()}else H.default.writeMessage("You must provide a valid playlist key!")}function _e(e){d.default.delay=e}function he(){return d.default.delay}function be(){return d.default.player_state}function Ae(e,t){b.default.register(e,t)}function xe(e,t){void 0!=d.default.playlists[e]?void 0!=d.default.visualizations.available[t]?d.default.playlists[e].visualization=t:H.default.writeMessage("A visualization does not exist for the key provided."):H.default.writeMessage("The playlist for the key provided does not exist")}function Me(e,t){d.default.songs[e]?void 0!=d.default.visualizations.available[t]?d.default.songs[e].visualization=t:H.default.writeMessage("A visualization does not exist for the key provided."):H.default.writeMessage("A song at that index is undefined")}function Pe(e,t,a){void 0!=d.default.playlists[e].songs[t]?void 0!=d.default.visualizations.available[a]?d.default.playlists[e].songs[t].visualization=a:H.default.writeMessage("A visualization does not exist for the key provided."):H.default.writeMessage("The song in the playlist at that key is not defined")}function Se(e){void 0!=d.default.visualizations.available[e]?d.default.visualization=e:H.default.writeMessage("A visualization does not exist for the key provided.")}function Le(e){o.default.setVolume(e)}function we(){return d.default.volume}return{init:e,getConfig:t,bindNewElements:a,getActivePlaylist:l,getPlaybackSpeed:u,setPlaybackSpeed:i,getRepeat:s,getRepeatPlaylist:f,getShuffle:c,getShufflePlaylist:p,setShuffle:y,setShufflePlaylist:m,setRepeat:h,setRepeatSong:M,setRepeatPlaylist:A,getDefaultAlbumArt:S,setDefaultAlbumArt:k,getDefaultPlaylistArt:w,setDefaultPlaylistArt:O,getSongPlayedPercentage:N,setSongPlayedPercentage:B,getSongPlayedSeconds:I,getSongDuration:z,setDebug:R,getActiveSongMetadata:V,getActivePlaylistMetadata:U,getSongAtIndex:F,getSongAtPlaylistIndex:W,addSong:G,prependSong:Y,addSongToPlaylist:X,removeSong:$,removeSongFromPlaylist:Q,playNow:K,playSongAtIndex:Z,playPlaylistSongAtIndex:ee,play:te,pause:ae,stop:le,getAudio:ue,getAnalyser:ne,next:ie,prev:de,getSongs:se,getSongsInPlaylist:oe,getSongsState:fe,getSongsStatePlaylist:re,getActiveIndex:ce,getVersion:pe,getBuffered:ve,skipTo:ye,setSongMetaData:ge,setPlaylistMetaData:me,setDelay:_e,getDelay:he,getPlayerState:be,addPlaylist:J,registerVisualization:Ae,setPlaylistVisualization:xe,setSongVisualization:Me,setSongInPlaylistVisualization:Pe,setGlobalVisualization:Se,getVolume:we,setVolume:Le}}();t.default=R,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(5),o=l(s),f=a(7),r=l(f),c=a(17),p=l(c),v=function(){function e(e){n.default.playlists=e,a(),l(),t(),u(),i(),s(),f()}function t(){for(var e in n.default.playlists)n.default.playlists[e].active_index=null}function a(){for(var e in n.default.playlists)if(n.default.playlists.hasOwnProperty(e)&&n.default.playlists[e].songs)for(var t=0;t0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(l=e.hours+":"+l);for(var n=0;n0&&(a=i+":"+a)}return a}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){t(e),a(e),l(e),n(e)}function t(e){for(var t=document.querySelectorAll(".amplitude-duration-hours"),a=0;a0&&(t=e.hours+":"+t)),t}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t){e.exports={name:"amplitudejs",version:"5.3.1",description:"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs",main:"dist/amplitude.js",devDependencies:{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0",husky:"^1.3.1",jest:"^23.6.0",prettier:"1.15.1","pretty-quick":"^1.11.1",watch:"^1.0.2",webpack:"^2.7.0"},directories:{doc:"docs"},files:["dist"],funding:{type:"opencollective",url:"https://opencollective.com/amplitudejs"},scripts:{build:"node_modules/.bin/webpack",prettier:"npx pretty-quick",preversion:"npx pretty-quick && npm run test",postversion:"git push && git push --tags",test:"jest",version:"npm run build && git add -A dist"},repository:{type:"git",url:"git+https://github.com/521dimensions/amplitudejs.git"},keywords:["webaudio","html5","javascript","audio-player"],author:"521 Dimensions (https://521dimensions.com)",license:"MIT",bugs:{url:"https://github.com/521dimensions/amplitudejs/issues"},homepage:"https://github.com/521dimensions/amplitudejs#readme"}}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Amplitude",[],t):"object"==typeof exports?exports.Amplitude=t():e.Amplitude=t()}(this,function(){return function(e){function t(l){if(a[l])return a[l].exports;var u=a[l]={i:l,l:!1,exports:{}};return e[l].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var a={};return t.m=e,t.c=a,t.i=function(e){return e},t.d=function(e,a,l){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=47)}([function(e,t,a){"use strict";var l=a(59);e.exports={version:l.version,audio:new Audio,active_metadata:{},active_album:"",active_index:0,active_playlist:null,playback_speed:1,callbacks:{},songs:[],playlists:{},start_song:"",starting_playlist:"",starting_playlist_song:"",repeat:!1,repeat_song:!1,shuffle_list:{},shuffle_on:!1,default_album_art:"",default_playlist_art:"",debug:!1,volume:.5,pre_mute_volume:.5,volume_increment:5,volume_decrement:5,soundcloud_client:"",soundcloud_use_art:!1,soundcloud_song_count:0,soundcloud_songs_ready:0,is_touch_moving:!1,buffered:0,bindings:{},continue_next:!0,delay:0,player_state:"stopped",web_audio_api_available:!1,context:null,source:null,analyser:null,visualizations:{available:[],active:[],backup:""},waveforms:{sample_rate:100,built:[]}}},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(5),d=(l(i),a(3)),s=(l(d),a(2)),o=(l(s),a(7)),f=(l(o),a(9)),r=l(f),c=a(4),p=l(c),v=a(16),y=l(v),g=a(6),m=l(g),_=function(){function e(){y.default.stop(),y.default.run(),n.default.active_metadata.live&&s(),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&!n.default.paused&&s();var e=n.default.audio.play();void 0!==e&&e.then(function(e){}).catch(function(e){}),n.default.audio.play(),n.default.audio.playbackRate=n.default.playback_speed,m.default.setPlayerState()}function t(){y.default.stop(),n.default.audio.pause(),n.default.paused=!0,n.default.active_metadata.live&&d(),m.default.setPlayerState()}function a(){y.default.stop(),0!=n.default.audio.currentTime&&(n.default.audio.currentTime=0),n.default.audio.pause(),n.default.active_metadata.live&&d(),m.default.setPlayerState(),r.default.run("stop")}function l(e){n.default.audio.muted=0==e,n.default.volume=e,n.default.audio.volume=e/100}function u(e){n.default.active_metadata.live||(n.default.audio.currentTime=n.default.audio.duration*(e/100))}function i(e){n.default.audio.addEventListener("canplaythrough",function(){n.default.audio.duration>=e&&e>0?n.default.audio.currentTime=e:p.default.writeMessage("Amplitude can't skip to a location greater than the duration of the audio or less than 0")},{once:!0})}function d(){n.default.audio.src="",n.default.audio.load()}function s(){n.default.audio.src=n.default.active_metadata.url,n.default.audio.load()}function o(e){n.default.playback_speed=e,n.default.audio.playbackRate=n.default.playback_speed}return{play:e,pause:t,stop:a,setVolume:l,setSongLocation:u,skipToLocation:i,disconnectStream:d,reconnectStream:s,setPlaybackSpeed:o}}();t.default=_,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=u.default.audio.paused?"paused":"playing",t=document.querySelectorAll(".amplitude-play-pause"),a=0;a0&&void 0!==arguments[0]&&arguments[0],t=null,a={},l=!1;n.default.repeat_song?n.default.shuffle_on?(t=n.default.shuffle_list[n.default.active_index].index,a=n.default.shuffle_list[t]):(t=n.default.active_index,a=n.default.songs[t]):n.default.shuffle_on?(parseInt(n.default.active_index)+11&&void 0!==arguments[1]&&arguments[1],a=null,l={},u=!1;n.default.repeat_song?n.default.playlists[e].shuffle?(a=n.default.playlists[e].active_index,l=n.default.playlists[e].shuffle_list[a]):(a=n.default.playlists[e].active_index,l=n.default.playlists[e].songs[a]):n.default.playlists[e].shuffle?(parseInt(n.default.playlists[e].active_index)+1=0?parseInt(n.default.active_index-1):parseInt(n.default.songs.length-1),t=n.default.shuffle_on?n.default.shuffle_list[e]:n.default.songs[e]),u(t,e),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function l(e){var t=null,a={};n.default.repeat_song?n.default.playlists[e].shuffle?(t=n.default.playlists[e].active_index,a=n.default.playlists[e].shuffle_list[t]):(t=n.default.playlists[e].active_index,a=n.default.playlists[e].songs[t]):(t=parseInt(n.default.playlists[e].active_index)-1>=0?parseInt(n.default.playlists[e].active_index-1):parseInt(n.default.playlists[e].songs.length-1),a=n.default.playlists[e].shuffle?n.default.playlists[e].shuffle_list[t]:n.default.playlists[e].songs[t]),c(e),i(e,a,t),d.default.play(),p.default.sync(),o.default.run("prev"),n.default.repeat_song&&o.default.run("song_repeated")}function u(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];s(e),n.default.audio.src=e.url,n.default.active_metadata=e,n.default.active_album=e.album,n.default.active_index=parseInt(t),f(a)}function i(e,t,a){var l=arguments.length>3&&void 0!==arguments[3]&&arguments[3];s(t),n.default.audio.src=t.url,n.default.active_metadata=t,n.default.active_album=t.album,n.default.active_index=null,n.default.playlists[e].active_index=parseInt(a),f(l)}function s(e){d.default.stop(),p.default.syncToPause(),y.default.resetElements(),m.default.resetElements(),h.default.resetCurrentTimes(),r.default.newAlbum(e)&&o.default.run("album_change")}function f(e){A.default.displayMetaData(),M.default.setActive(e),h.default.resetDurationTimes(),o.default.run("song_change")}function c(e){n.default.active_playlist!=e&&(o.default.run("playlist_changed"),n.default.active_playlist=e,null!=e&&(n.default.playlists[e].active_index=0))}return{setNext:e,setNextPlaylist:t,setPrevious:a,setPreviousPlaylist:l,changeSong:u,changeSongPlaylist:i,setActivePlaylist:c}}();t.default=P,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){u.default.debug&&console.log(e)}return{writeMessage:e}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,t){return u.default.active_playlist!=e||(null==u.default.active_playlist&&null==e?u.default.active_index!=t:u.default.active_playlist==e&&u.default.playlists[e].active_index!=t)}function t(e){return u.default.active_album!=e}function a(e){return u.default.active_playlist!=e}function l(e){return/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(e)}function n(e){return!isNaN(e)&&parseInt(Number(e))==e&&!isNaN(parseInt(e,10))}return{newSong:e,newAlbum:t,newPlaylist:a,isURL:l,isInt:n}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){u.default.audio=new Audio,u.default.active_metadata={},u.default.active_album="",u.default.active_index=0,u.default.active_playlist=null,u.default.playback_speed=1,u.default.callbacks={},u.default.songs=[],u.default.playlists={},u.default.start_song="",u.default.starting_playlist="",u.default.starting_playlist_song="",u.default.repeat=!1,u.default.shuffle_list={},u.default.shuffle_on=!1,u.default.default_album_art="",u.default.default_playlist_art="",u.default.debug=!1,u.default.volume=.5,u.default.pre_mute_volume=.5,u.default.volume_increment=5,u.default.volume_decrement=5,u.default.soundcloud_client="",u.default.soundcloud_use_art=!1,u.default.soundcloud_song_count=0,u.default.soundcloud_songs_ready=0,u.default.continue_next=!0}function t(){u.default.audio.paused&&0==u.default.audio.currentTime&&(u.default.player_state="stopped"),u.default.audio.paused&&u.default.audio.currentTime>0&&(u.default.player_state="paused"),u.default.audio.paused||(u.default.player_state="playing")}return{resetConfig:e,setPlayerState:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],t=document.querySelectorAll("[data-amplitude-song-info]"),a=0;a=0?(d=d||u.default.default_album_art,t[a].setAttribute("src",d)):(d=d||"",t[a].innerHTML=d)}}}function t(){for(var e=["image_url"],t=document.querySelectorAll("[data-amplitude-playlist-info]"),a=0;a=0?t[a].setAttribute("src",u.default.playlists[n][l]):t[a].innerHTML=u.default.playlists[n][l]:e.indexOf(l)>=0?""!=u.default.default_playlist_art?t[a].setAttribute("src",u.default.default_playlist_art):t[a].setAttribute("src",""):t[a].innerHTML=""}}function a(e,t){for(var a=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],l=document.querySelectorAll('[data-amplitude-song-info][data-amplitude-playlist="'+t+'"]'),u=0;u=0?l[u].setAttribute("src",e[n]):l[u].innerHTML=e[n]:a.indexOf(n)>=0?""!=e.default_album_art?l[u].setAttribute("src",e.default_album_art):l[u].setAttribute("src",""):l[u].innerHTML="")}}function l(){for(var e=["cover_art_url","station_art_url","podcast_episode_cover_art_url"],a=document.querySelectorAll("[data-amplitude-song-info]"),l=0;l=0?(s=s||u.default.default_album_art,a[l].setAttribute("src",s)):a[l].innerHTML=s}if(null!=n&&null!=i){var o=a[l].getAttribute("data-amplitude-song-info");void 0!=u.default.playlists[i].songs[n][o]&&(e.indexOf(o)>=0?a[l].setAttribute("src",u.default.playlists[i].songs[n][o]):a[l].innerHTML=u.default.playlists[i].songs[n][o])}}t()}return{displayMetaData:e,setFirstSongInPlaylist:a,syncMetaData:l,displayPlaylistMetaData:t}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-repeat"),t=0;t0;a--){d(e,a,Math.floor(Math.random()*u.default.songs.length+1)-1)}u.default.shuffle_list=e}function i(e){for(var t=new Array(u.default.playlists[e].songs.length),a=0;a0;l--){d(t,l,Math.floor(Math.random()*u.default.playlists[e].songs.length+1)-1)}u.default.playlists[e].shuffle_list=t}function d(e,t,a){var l=e[t];e[t]=e[a],e[a]=l}return{setShuffle:e,toggleShuffle:t,setShufflePlaylist:a,toggleShufflePlaylist:l,shuffleSongs:n,shufflePlaylistSongs:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e,u,i){t(e),a(e,u),l(e,i),n(e,u)}function t(e){e=isNaN(e)?0:e;for(var t=document.querySelectorAll(".amplitude-song-slider"),a=0;a0&&e.length>0)for(var i=0;i0?Object.keys(n.default.visualizations.available)[0]:null;null!=l&&i(l,e)}}function a(e,t){if(t==n.default.active_playlist){var a=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,l=n.default.playlists[n.default.active_playlist].visualization,u=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else{var d=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=d&&i(d,e)}}}function l(e,t){if(t==n.default.active_index){var a=n.default.songs[n.default.active_index].visualization,l=n.default.visualization;if(void 0!=a&&void 0!=n.default.visualizations.available[a])i(a,e);else if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else{var u=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=u&&i(u,e)}}}function u(e,t,a){if(t==n.default.active_playlist&&n.default.playlists[t].active_index==a){var l=n.default.playlists[n.default.active_playlist].songs[n.default.playlists[n.default.active_playlist].active_index].visualization,u=n.default.playlists[n.default.active_playlist].visualization,d=n.default.visualization;if(void 0!=l&&void 0!=n.default.visualizations.available[l])i(l,e);else if(void 0!=u&&void 0!=n.default.visualizations.available[u])i(u,e);else if(void 0!=d&&void 0!=n.default.visualizations.available[d])i(d,e);else{var s=Object.keys(n.default.visualizations.available).length>0?Object.keys(n.default.visualizations.available)[0]:null;null!=s&&i(s,e)}}}function i(e,t){var a=new n.default.visualizations.available[e].object;a.setPreferences(n.default.visualizations.available[e].preferences),a.startVisualization(t),n.default.visualizations.active.push(a)}function d(){for(var e=0;e0)for(var t=0;t3&&void 0!==arguments[3]&&arguments[3];SC.get("/resolve/?url="+e,function(e){e.streamable?null!=t?(n.default.playlists[t].songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.playlists[t].shuffle_list[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.playlists[t].songs[a].cover_art_url=e.artwork_url,l&&(n.default.playlists[t].shuffle_list[a].cover_art_url=e.artwork_url)),n.default.playlists[t].songs[a].soundcloud_data=e,l&&(n.default.playlists[t].shuffle_list[a].soundcloud_data=e)):(n.default.songs[a].url=e.stream_url+"?client_id="+n.default.soundcloud_client,l&&(n.default.shuffle_list[a].stream_url,n.default.soundcloud_client),n.default.soundcloud_use_art&&(n.default.songs[a].cover_art_url=e.artwork_url,l&&(n.default.shuffle_list[a].cover_art_url=e.artwork_url)),n.default.songs[a].soundcloud_data=e,l&&(n.default.shuffle_list[a].soundcloud_data=e)):null!=t?AmplitudeHelpers.writeDebugMessage(n.default.playlists[t].songs[a].name+" by "+n.default.playlists[t].songs[a].artist+" is not streamable by the Soundcloud API"):AmplitudeHelpers.writeDebugMessage(n.default.songs[a].name+" by "+n.default.songs[a].artist+" is not streamable by the Soundcloud API")})}function u(e,t){SC.get("/resolve/?url="+e,function(e){e.streamable?(n.default.songs[t].url=e.stream_url+"?client_id="+n.default.soundcloud_client,n.default.soundcloud_use_art&&(n.default.songs[t].cover_art_url=e.artwork_url),n.default.songs[t].soundcloud_data=e):AmplitudeHelpers.writeDebugMessage(n.default.songs[t].name+" by "+n.default.songs[t].artist+" is not streamable by the Soundcloud API"),++n.default.soundcloud_songs_ready==n.default.soundcloud_song_count&&d.default.setConfig(s)})}function i(e){var t=/^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/;return e.match(t)}var s={};return{loadSoundCloud:e,resolveIndividualStreamableURL:l,isSoundCloudURL:i}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){for(var e=document.getElementsByClassName("amplitude-playback-speed"),t=0;t0))for(var u=0;u0&&C.default.initialize(e.playlists),void 0==e.start_song||e.starting_playlist?E.default.changeSong(i.default.songs[0],0):g.default.isInt(e.start_song)?E.default.changeSong(i.default.songs[e.start_song],e.start_song):v.default.writeMessage("You must enter an integer index for the start song."),void 0!=e.shuffle_on&&e.shuffle_on&&(i.default.shuffle_on=!0,_.default.shuffleSongs(),E.default.changeSong(i.default.shuffle_list[0],0)),i.default.continue_next=void 0==e.continue_next||e.continue_next,i.default.playback_speed=void 0!=e.playback_speed?e.playback_speed:1,s.default.setPlaybackSpeed(i.default.playback_speed),i.default.audio.preload=void 0!=e.preload?e.preload:"auto",i.default.callbacks=void 0!=e.callbacks?e.callbacks:{},i.default.bindings=void 0!=e.bindings?e.bindings:{},i.default.volume=void 0!=e.volume?e.volume:50,i.default.delay=void 0!=e.delay?e.delay:0,i.default.volume_increment=void 0!=e.volume_increment?e.volume_increment:5,i.default.volume_decrement=void 0!=e.volume_decrement?e.volume_decrement:5,s.default.setVolume(i.default.volume),l(e),n(),void 0!=e.starting_playlist&&""!=e.starting_playlist&&(i.default.active_playlist=e.starting_playlist,void 0!=e.starting_playlist_song&&""!=e.starting_playlist_song?void 0!=u(e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)])?E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[parseInt(e.starting_playlist_song)],parseInt(e.starting_playlist_song)):(E.default.changeSongPlaylist(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),v.default.writeMessage("The index of "+e.starting_playlist_song+" does not exist in the playlist "+e.starting_playlist)):E.default.changeSong(i.default.active_playlist,e.playlists[e.starting_playlist].songs[0],0),V.default.sync()),T.default.run("initialized")}function l(e){void 0!=e.default_album_art?i.default.default_album_art=e.default_album_art:i.default.default_album_art="",void 0!=e.default_playlist_art?i.default.default_playlist_art=e.default_playlist_art:i.default.default_playlist_art=""}function n(){j.default.syncMain(),q.default.setMuted(0==i.default.volume),H.default.sync(),G.default.sync(),D.default.resetCurrentTimes(),V.default.syncToPause(),F.default.syncMetaData(),X.default.syncRepeatSong()}function d(e){var t=0,a=void 0;for(a in e)e.hasOwnProperty(a)&&t++;return v.default.writeMessage("You have "+t+" playlist(s) in your config"),t}function o(){for(var e=0;e0)for(var t=0;tp&&(p=y),yn[2*o])&&(n[2*o]=p),(0===i||c0}var r="",c="",p="";return{init:e,build:t,determineIfUsingWaveforms:f}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e={},t=(Math.floor(u.default.audio.currentTime%60)<10?"0":"")+Math.floor(u.default.audio.currentTime%60),a=Math.floor(u.default.audio.currentTime/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=t,e.minutes=a,e.hours=l,e}function t(){var e={},t=(Math.floor(u.default.audio.duration%60)<10?"0":"")+Math.floor(u.default.audio.duration%60),a=Math.floor(u.default.audio.duration/60),l="00";return a<10&&(a="0"+a),a>=60&&(l=Math.floor(a/60),(a%=60)<10&&(a="0"+a)),e.seconds=isNaN(t)?"00":t,e.minutes=isNaN(a)?"00":a,e.hours=isNaN(l)?"00":l.toString(),e}function a(){return u.default.audio.currentTime/u.default.audio.duration*100}function l(e){u.default.active_metadata.live||isFinite(e)&&(u.default.audio.currentTime=e)}return{computeCurrentTimes:e,computeSongDuration:t,computeSongCompletionPercentage:a,setCurrentTime:l}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){t(),a(),l(),n()}function t(){for(var e=document.getElementsByClassName("amplitude-buffered-progress"),t=0;t0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",k.default.handle),a[l].addEventListener("change",k.default.handle)):(a[l].removeEventListener("input",k.default.handle),a[l].addEventListener("input",k.default.handle))}function x(){for(var e=window.navigator.userAgent,t=e.indexOf("MSIE "),a=document.getElementsByClassName("amplitude-volume-slider"),l=0;l0||navigator.userAgent.match(/Trident.*rv\:11\./)?(a[l].removeEventListener("change",O.default.handle),a[l].addEventListener("change",O.default.handle)):(a[l].removeEventListener("input",O.default.handle),a[l].addEventListener("input",O.default.handle))}function P(){for(var e=document.getElementsByClassName("amplitude-next"),t=0;t=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}d.default.sync()}return{handle:e}}();t.default=s,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(8),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e&&t(),null!=e&&a(e)}}function t(){d.default.setRepeat(!n.default.repeat),o.default.syncRepeat()}function a(e){d.default.setRepeatPlaylist(!n.default.playlists[e].repeat,e),o.default.syncRepeatPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(12),d=l(i),s=a(8),o=l(s),f=function(){function e(){n.default.is_touch_moving||(d.default.setRepeatSong(!n.default.repeat_song),o.default.syncRepeatSong())}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(13),d=l(i),s=a(19),o=l(s),f=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist");null==e?t():a(e)}}function t(){d.default.toggleShuffle(),o.default.syncMain(n.default.shuffle_on)}function a(e){d.default.toggleShufflePlaylist(e),o.default.syncPlaylist(e)}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(3),o=l(s),f=a(5),r=l(f),c=a(1),p=l(c),v=a(2),y=l(v),g=function(){function e(){if(!n.default.is_touch_moving){var e=this.getAttribute("data-amplitude-playlist"),l=this.getAttribute("data-amplitude-song-index"),u=this.getAttribute("data-amplitude-location");null==u&&d.default.writeMessage("You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element."),null==l&&d.default.writeMessage("You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element."),null!=u&&null!=l&&(null==e?t(parseInt(l),parseInt(u)):a(e,parseInt(l),parseInt(u)))}}function t(e,t){o.default.changeSong(n.default.songs[e],e),p.default.play(),y.default.syncGlobal(),y.default.syncSong(),p.default.skipToLocation(t)}function a(e,t,a){r.default.newPlaylist(e)&&o.default.setActivePlaylist(e),o.default.changeSongPlaylist(e,n.default.playlists[e].songs[t],t),p.default.play(),y.default.syncGlobal(),y.default.syncPlaylist(),y.default.syncSong(),p.default.skipToLocation(a)}return{handle:e}}();t.default=g,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(23),d=l(i),s=a(14),o=l(s),f=function(){function e(){var e=this.value,i=n.default.audio.duration*(e/100),d=this.getAttribute("data-amplitude-playlist"),s=this.getAttribute("data-amplitude-song-index");null==d&&null==s&&t(i,e),null!=d&&null==s&&a(i,e,d),null==d&&null!=s&&l(i,e,s),null!=d&&null!=s&&u(i,e,d,s)}function t(e,t){n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,n.default.active_index))}function a(e,t,a){n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,n.default.active_index)))}function l(e,t,a){n.default.active_index==a&&null==n.default.active_playlist&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,n.default.active_playlist,a)))}function u(e,t,a,l){n.default.playlists[a].active_index==l&&n.default.active_playlist==a&&(n.default.active_metadata.live||(d.default.setCurrentTime(e),o.default.sync(t,a,l)))}return{handle:e}}();t.default=f,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(6),d=(l(i),a(2)),s=l(d),o=a(1),f=l(o),r=function(){function e(){n.default.is_touch_moving||(s.default.syncToPause(),f.default.stop())}return{handle:e}}();t.default=r,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(24),d=l(i),s=a(15),o=l(s),f=a(14),r=l(f),c=a(20),p=l(c),v=a(23),y=l(v),g=a(9),m=(l(g),function(){function e(){t(),d.default.sync(),a(),l()}function t(){if(n.default.audio.buffered.length-1>=0){var e=n.default.audio.buffered.end(n.default.audio.buffered.length-1),t=n.default.audio.duration;n.default.buffered=e/t*100}}function a(){if(!n.default.active_metadata.live){var e=y.default.computeCurrentTimes(),t=y.default.computeSongCompletionPercentage(),a=y.default.computeSongDuration();o.default.syncCurrentTimes(e),r.default.sync(t,n.default.active_playlist,n.default.active_index),p.default.sync(t),o.default.syncDurationTimes(e,a)}}function l(){var e=Math.floor(n.default.audio.currentTime);if(void 0!=n.default.active_metadata.time_callbacks&&void 0!=n.default.active_metadata.time_callbacks[e])n.default.active_metadata.time_callbacks[e].run||(n.default.active_metadata.time_callbacks[e].run=!0,n.default.active_metadata.time_callbacks[e]());else for(var t in n.default.active_metadata.time_callbacks)n.default.active_metadata.time_callbacks.hasOwnProperty(t)&&(n.default.active_metadata.time_callbacks[t].run=!1)}return{handle:e}}());t.default=m,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume-n.default.volume_increment>0?n.default.volume-n.default.volume_increment:0,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){d.default.setVolume(this.value),o.default.setMuted(0==n.default.volume),r.default.sync()}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(1),d=l(i),s=a(10),o=l(s),f=a(11),r=l(f),c=function(){function e(){if(!n.default.is_touch_moving){var e=null;e=n.default.volume+n.default.volume_increment<=100?n.default.volume+n.default.volume_increment:100,d.default.setVolume(e),o.default.setMuted(0==n.default.volume),r.default.sync()}}return{handle:e}}();t.default=c,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;e?(u.default.context=new e,u.default.analyser=u.default.context.createAnalyser(),u.default.audio.crossOrigin="anonymous",u.default.source=u.default.context.createMediaElementSource(u.default.audio),u.default.source.connect(u.default.analyser),u.default.analyser.connect(u.default.context.destination)):AmplitudeHelpers.writeDebugMessage("Web Audio API is unavailable! We will set any of your visualizations with your back up definition!")}function t(){var e=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;return u.default.web_audio_api_available=!1,e?(u.default.web_audio_api_available=!0,!0):(u.default.web_audio_api_available=!1,!1)}function a(){var e=document.querySelectorAll(".amplitude-wave-form"),t=document.querySelectorAll(".amplitude-visualization");return e.length>0||t.length>0}return{configureWebAudioAPI:e,webAudioAPIAvailable:t,determineUsingAnyFX:a}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(21),n=l(u),i=a(0),d=l(i),s=a(1),o=l(s),f=a(13),r=l(f),c=a(6),p=(l(c),a(3)),v=l(p),y=a(12),g=l(y),m=a(5),_=l(m),h=a(16),b=l(h),A=a(19),x=l(A),M=a(8),P=l(M),S=a(14),L=l(S),w=a(20),E=l(w),k=a(15),T=l(k),O=a(2),C=l(O),N=a(7),j=l(N),I=a(18),q=l(I),z=a(4),H=l(z),B=a(17),D=l(B),R=function(){function e(e){n.default.initialize(e)}function t(){return d.default}function a(){n.default.rebindDisplay()}function l(){return d.default.active_playlist}function u(){return d.default.playback_speed}function i(e){o.default.setPlaybackSpeed(e),q.default.sync()}function s(){return d.default.repeat}function f(e){return d.default.playlists[e].repeat}function c(){return d.default.shuffle_on}function p(e){return d.default.playlists[e].shuffle}function y(e){r.default.setShuffle(e),x.default.syncMain()}function m(e,t){r.default.setShufflePlaylist(e,t),x.default.syncMain(),x.default.syncPlaylist(e)}function h(e){g.default.setRepeat(e),P.default.syncRepeat()}function A(e,t){g.default.setRepeatPlaylist(t,e),P.default.syncRepeatPlaylist(e)}function M(e){d.default.is_touch_moving||(g.default.setRepeatSong(!d.default.repeat_song),P.default.syncRepeatSong())}function S(){return d.default.default_album_art}function w(){return d.default.default_playlist_art}function k(e){d.default.default_album_art=e}function O(e){d.default.default_plalist_art=e}function N(){return d.default.audio.currentTime/d.default.audio.duration*100}function I(){return d.default.audio.currentTime}function z(){return d.default.audio.duration}function B(e){"number"==typeof e&&e>0&&e<100&&(d.default.audio.currentTime=d.default.audio.duration*(e/100))}function R(e){d.default.debug=e}function V(){return d.default.active_metadata}function U(){return d.default.playlists[d.default.active_playlist]}function F(e){return d.default.songs[e]}function W(e,t){return d.default.playlists[e].songs[t]}function G(e){return void 0==d.default.songs&&(d.default.songs=[]),d.default.songs.push(e),d.default.shuffle_on&&d.default.shuffle_list.push(e),D.default.isSoundCloudURL(e.url)&&D.default.resolveIndividualStreamableURL(e.url,null,d.default.songs.length-1,d.default.shuffle_on),d.default.songs.length-1}function Y(e){return void 0==d.default.songs&&(d.default.songs=[]),d.default.songs.unshift(e),d.default.shuffle_on&&d.default.shuffle_list.unshift(e),D.default.isSoundCloudURL(e.url)&&D.default.resolveIndividualStreamableURL(e.url,null,d.default.songs.length-1,d.default.shuffle_on),0}function X(e,t){return void 0!=d.default.playlists[t]?(d.default.playlists[t].songs.push(e),d.default.playlists[t].shuffle&&d.default.playlists[t].shuffle_list.push(e),D.default.isSoundCloudURL(e.url)&&D.default.resolveIndividualStreamableURL(e.url,t,d.default.playlists[t].songs.length-1,d.default.playlists[t].shuffle),d.default.playlists[t].songs.length-1):(H.default.writeMessage("Playlist doesn't exist!"),null)}function J(e,t,a){if(void 0==d.default.playlists[e]){d.default.playlists[e]={};var l=["repeat","shuffle","shuffle_list","songs","src"];for(var u in t)l.indexOf(u)<0&&(d.default.playlists[e][u]=t[u]);return d.default.playlists[e].songs=a,d.default.playlists[e].active_index=null,d.default.playlists[e].repeat=!1,d.default.playlists[e].shuffle=!1,d.default.playlists[e].shuffle_list=[],d.default.playlists[e]}return H.default.writeMessage("A playlist already exists with that key!"),null}function $(e){d.default.songs.splice(e,1)}function Q(e,t){void 0!=d.default.playlists[t]&&d.default.playlists[t].songs.splice(e,1)}function K(e){e.url?(d.default.audio.src=e.url,d.default.active_metadata=e,d.default.active_album=e.album):H.default.writeMessage("The song needs to have a URL!"),o.default.play(),C.default.sync(),j.default.displayMetaData(),L.default.resetElements(),E.default.resetElements(),T.default.resetCurrentTimes(),T.default.resetDurationTimes()}function Z(e){o.default.stop(),_.default.newPlaylist(null)&&(v.default.setActivePlaylist(null),v.default.changeSong(d.default.songs[e],e)),_.default.newSong(null,e)&&v.default.changeSong(d.default.songs[e],e),o.default.play(),C.default.sync()}function ee(e,t){o.default.stop(),_.default.newPlaylist(t)&&(v.default.setActivePlaylist(t),v.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e)),_.default.newSong(t,e)&&v.default.changeSongPlaylist(t,d.default.playlists[t].songs[e],e),C.default.sync(),o.default.play()}function te(){o.default.play()}function ae(){o.default.pause()}function le(){o.default.stop()}function ue(){return d.default.audio}function ne(){return d.default.analyser}function ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?v.default.setNext():v.default.setNextPlaylist(d.default.active_playlist):v.default.setNextPlaylist(e)}function de(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;""==e||null==e?null==d.default.active_playlist||""==d.default.active_playlist?v.default.setPrevious():v.default.setPreviousPlaylist(d.default.active_playlist):v.default.setPreviousPlaylist(e)}function se(){return d.default.songs}function oe(e){return d.default.playlists[e].songs}function fe(){return d.default.shuffle_on?d.default.shuffle_list:d.default.songs}function re(e){return d.default.playlists[e].shuffle?d.default.playlists[e].shuffle_list:d.default.playlists[e].songs}function ce(){return parseInt(d.default.active_index)}function pe(){return d.default.version}function ve(){return d.default.buffered}function ye(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e=parseInt(e),null!=a?(_.default.newPlaylist(a)&&v.default.setActivePlaylist(a),v.default.changeSongPlaylist(a,d.default.playlists[a].songs[t],t),o.default.play(),C.default.syncGlobal(),C.default.syncPlaylist(),C.default.syncSong(),o.default.skipToLocation(e)):(v.default.changeSong(d.default.songs[t],t),o.default.play(),C.default.syncGlobal(),C.default.syncSong(),o.default.skipToLocation(e))}function ge(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(""!=a&&null!=a&&void 0!=d.default.playlists[a])for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.playlists[a].songs[e][l]=t[l]);else for(var l in t)t.hasOwnProperty(l)&&"url"!=l&&"URL"!=l&&"live"!=l&&"LIVE"!=l&&(d.default.songs[e][l]=t[l]);j.default.displayMetaData(),j.default.syncMetaData()}function me(e,t){if(void 0!=d.default.playlists[e]){var a=["repeat","shuffle","shuffle_list","songs","src"];for(var l in t)t.hasOwnProperty(l)&&a.indexOf(l)<0&&(d.default.playlists[e][l]=t[l]);j.default.displayPlaylistMetaData()}else H.default.writeMessage("You must provide a valid playlist key!")}function _e(e){d.default.delay=e}function he(){return d.default.delay}function be(){return d.default.player_state}function Ae(e,t){b.default.register(e,t)}function xe(e,t){void 0!=d.default.playlists[e]?void 0!=d.default.visualizations.available[t]?d.default.playlists[e].visualization=t:H.default.writeMessage("A visualization does not exist for the key provided."):H.default.writeMessage("The playlist for the key provided does not exist")}function Me(e,t){d.default.songs[e]?void 0!=d.default.visualizations.available[t]?d.default.songs[e].visualization=t:H.default.writeMessage("A visualization does not exist for the key provided."):H.default.writeMessage("A song at that index is undefined")}function Pe(e,t,a){void 0!=d.default.playlists[e].songs[t]?void 0!=d.default.visualizations.available[a]?d.default.playlists[e].songs[t].visualization=a:H.default.writeMessage("A visualization does not exist for the key provided."):H.default.writeMessage("The song in the playlist at that key is not defined")}function Se(e){void 0!=d.default.visualizations.available[e]?d.default.visualization=e:H.default.writeMessage("A visualization does not exist for the key provided.")}function Le(e){o.default.setVolume(e)}function we(){return d.default.volume}return{init:e,getConfig:t,bindNewElements:a,getActivePlaylist:l,getPlaybackSpeed:u,setPlaybackSpeed:i,getRepeat:s,getRepeatPlaylist:f,getShuffle:c,getShufflePlaylist:p,setShuffle:y,setShufflePlaylist:m,setRepeat:h,setRepeatSong:M,setRepeatPlaylist:A,getDefaultAlbumArt:S,setDefaultAlbumArt:k,getDefaultPlaylistArt:w,setDefaultPlaylistArt:O,getSongPlayedPercentage:N,setSongPlayedPercentage:B,getSongPlayedSeconds:I,getSongDuration:z,setDebug:R,getActiveSongMetadata:V,getActivePlaylistMetadata:U,getSongAtIndex:F,getSongAtPlaylistIndex:W,addSong:G,prependSong:Y,addSongToPlaylist:X,removeSong:$,removeSongFromPlaylist:Q,playNow:K,playSongAtIndex:Z,playPlaylistSongAtIndex:ee,play:te,pause:ae,stop:le,getAudio:ue,getAnalyser:ne,next:ie,prev:de,getSongs:se,getSongsInPlaylist:oe,getSongsState:fe,getSongsStatePlaylist:re,getActiveIndex:ce,getVersion:pe,getBuffered:ve,skipTo:ye,setSongMetaData:ge,setPlaylistMetaData:me,setDelay:_e,getDelay:he,getPlayerState:be,addPlaylist:J,registerVisualization:Ae,setPlaylistVisualization:xe,setSongVisualization:Me,setSongInPlaylistVisualization:Pe,setGlobalVisualization:Se,getVolume:we,setVolume:Le}}();t.default=R,e.exports=t.default},function(e,t,a){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var u=a(0),n=l(u),i=a(4),d=l(i),s=a(5),o=l(s),f=a(7),r=l(f),c=a(17),p=l(c),v=function(){function e(e){n.default.playlists=e,a(),l(),t(),u(),i(),s(),f()}function t(){for(var e in n.default.playlists)n.default.playlists[e].active_index=null}function a(){for(var e in n.default.playlists)if(n.default.playlists.hasOwnProperty(e)&&n.default.playlists[e].songs)for(var t=0;t0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(a=e.hours+":"+a);for(var l=0;l0&&(l=e.hours+":"+l);for(var n=0;n0&&(a=i+":"+a)}return a}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a(0),u=function(e){return e&&e.__esModule?e:{default:e}}(l),n=function(){function e(e){t(e),a(e),l(e),n(e)}function t(e){for(var t=document.querySelectorAll(".amplitude-duration-hours"),a=0;a0&&(t=e.hours+":"+t)),t}return{sync:e,resetTimes:i}}();t.default=n,e.exports=t.default},function(e,t){e.exports={name:"amplitudejs",version:"5.3.2",description:"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs",main:"dist/amplitude.js",devDependencies:{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0",husky:"^1.3.1",jest:"^23.6.0",prettier:"1.15.1","pretty-quick":"^1.11.1",watch:"^1.0.2",webpack:"^2.7.0"},directories:{doc:"docs"},files:["dist"],funding:{type:"opencollective",url:"https://opencollective.com/amplitudejs"},scripts:{build:"node_modules/.bin/webpack",prettier:"npx pretty-quick",preversion:"npx pretty-quick && npm run test",postversion:"git push && git push --tags",test:"jest",version:"npm run build && git add -A dist"},repository:{type:"git",url:"git+https://github.com/521dimensions/amplitudejs.git"},keywords:["webaudio","html5","javascript","audio-player"],author:"521 Dimensions (https://521dimensions.com)",license:"MIT",bugs:{url:"https://github.com/521dimensions/amplitudejs/issues"},homepage:"https://github.com/521dimensions/amplitudejs#readme"}}])}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 647e5710..2754a488 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "amplitudejs", - "version": "5.3.1", + "version": "5.3.2", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 83e6901b..c47c17e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amplitudejs", - "version": "5.3.1", + "version": "5.3.2", "description": "A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs", "main": "dist/amplitude.js", "devDependencies": {