If you're allowing users to drop playlists into your application, they'll be of the first format. As you've noticed, there's no method in the API that does exactly what you're requesting, but you could do something like
var currentlyPlayingIsInPlaylist = function(playlistURI, callback) {
models.player.load("track").done(function() {
if (models.player.track) {
var currentlyPlayingTrack = models.player.track;
models.Playlist.fromURI(playlistURI).load("tracks").done(function(playlist) {
playlist.tracks.snapshot().done(function(snapshot) {
var matchingTrack = snapshot.find(currentlyPlayingTrack);
if (matchingTrack) {
callback(true);
} else {
callback(false);
}
});
});
} else {
callback(null, { "message" : "No track is playing" });
}
});
}
Given that models is available in the function. Side note: Even if the currently playing track property was loaded on the Player, and the given playlist had its tracks property loaded, the function would still be asynchronous since it's getting the current snapshot.
Hope this helps!