CameraConstants.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. *
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. *
  20. */
  21. /**
  22. * @module Camera
  23. */
  24. module.exports = {
  25. /**
  26. * @enum {number}
  27. */
  28. DestinationType:{
  29. /** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
  30. DATA_URL: 0,
  31. /** Return file uri (content://media/external/images/media/2 for Android) */
  32. FILE_URI: 1,
  33. /** Return native uri (eg. asset-library://... for iOS) */
  34. NATIVE_URI: 2
  35. },
  36. /**
  37. * @enum {number}
  38. */
  39. EncodingType:{
  40. /** Return JPEG encoded image */
  41. JPEG: 0,
  42. /** Return PNG encoded image */
  43. PNG: 1
  44. },
  45. /**
  46. * @enum {number}
  47. */
  48. MediaType:{
  49. /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
  50. PICTURE: 0,
  51. /** Allow selection of video only, ONLY RETURNS URL */
  52. VIDEO: 1,
  53. /** Allow selection from all media types */
  54. ALLMEDIA : 2
  55. },
  56. /**
  57. * @enum {number}
  58. */
  59. PictureSourceType:{
  60. /** Choose image from picture library (same as SAVEDPHOTOALBUM for Android) */
  61. PHOTOLIBRARY : 0,
  62. /** Take picture from camera */
  63. CAMERA : 1,
  64. /** Choose image from picture library (same as PHOTOLIBRARY for Android) */
  65. SAVEDPHOTOALBUM : 2
  66. },
  67. /**
  68. * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
  69. * @enum {number}
  70. */
  71. PopoverArrowDirection:{
  72. ARROW_UP : 1,
  73. ARROW_DOWN : 2,
  74. ARROW_LEFT : 4,
  75. ARROW_RIGHT : 8,
  76. ARROW_ANY : 15
  77. },
  78. /**
  79. * @enum {number}
  80. */
  81. Direction:{
  82. /** Use the back-facing camera */
  83. BACK: 0,
  84. /** Use the front-facing camera */
  85. FRONT: 1
  86. }
  87. };