When creating a video library, you must perform the following steps:
Check whether the video library already exists.
Before you create the video library, you must check whether a video library with the same ID already exists.
Create the video library.
If the video library does not exist, you create a new video library with the specified ID.
Set the required properties.
When creating a new video library, it is recommended to set at least the following properties:
You can also set any other properties in this step.
Save the video library.
Save all changes that you have made to the video library.
The example below shows you how to create a video library with predefined ID.
The following code creates a video library with the specified ID and Title.
Native API
First, you get an instance of the LibrariesManager class. You check whether a video library with the same ID already exists. To create the video library, you call the CreateAlbum method of the LibrariesManager class and pass the specified ID. You can create a video library with either predefined or auto-generated ID depending on which overload of the method you use. Then, you set the properties of the video library object. It is recommended to set at least the following properties: Title, UrlName, LastModified, DateCreated. Finally, to save the video library, you call the SaveChanges method of the manager.
Fluent API
First, you check whether a video library with the same ID already exists. To create the video library, you call the CreateNew method of the singular video library facade. You can create a video library with either predefined or auto-generated ID depending on which overload of the method you use. To set the properties of the video library, you call the Do method of the facade. Finally, you save the changes.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important