| 12345678910111213141516171819202122232425262728293031323334353637 |
- using System.Threading.Tasks;
- using InABox.Core;
- using InABox.Mobile;
- namespace PRS.Mobile
- {
- public class DigitalFormEmbeddedVideo : DigitalFormEmbeddedMedia<DFLayoutVideoField, DFLayoutVideoFieldProperties, byte[]>
- {
- 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<MobileDocument> CaptureMedia()
- {
- return MobileDocument.From<MobileDocumentVideoSource>(
- new MobileDocumentVideoOptions()
- );
- }
- protected override Task<MobileDocument> SelectMedia()
- {
- return MobileDocument.From<MobileDocumentVideoLibrarySource>(
- 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);
- }
- }
- }
|