Is there any way to disable the next/previous button in the Spotify apps api, like SoundDrop was able to do?
Thanks
When you play a track without a context, or play a track with a context containing only one track, the playback controls are disabled.
SoundDrop takes the first approach — it only plays a single track at a time with no context, and manually plays the next track when it's time.
I managed to resolve this issue.
Setting the context to a context with only one track wasn't the entire solution, since I had to run an undocumented function on the playlist too.
But take a look at my solution here:
Disable next previous buttons in spotify
Related
I've been trying to figure out a way to record user interface actions to retrieve information about which ribbon buttons were clicked, but I've been unsuccessful so far.
I've spend a lot of time finding the related events in the API, but apparently there are none.
There are many ways to record user events in Revit. One of the simplest ways is to look at the journal file. It is always generated and stored automatically by Revit, so you don't have to do anything at all to obtain it. Look at its contents; all relevant user interactions are recorded there.
As said, there are other ways as well.
Afaik, recording which buttons are clicked is not officially supported and may be a bit tricky, cf. the Revit API discussion forum thread on obtaining button name using events for plugins working inside of another plugin.
Can you think of how to mark a card good/bad via Javascript, so it marks the current card and then displays the next one?
Ideally without any addons so it works on mobiles.
I am creating a custom quiz interface with multiple answer buttons.
Thank you!
Edit: Turns out it is already available in the AnkiDroid
https://github.com/ankidroid/Anki-Android/wiki/Advanced-formatting#designing-custom-cards-layout-for-buttons
showAnswer()
buttonAnswerEase1()
buttonAnswerEase2()
buttonAnswerEase3()
buttonAnswerEase4()
ankiMarkCard()
ankiToggleFlag()
AnkiDroidJS.ankiGetNewCardCount()
AnkiDroidJS.ankiGetLrnCardCount()
AnkiDroidJS.ankiGetRevCardCount()
AnkiDroidJS.ankiGetCardMark()
AnkiDroidJS.ankiGetCardFlag()
AnkiDroidJS.ankiGetETA()
In the next release they are planning to implement JS function to get the time for each button (to find out which one is "good" and if "easy" is available.
I just started writing a little Spotify App and can't figure out how to invoke the two functions next/star from Javascript. I just need this simple functionality: From within my App (Javascript) call a method that skips the current track and plays the next one (if there is any) OR call a method that "stars" (is this really a verb?) the current song.
Is this API DOC the only resource for building my own App? Thanks in advance for any hints on this!
UPDATE: Just found out how to SKIP: sp.trackPlayer.skipToNextTrack();
Unfortunately, how to "star" a track remains unknown.
UPDATE 2: GOT IT! : models.library.starredPlaylist.add(models.player.track); – yep that makes sense.
The correct way to star a track is indeed the function you wrote:
models.library.starredPlaylist.add(models.player.track);
trackPlayer is not a supported object that shouldn't be accessed by developers since it's not versioned properly. This means that it may break in the future when we do updates to the platform bridge.
We recommend only using the documented classes on our developer website.
https://developer.spotify.com/technologies/apps/docs/beta/
The correct way to skip to the next track is to use:
models.player.next()
I'm playing with the spotify play button and try to make it display an arbitrary set of tracks, that I'm giving as a comma-separated list of IDs.
It works well most of the time, but it can happen that the button is not properly rendered, and displays the Spotify Developer Page instead, like shown here: http://xben.free.fr/spotify/
I feel like it happens when using an important number of tracks (more than 80).
Has one of you experienced the same problem, or know if there is a limitation? I went through the doc and it only mentions a 1000 tracks restriction when using an existing playlist.
Yes, it is known limitation that trackset uris can not be longer than around 80 tracks (depending on your trackset title).
The reasoning for the arbitrary limit goes something like this: It is the longest possible url that you can send to older IE browsers. We want it to work the same across all browsers. If it doesn't work in one, it shouldn't work in the others either.
Two problems however.
The way it is implemented, just setting suhosin.get.max_value_length = 2048 in php conf. If it is too big, suhosin will just drop the parameter, making the request look like https://embed.spotify.com which will redirect to the developer site. Not the best of error messages. We will fix.
The limit should be documented. We will fix. Maybe even raise the limit and tell people to be vary of certain browsers.
(I work at Spotify)
I am developing spotify third party application using javascript API.
I am trying to play the track from certain position.
I am having following code,
player.position = 50000;
player.play(track);
But this code plays track from begining.
I want to play the track from certain position.
Is there any way to play track from certain position?
Thanks.
You need to play the track first, then as soon as playback starts seek to the location you want.
You can observe when playback starts by adding an observer for models.EVENT.CHANGE to the player object and looking at the playing property.
You can also link directly to a specific position in a track by adding #1:31 to the end of a URI, for example spotify:track:3iDK8BAaBUatPR84gdfa9g#0:15.