The JavaScript SDK allows you to access Personal Cloud Storage account holder's data to retrieve, create, edit, modify, and delete playlists. Supported types of playlists include image, music, video, and image-video playlists. The following examples provide detailed steps that describe how to use supported methods and include code samples to help you get started with playlists.
Call playlists
method to retrieve a list of user's playlists.
Code Sample
thingspace.cloud.playlists({
success: function(success) {
}
})
Call playlist
method to retrieve a playlist.
Code Sample
thingspace.cloud.playlist({
uid: uid, //from playlists call
success: function(success) {
}
})
Note this call immediately prompts a user to download the item
Call getPlaylistContent
to retrieve the playlist content.
thingspace.cloud.getPlaylistContent(uid, itemuid);
Call playlistItemst
to retrieve a list of playlist items.
Code Sample
thingspace.cloud.playlistItems({
uid: uid, //from playlists call
success: function(success) {
}
})
Call createPlaylist
to create a playlist.
Code Sample
thingspace.cloud.createPlaylist({
uid: uid, //from playlists call
name : "new name",
type: "image",
paths: [
"/path/to/file1.jpg",
"/path/to/file2.jpg"
],
success: function(success) {
}
})
Call deletePlaylist
to delete a playlist.
Code Sample
thingspace.cloud.deletePlaylist({
uid: uid, //from playlists call
success: function(success) {
}
})
Call deleteFromPlaylist
to delete an item from a playlist.
Code Sample
thingspace.cloud.deleteFromPlaylist({
uid: uid, //from playlists call
itemuid: itemuid, //item you're deleting
success: function(success) {
}
})
Call addToPlaylist
to add an item to a playlist.
Code Sample
thingspace.cloud.addToPlaylist({
uid: uid, //from playlists call
add: [
"/path/to/file1.jpg",
"/path/to/file2.jpg"
],
success: function(success) {
}
})
Call updatePlaylist
to update a specified playlist's metadata.
Code Sample
thingspace.cloud.updatePlaylist({
uid: uid, //from playlists call
name : "new name",
type: "image",
success: function(success) {
}
})
Call updatePlaylistDefinition
to update a specified playlist's definition and content.
Code Sample
thingspace.cloud.updatePlaylistDefinition({
uid: uid, //from playlists call
name : "new name",
type: "image",
paths: [
"/path/to/file1.jpg",
"/path/to/file2.jpg"
],
success: function(success) {
}
})
Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.