振幅js:AmplitudeJS:开源HTML5 Web音频库。 设计您想要的Web音频播放器。 无需依赖

  • V7_596737
    了解作者
  • 2.5MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 04:41
    上传日期
• • •• AmplitudeJS是一个轻量级JavaScript库,可让您控制网页(而非浏览器)中媒体控件的设计。 没有依赖关系(不需要jQuery)。 AmplitudeJS在下可用。 演示版 单击上面的图像转到演示站点,或。 该软件是社区运行的 没有适当的财务支持,开源软件将无法持续发展。 维护开源项目需要大量的精力和资源。 如果您对使用AmplitudeJS可以做什么感到非常感谢,或者您正在使用AmplitudeJS来赚取任何收入,我们恳请您提供任何可利用的资源来保持社区的发展。 赞助商 这些人相信开源。 如果您有兴趣改善项目,请。 白金赞助商 金牌赞助商 支持者 产品特点 :artist_palette: 所有玩家元素的100%可定制设计 :rocket: 轻量级,0个依赖项 :closed_book: 详尽记录 :headphone: 支持多个播放列表 :water_wave: 使用Web Audio API自动生成波形和可视化 :microphone: 直播支持 :control_knobs: 公共功能无限控制! :person_in_tuxedo
amplitudejs-master.zip
内容介绍
--- title: Public Functions - AmplitudeJS Documentation meta: - name: description content: Amplitude.js is the HTML5 audio player for the modern era. Using no dependencies, take control of the browser and design a web audio player the way you want it to look. - name: og:locale content: en_US - name: og:type content: website - name: og:title content: Amplitude.js The Open Source HTML5 Audio Player for the Modern Era - name: og:description content: Amplitude.js is the open source HTML5 audio player for the modern era. Using no dependencies, take control of the browser and design an audio player the way you want it to look. - name: og:url content: https://521dimensions.com/open-source/amplitudejs/docs/functions/ - name: og:site_name content: Amplitude.js - name: og:image content: https://521dimensions.com/img/open-source/amplitudejs/og-image-amplitudejs.png - name: og:image:width content: 1200 - name: og:image:height content: 630 - name: twitter:card content: summary_large_image - name: twitter:description content: Amplitude.js is the open source HTML5 audio player for the modern era. Using no dependencies, take control of the browser and design an audio player the way you want it to look. Available for free on Github. - name: twitter:title content: Amplitude.js The HTML Audio Player for the Modern Era - name: twitter:site content: "@521dimensions" - name: twitter:image content: https://521dimensions.com/img/open-source/amplitudejs/og-image-amplitudejs.png - name: creator content: "@521dimensions" --- # Public Functions <carbon-ads/> There are a variety of public functions that AmplitudeJS exposes to the user. These methods allow the user to change config variables, add new songs, play now, etc. ## Get Config Returns the current AmplitudeJS configuration. ```javascript Amplitude.getConfig(); ``` ## Bind New Elements The bind new elements function should be called whenever a new song element is added to the page. This will bind all of the event handlers for that element. ```javascript Amplitude.bindNewElements() ``` ## Get Active Playlist This method will return the key of the active playlist. ```javascript Amplitude.getActivePlaylist() ``` ## Get Playback Speed Returns the current playback speed for the player. ```javascript Amplitude.getPlaybackSpeed() ``` ## Get Repeat Returns the state of the global repeat status for the player. ```javascript Amplitude.getRepeat() ``` ## Get Repeat Playlist Returns the state of the repeat status for the playlist. ```javascript Amplitude.getRepeatPlaylist( playlistKey ) ``` ## Get Shuffle Returns the current state of the global shuffle status for the player. ```javascript Amplitude.getShuffle() ``` ## Get Shuffle Playlist Returns the state of the shuffle flag for a playlist. ```javascript Amplitude.getShufflePlaylist( playlistKey ) ``` ## Set Shuffle Sets the global shuffle state for AmplitudeJS. ```javascript Amplitude.setShuffle( shuffleState ) ``` ## Set Shuffle Playlist Sets the shuffle state for a playlist. ```javascript Amplitude.setShufflePlaylist( playlistKey, shuffleState ) ``` ## Set Repeat Sets the global repeat status for AmplitudeJS ```javascript Amplitude.setRepeat( repeatState ) ``` ## Set Repeat Song Sets the global state to determine if we should repeat the individual song upon completion. ```javascript Amplitude.setRepeatSong( repeatSongState ) ``` ## Set Repeat Playlist Sets the repeat for the playlist. ```javascript Amplitude.setRepeatPlaylist( playlistKey, repeatState ) ``` ## Get Default Album Art Returns the default album art URL set in the player. ```javascript Amplitude.getDefaultAlbumArt() ``` ## Set Default Album Art Sets the default album art for the player to the URL provided. ```javascript Amplitude.setDefaultAlbumArt( url ) ``` ## Get Default Album Art Returns the URL of the default album art for the player. ```javascript Amplitude.getDefaultAlbumArt() ``` ## Get Default Playlist Art Gets the default art for a playlist. ```javascript Amplitude.getDefaultPlaylistArt() ``` ## Set Default Playlist Art Sets the default playlist art. ```javascript Amplitude.setDefaultPlaylistArt( url ) ``` ## Set Debug To change the debug mode setting, you can call the setDebug method any time and start to receive data about the state of the player or turn off debugging. ```javascript Amplitude.setDebug( {bool} ); ``` ## Get Active Song Metadata Returns the active song's metadata as a JSON object. ```javascript Amplitude.getActiveSongMetadata(); ``` ## Get Active Playlist Metadata Gets the active playlist's metadata as a JSON object. ```javascript Amplitude.getActivePlaylistMetadata(); ``` ## Get Song At Index Returns a song's metadata at a specific index. ```javascript Amplitude.getSongAtIndex( {index} ); ``` ## Get Song At Playlist Index Returns a song at a playlist's index. ```javascript Amplitude.getSongAtPlaylistIndex( {playlistIndex}, {index} ); ``` ## Add Song Adds a song to the AmplitudeJS player. You will need to write a method yourself to add the visual side of things to fit your custom design, and then call the bindNewElements() method to make sure it works. This method returns the index of the song added to the player. ```javascript Amplitude.addSong( {song_object} ); ``` ## Prepend Song Adds a song to the beginning of the AmplitudeJS player. After pre-pending the song, you will have to bindNewElements() method to make sure that any visuals are updated as well. This method returns the index of the song added to the player. ```javascript Amplitude.prependSong( {song_object} ); ``` ## Add Song To Playlist Adds a song to a specific playlist within AmplitudeJS. Once the song is added you will need to update the visual side of the player yourself. After you update the visual side, run the `Amplitude.bindNewElements()` method to make sure the functionality is there for the new element. ```javascript Amplitude.addSongToPlaylist( songObject, playlistKey ) ``` ## Remove Song Removes a song from the global song array. You will have to remove the containing element by yourself. ```javascript Amplitude.removeSong( indexOfSong ) ``` ## Remove Song From Playlist Removes a song from a playlist. You will have to update the visual side by yourself. ```javascript Amplitude.removeSongFromPlaylist( indexOfSongInPlaylist, playlistKey ) ``` ## Play Song At Index Plays whatever song is set in the config at the specified index. ```javascript Amplitude.playSongAtIndex( songIndex ) ``` ## Play Playlist Song At Index Plays the song in a playlist at the specified index. ```javascript Amplitude.playPlaylistSongAtIndex( playlistIndex, playlistKey ) ``` ## Play Now In AmplitudeJS 2.0 this was referred to as 'Dynamic Mode'. Now you can just pass a song to AmplitudeJS and it will automatically play. If there are visual elements, then they will sync as well. ```javascript Amplitude.playNow( {song_object} ); ``` ## Play This simply plays whatever song is active. ```javascript Amplitude.play() ``` ## Pause This simply pauses whatever song is active. ```javascript Amplitude.pause() ``` ## Stop This simply stops whatever song is active. ```javascript Amplitude.stop() ``` ## Next Plays the next song either in the playlist or globally. ```javascript Amplitude.next( playlistKey = null ) ``` ## Prev Plays the previous song either in the playlist or globally. ```javascript Amplitude.prev( playlistKey = null ) ``` ## Get Audio This returns the actual audio element. This is mainly used for writing extensions but exposes the core of AmplitudeJS. This returns the audio element used by AmplitudeJS. ```javascript Amplitude.getAudio() ``` ## Get songs This method returns all of the songs defined in AmplitudeJS. It can be used for a variety of different functions. It's extremely helpful if you are AJAX loading songs and want to see the contents of the song array. ```javascri
评论
    相关推荐