Get all items in the playlist.
Add an item to the playlist.
playlist.add("https://example.com/video.mp4", 0 /* insert at the beginning * );
The URL of the item.
Optional
at: numberThe index to insert the item. If not specified, the item will be appended to the end of the playlist.
Remove an item from the playlist.
The index of the item to remove.
Move an item in the playlist.
The index of the item to move.
The destination index.
Provide a menu builder function to add custom menu items to the playlist context menu. When the user selects one or more items in the playlist and right-clicks on them, the menu builder function will be called with the selected items as an argument. It should return an array of menu items, which will be inserted into the context menu.
// trash the selected items
playlist.registerMenuBuilder(entries => [
menu.item(`Trash these ${entries.length} files`, () => {
for (const entry of entries) {
file.trash(entry.filename);
}
}),
]);
The menu builder function.
The user-selected playlist items.
Generated using TypeDoc
The
Playlist
module provides methods to manipulate the playlist and add custom menu items to the playlist context menu.Available In Entry
Main entry only