All Projects → Napster → napster.js

Napster / napster.js

Licence: MIT license
Napster Javascript SDK

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to napster.js

Youtube Extension
🔴YouTube Extension🧰>80 Features ⭐Please document, code or donate📌Tidy📌Longest-standing(2012)(Users>350000)⋮🎞️🎛️🎧⚙️🎬🔊☕🎨🧩🧪📈⏯️(Player: Repeat Screenshot Rotate; Hide related video distraction. Always expand video Description. Playback speed. Video Quality bandwidth H.264 electricity. Player Size Full Window. Themes Customization. Statistics. Reverse Playlist YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube Youtube enhancer YouTube app YouTube video YouTube YouTube YouTube api v3 YouTube playback YouTube player VP8 VP9 AV1 vidIQ tubebuddy download adblocker adblock ads sponsorblock addon youtube music ⭐ youtube premium css css4 html5 ytdl youtube-dl invidious iridium ParticleCore youtube+ youtube++ youtube-plus maia-yt youtube nonstop youtube control center vlogger vlog h264ify h264 m.youtube.com music.youtube.com studio.youtube youtube mobile youtube studio ⭐ kids Vanced gaming.youtube.com gaming youtubecenter freetube lite-youtube-embed newpipe youtube-dl-gui mps-youtube nuclear pytube awesome youtubers youtube downloader 8k 4k 60fps 30fps youtubeexplode vidgear k-lite tubebuddy adobe apple ios iphone design simplify ffmpeg premiere designer annoyance youtube upload
Stars: ✭ 1,027 (+1913.73%)
Mutual labels:  player, playback
Lovetracker
A module tracker written in lua/LöVE.
Stars: ✭ 38 (-25.49%)
Mutual labels:  player, playback
Straas-android-sdk-sample
Straas Android SDK samples and documentation
Stars: ✭ 12 (-76.47%)
Mutual labels:  player, playback
shaka-player-react
A simple React component wrapper for shaka-player
Stars: ✭ 79 (+54.9%)
Mutual labels:  player, playback
Shikwasa
An audio player born for podcast
Stars: ✭ 216 (+323.53%)
Mutual labels:  player, playback
Hls.js
HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
Stars: ✭ 10,791 (+21058.82%)
Mutual labels:  player, playback
Djv
Professional media review software for VFX, animation, and film production
Stars: ✭ 282 (+452.94%)
Mutual labels:  player, playback
Chameleon
Chameleon is a flexible media player build with Xamarin.Forms
Stars: ✭ 137 (+168.63%)
Mutual labels:  player, playback
api.video-player-sdk
SDK to control and interact with the api.video HTML5 Player
Stars: ✭ 31 (-39.22%)
Mutual labels:  player, playback
bigscreen-player
Simplified media playback for bigscreen devices
Stars: ✭ 62 (+21.57%)
Mutual labels:  player, playback
musique
C'est très élégant
Stars: ✭ 91 (+78.43%)
Mutual labels:  player
ArgPlayer
An android music player library
Stars: ✭ 52 (+1.96%)
Mutual labels:  player
SFMediaStream
HTML5 media streamer library for playing music, video, playlist, or even live streaming microphone & camera with node server
Stars: ✭ 97 (+90.2%)
Mutual labels:  player
ARVI
Android library designed to simplify the implementation of the video autoplay in the RecyclerView
Stars: ✭ 69 (+35.29%)
Mutual labels:  player
CloudMusic
使用vue和electron实现的音乐应用(C-Music)
Stars: ✭ 43 (-15.69%)
Mutual labels:  player
elm-hangman
The game of Hangman written in Elm.
Stars: ✭ 19 (-62.75%)
Mutual labels:  player
MusicPlayer
A Telegram Music Bot written in Python using Pyrogram and Py-Tgcalls. This is Also The Source Code of The UserBot Which is Playing Music in @S1-BOTS Support Group ❤️
Stars: ✭ 218 (+327.45%)
Mutual labels:  player
Spotify-Telegram-Bio-Updater
Spotify Telegram Bio Updater Heroku Integration
Stars: ✭ 26 (-49.02%)
Mutual labels:  playback
jest-playback
Record and playback http requests from your Jest tests
Stars: ✭ 51 (+0%)
Mutual labels:  playback
reactjs-media
The reactjs media is a react package with awesome HTMLMediaElements that are recreated into react components with a good looking UI and fast UX.
Stars: ✭ 15 (-70.59%)
Mutual labels:  player

napster.js

Getting Started

Include the napster.min.js source in your application after the dependent jQuery library. Once the source is loaded, the library must be initialized with an application key.

Napster.init({
  consumerKey: 'api_key', // application key of your application
  isHTML5Compatible: true // (boolean) true if browser supports HTML5 player
                          // false, flash player will be used instead)
});

Initialization Options

Attribute Default Description
consumerKey undefined The application key
version 'v2.2' API endpoint version. Please refer to developer.napster.com for available versions.
catalog 'EN' The desired catalog locale
player 'player-frame' The html element id where the player iframe will be embedded

Authentication

The Member object exposes a methods for user sessions. Use the Napster.member.set(credentials) to manage sessions. After setting the member session information the player will automatically be reauthenticated.

Napster.member.set({
  accessToken: 'oauth access token',
  refreshToken: 'oauth refresh token'
});

Playback

The Napster object exposes a top-level player object that provides the necessary methods to manage playback.

Check if player is ready and authorize

Napster.player.on('ready', function(e) {
    Napster.member.set({accessToken: 'oauth access token'}); // If not set earlier
    Napster.player.auth();
}

Playing a track

Napster.player.play('Tra.5156528');

Playing a track with an offset (in seconds)

Napster.player.play('Tra.5156528', 40);

Pausing

Napster.player.pause();

Resuming a paused track

Napster.player.resume();

Seek

For example, to seek to 0:10 in a given track:

Napster.player.seek();

Volume

Set volume between muted (0) and max (1.0)

Napster.player.setVolume(.5);

Data

The Napster object exposes some API convenience methods. There are methods for HTTP GET, POST, PUT, and DELETE. The first parameter determines if a secure request is made.

Napster.api.get(false, '/tracks/top', function(data) {
  Napster.player.play(data.tracks[0].id);
});

Events

There are a number of interesting playback-related events you can listen for:

  • playevent: Starts, pauses, completes, etc.
  • playtimer: Current time, total time
  • error: Bad things
  • metadata
  • ready
  • playsessionexpired
  • playstopped

Listening for player events is simple:

Napster.player.on('playevent', function(e) {
  console.log(e.data);
});

Napster.player.on('playtimer', function(e) {
  console.log(e.data);
});

Napster.player.on('error', function(e) {
  console.log(e.data);
});

Contributing

Bug reports and pull requests are welcome on GitHub.

If you'd like to contribute to the development of this SDK:

  • Fork the repo
  • Make your changes in src/napster.js
  • Test thoroughly and ensure the Example Apps functions properly with your changes.
  • Submit a pull request.

License

This SDK is released under the MID License:

The MIT License (MIT)

Copyright © 2018 Napster / Rhapsody International

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].