About Playlists

About Playlists

Contents

Introduction

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.

Examples

Retrieve a List of Playlists

Call playlists method to retrieve a list of user’s playlists.

Code Sample

thingspace.cloud.playlists({
	success: function(success) {
	}
})

Retrieve Playlist

Call playlist method to retrieve a playlist.

Code Sample

thingspace.cloud.playlist({
	uid: uid, //from playlists call
	success: function(success) {
	}
})

Retrieve Playlist Content

Note this call immediately prompts a user to download the item

Call getPlaylistContent to retrieve the playlist content.

thingspace.cloud.getPlaylistContent(uid, itemuid);

Retrieve Playlist Items

Call playlistItemst to retrieve a list of playlist items.

Code Sample

thingspace.cloud.playlistItems({
	uid: uid, //from playlists call
	success: function(success) {
	}
})

Create Playlist

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) {
	}
})

Delete Playlist

Call deletePlaylist to delete a playlist.

Code Sample

thingspace.cloud.deletePlaylist({
	uid: uid, //from playlists call
	success: function(success) {
	}
})

Delete Item from Playlist

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) {
	}
})

Add Item to Playlist

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) {
	}
})

Update Playlist Metadata

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) {
	}
})

Update Playlist Definition

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.