About Playlists

About Playlists

Contents

 

 

Introduction

The Node.js 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

Add Item to Playlist

Call addToPlaylist to add an item to a playlist.

Code Sample

cloud.addToPlaylist({
    uid: uid, //from playlists call
    add: [ 
        "/path/to/file1.jpg",
        "/path/to/file2.jpg"
    ],
    success: function(success) {
    }
})

Create Playlist

Call createPlaylist to create a playlist.

Code Sample

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 Item from Playlist

Call deleteFromPlaylist to delete an item from a playlist.

Code Sample

cloud.deleteFromPlaylist({
    uid: uid, //from playlists call
    itemuid: itemuid, //item you're deleting
    success: function(success) {
    }
})

Delete Playlist

Call deletePlaylist to delete a playlist.

Code Sample

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

Retrieve a List of Playlists

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

Code Sample

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

Retrieve Playlist

Call playlist method to retrieve a playlist.

Code Sample

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

Update Playlist Definition

Call updatePlaylistDefinition to update a specified playlist’s definition and content.

Code Sample

cloud.updatePlaylistDefinition({
    uid: uid, //from playlists call
    name : "new name",
    type: "image",
    paths: [ 
        "/path/to/file1.jpg",
        "/path/to/file2.jpg"
    ],		
    success: function(success) {
    }
})

Retrieve Playlist Items

Call playlistItemst to retrieve a list of playlist items.

Code Sample

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

Update Playlist Metadata

Call updatePlaylist to update a specified playlist’s metadata.

Code Sample

cloud.updatePlaylist({
    uid: uid, //from playlists call
    name : "new name",
    type: "image",		
    success: function(success) {
    }
})

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.