DigitalFormEmbeddedVideo.cs 1.0 KB

1234567891011121314151617181920212223242526272829
  1. using System.Threading.Tasks;
  2. using InABox.Core;
  3. using InABox.Mobile;
  4. namespace PRS.Mobile
  5. {
  6. public class DigitalFormEmbeddedVideo : DigitalFormEmbeddedMedia<DFLayoutVideoField, DFLayoutVideoFieldProperties>
  7. {
  8. protected override bool IsVideo => true;
  9. protected override bool DisableLibrary => Definition.Properties.DisableLibrary;
  10. protected override bool Secure => Definition.Properties.Secure;
  11. protected override bool Required => Definition.Properties.Required;
  12. protected override Task<MobileDocument> CaptureMedia()
  13. {
  14. return MobileDocument.From(new MobileDocumentVideoSource());
  15. }
  16. protected override Task<MobileDocument> SelectMedia()
  17. {
  18. return MobileDocument.From(new MobileDocumentVideoLibrarySource());
  19. }
  20. protected override byte[] CreateThumbnail(byte[] data, float maxwidth = 200, float maxheight=200)
  21. {
  22. return MobileUtils.ImageTools.CreateVideoThumbnail(data, maxwidth, maxheight);
  23. }
  24. }
  25. }