Lines Matching refs:album

3album management, including creating or deleting a user album, adding images and videos to a user 
17 …ference/apis-media-library-kit/js-apis-photoAccessHelper.md#applychanges11) to create a user album.
19 The album name must meet the following requirements:
21 - The album name cannot exceed 255 characters.
22 - The album name cannot contain any of the following characters:<br>. \ / : * ? " ' ` < > | { } [ ]
23 - The album name is case-insensitive.
24 - Duplicate album names are not allowed.
31 Example: Create a user album.
35 1. Set the name of the album.
36 2. Call **MediaAlbumChangeRequest.createAlbumRequest** to create an album change request object.
49 let album: photoAccessHelper.Album = albumChangeRequest.getAlbum();
50 …console.info('create album successfully, album name: ' + album.albumName + ' uri: ' + album.albumU…
52 console.error('create album failed with err: ' + err);
67 Example: Obtain the user album **albumName**.
71 1. Set **fetchOptions** for obtaining the user album.
73 …is-media-library-kit/js-apis-photoAccessHelper.md#getfirstobject-1) to obtain the first user album.
92 let album: photoAccessHelper.Album = await fetchResult.getFirstObject();
93 console.info('getAlbums successfully, albumName: ' + album.albumName);
103 To rename a user album, modify the **Album.albumName** attribute of the album.
105 …-library-kit/js-apis-photoAccessHelper.md#fetchresult) to obtain the user album to rename, use [Me…
107 The new user album names must comply with the following requirements:
109 - The album name cannot exceed 255 characters.
110 - The album name cannot contain any of the following characters:<br>. \ / : * ? " ' ` < > | { } [ ]
111 - The album name is case-insensitive.
112 - Duplicate album names are not allowed.
119 Example: Rename the user album **albumName**.
123 1. Set **fetchOptions** for obtaining the user album.
125 …is-media-library-kit/js-apis-photoAccessHelper.md#getfirstobject-1) to obtain the first user album.
126 4. Call **MediaAlbumChangeRequest.setAlbumName** to set a new album name.
127 5. Call **PhotoAccessHelper.applyChanges** to save the new album name to the database.
146 let album: photoAccessHelper.Album = await fetchResult.getFirstObject();
147 console.info('getAlbums successfully, albumName: ' + album.albumName);
148 …: photoAccessHelper.MediaAlbumChangeRequest = new photoAccessHelper.MediaAlbumChangeRequest(album);
152 console.info('setAlbumName successfully, new albumName: ' + album.albumName);
162album](#obtaining-a-user-album) and the images or videos to be added to the album, and then call […
169 Example: Add an image to the user album **albumName**.
173 1. Set **albumFetchOptions** for obtaining the user album.
176 …apis-media-library-kit/js-apis-photoAccessHelper.md#getfirstobject) to obtain the first user album.
179 7. Call **MediaAlbumChangeRequest.addAssets** to add the image to the user album.
205 let album: photoAccessHelper.Album = await albumFetchResult.getFirstObject();
206 console.info('getAlbums successfully, albumName: ' + album.albumName);
210 …: photoAccessHelper.MediaAlbumChangeRequest = new photoAccessHelper.MediaAlbumChangeRequest(album);
213 console.info('succeed to add ' + photoAsset.displayName + ' to ' + album.albumName);
224album](#obtaining-a-user-album), and call [Album.getAssets](../../reference/apis-media-library-kit…
231 Example: Obtain an image in the user album **albumName**.
235 1. Set **albumFetchOptions** for obtaining the user album.
238 …is-media-library-kit/js-apis-photoAccessHelper.md#getfirstobject-1) to obtain the first user album.
239 5. Call **Album.getAssets** to obtain the media assets in the user album.
265 let album: photoAccessHelper.Album = await albumFetchResult.getFirstObject();
266 console.info('getAlbums successfully, albumName: ' + album.albumName);
267 let photoFetchResult = await album.getAssets(photoFetchOptions);
269 console.info('album getAssets successfully, albumName: ' + photoAsset.displayName);
273 console.error('album getAssets failed with err: ' + err);
280album](#obtaining-a-user-album), and call [Album.getAssets](../../reference/apis-media-library-kit…
289 Example: Remove an image from the user album **albumName**.
293 1. Set **albumFetchOptions** for obtaining the user album.
296 …is-media-library-kit/js-apis-photoAccessHelper.md#getfirstobject-1) to obtain the first user album.
299 7. Call **MediaAlbumChangeRequest.removeAssets** to remove the image from the user album.
325 let album: photoAccessHelper.Album = await albumFetchResult.getFirstObject();
326 console.info('getAlbums successfully, albumName: ' + album.albumName);
327 let photoFetchResult = await album.getAssets(photoFetchOptions);
329 console.info('album getAssets successfully, albumName: ' + photoAsset.displayName);
330 …: photoAccessHelper.MediaAlbumChangeRequest = new photoAccessHelper.MediaAlbumChangeRequest(album);
333 console.info('succeed to remove ' + photoAsset.displayName + ' from ' + album.albumName);
345album](#obtaining-a-user-album), and call [MediaAlbumChangeRequest.deleteAlbums](../../reference/a…
352 Example: Delete the user album **albumName**.
356 1. Set **fetchOptions** for obtaining the user album.
358 3. Call **FetchResult.getFirstObject** to obtain the first user album.
359 4. Call **MediaAlbumChangeRequest.deleteAlbums** to delete the user album.
378 let album: photoAccessHelper.Album = await fetchResult.getFirstObject();
379 console.info('getAlbums successfully, albumName: ' + album.albumName);
380 await photoAccessHelper.MediaAlbumChangeRequest.deleteAlbums(context, [album]);