using System.Threading.Tasks; using InABox.Core; using InABox.Mobile; namespace PRS.Mobile { public class DigitalFormEmbeddedVideo : DigitalFormEmbeddedMedia { protected override bool IsVideo => true; protected override bool DisableLibrary => Definition.Properties.DisableLibrary; protected override bool Secure => Definition.Properties.Secure; protected override bool Required => Definition.Properties.Required; protected override Task CaptureMedia() { return MobileDocument.From( new MobileDocumentVideoOptions() ); } protected override Task SelectMedia() { return MobileDocument.From( new MobileDocumentVideoLibraryOptions() ); } protected override byte[] GetValue() => _value.Thumbnail; protected override void SetValue(byte[] value) => _value.Thumbnail = value; protected override byte[] CreateThumbnail(byte[] data, int maxwidth = 256, int maxheight=256) { return MobileUtils.ImageTools.CreateVideoThumbnail(data, maxwidth, maxheight); } } }