Help uploading custom thumbnails for videos
Hi guys,
I have a question regarding the creation of video thumbnails. I am uploading videos to sitefinity video gallery via Sitefinity API and i was wondering how I can upload a custom image via API for the video I am uploading. I have investigated but haven't found something about this topic.
Hope you can help me.
Thanks.
Hi,
Please have a look at following documentation article:
Use custom video thumbnail generation
http://docs.sitefinity.com/use-custom-video-thumbnail-generation
And blogpost:
Adding custom thumbnails sizes for Videos and Images in Sitefinity
www.sitefinity.com/.../adding_custom_thumbnails_sizes_for_videos_and_images_in_sitefinity
Thanks for answering, i included the OALPCustom in my project and I noticed that the Thumbnail.Data is obsolete, and it says that "Since version 6.1 the blob data is stored in the Blob Storage for the MediaContent". Also the method CreateThumbnail is obsolete.
Is there a way to upload the video thumbnails using the blob storage?
Thanks,
Dehivis.
Hi,
Please observe following sample for uploading an image (green.png) as a thumbnail to a video (SampleVideo).
var manager = LibrariesManager.GetManager();
var id = manager.GetVideos().Where(v => v.Title ==
"SampleVideo"
).First().Id;
var thumbnailData = File.OpenRead(
"C:\\temp\\green.png"
);
using
(MemoryStream ms =
new
MemoryStream())
thumbnailData.CopyTo(ms);
var data = ms.ToArray();
manager.UpdateThumbnail(id, data);
manager.SaveChanges();