Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You're not doing anything wrong here. Currently, a placeholder image is shown instead of a mosaic for temporary playlists. </p> <p>Debugging the code (it helps if it isn't minified) will show you that a placeholder image (gray background with a note) is set as the node's image but stays hidden until a time limit has passed (less than half a second). During this time, the image property from the playlist is being loaded. If the image is loaded successfully, the placeholder is replaced or not shown at all if the time limit hasn't passed. The code below attempts to load the image property from a temporary playlist, which fails, thus showing the placeholder instead.</p> <pre><code>require(['$api/models', '$views/image#Image'], function(models, Image) { models.Playlist.createTemporary("Temporary Playlist").done(function(playlist) { playlist.load("tracks").done(function(playlist) { // Adding some random tracks to the temporary playlist playlist.tracks.add(models.Track.fromURI("spotify:track:2YtDzuAcSVk2j4UFXON5iG")); playlist.tracks.add(models.Track.fromURI("spotify:track:6xzCQrXrn0uOOKBQZK1zsF")); playlist.tracks.add(models.Track.fromURI("spotify:track:0m1sOrAltrx0oQlqKVUf75")); playlist.tracks.add(models.Track.fromURI("spotify:track:40RFNnTV6CAounCsx56TZ2")); // Checking if the playlist image can be loaded. // This code holds no purpose other than showing that // loading an image from a temporary playlist fails playlist.load("image").done(function(playlistWithImage) { console.log("Loaded image."); }).fail(function(playlistWithImage) { console.log("Failed to load image."); }) // Appending the playable node to the body tag var image = Image.forPlaylist(playlist, {width: 100, height: 100, player : true }); document.body.appendChild(image.node); }); }); }); </code></pre> <p>I don't know if this is something that is considered in need of fixing, but it's the way it is.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload