@octane-xplat/camera 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +89 -3
  2. package/package.json +35 -11
  3. package/platforms/android/AndroidManifest.xml +2 -0
  4. package/platforms/android/include.gradle +1 -0
  5. package/platforms/android/java/com/octanexplat/camera/CameraPreviewView.java +13 -0
  6. package/platforms/android/java/com/octanexplat/camera/CameraSessionBridge.java +394 -0
  7. package/platforms/ios/Info.plist +2 -0
  8. package/platforms/macos/src/CameraOwnership.swift +22 -0
  9. package/platforms/macos/src/PhotoCaptureLifecycle.swift +34 -0
  10. package/platforms/macos/src/XplatCameraHost.swift +639 -0
  11. package/platforms/macos/src/XplatPhotoCaptureSheet.swift +192 -0
  12. package/src/CameraView.android.tsrx +27 -3
  13. package/src/CameraView.ios.tsrx +32 -4
  14. package/src/CameraView.macos.tsrx +95 -0
  15. package/src/CameraView.web.tsrx +31 -2
  16. package/src/CameraView.windows.tsrx +126 -0
  17. package/src/camera-permission.mobile.ts +18 -4
  18. package/src/camera-permission.windows.ts +76 -0
  19. package/src/camera-session.macos.ts +75 -0
  20. package/src/camera-session.windows.ts +126 -0
  21. package/src/host-movie.web.ts +295 -0
  22. package/src/index.ts +32 -0
  23. package/src/index.web.ts +32 -0
  24. package/src/layout-child.windows.ts +79 -0
  25. package/src/movie-metadata.web.ts +84 -0
  26. package/src/movie-storage.web.ts +164 -0
  27. package/src/preview-tap.ts +34 -0
  28. package/src/props.ts +14 -1
  29. package/src/session-backend.android.ts +439 -0
  30. package/src/session-backend.ios.ts +1258 -0
  31. package/src/session-backend.linux.ts +887 -0
  32. package/src/session-backend.macos.ts +707 -0
  33. package/src/session-backend.ts +59 -0
  34. package/src/session-backend.web.ts +891 -0
  35. package/src/session-backend.windows.ts +1599 -0
  36. package/src/session-core.ts +723 -0
  37. package/src/session.ts +37 -0
  38. package/src/synthetic-session.ts +377 -0
  39. package/src/types.ts +357 -0
  40. package/types/index.d.ts +43 -0
  41. package/types/props.d.ts +14 -1
  42. package/types/session-core.d.ts +139 -0
  43. package/types/synthetic-session.d.ts +51 -0
  44. package/types/types.d.ts +290 -0
  45. package/dist/native/CameraView.android.js +0 -166
  46. package/dist/native/CameraView.ios.js +0 -131
  47. package/dist/native/camera-permission.mobile.js +0 -45
  48. package/dist/native/camera-session.ios.js +0 -45
  49. package/dist/native/cx.mobile.js +0 -9
  50. package/dist/native/index.js +0 -2
  51. package/dist/native/layout-child.js +0 -53
  52. package/dist/native/octane-client-build.json +0 -8
  53. package/dist/web/CameraView.web.tsrx.js +0 -317
  54. package/dist/web/index.js +0 -2
  55. package/dist/web/layout-child.web.js +0 -29
  56. package/dist/web/octane-client-build.json +0 -8
  57. package/src/CameraView.windows.ts +0 -5
  58. package/src/cx.mobile.ts +0 -6
@@ -0,0 +1,59 @@
1
+ import { CameraCaptureError } from './types'
2
+ import type { CameraSessionBackend } from './session-core'
3
+ import type { CameraSessionConfig } from './types'
4
+
5
+ /** Default adapter for platforms without a movie-capture implementation
6
+ * yet. Honest `unsupported` reporting — never fabricated capture. Kept
7
+ * platform-pure so web and native fallback builds share it. */
8
+ export function createSessionBackend(_config: CameraSessionConfig): CameraSessionBackend {
9
+ const unsupported = (operation: string) =>
10
+ new CameraCaptureError({
11
+ kind: 'unsupportedPlatform',
12
+ operation,
13
+ message: 'Movie recording is not implemented on this platform yet',
14
+ })
15
+
16
+ return {
17
+ platform: 'unsupported',
18
+ supported: false,
19
+ checkPermission: async () => 'unavailable',
20
+ requestPermission: async () => 'unavailable',
21
+ getCapabilities: async () => ({
22
+ supported: false,
23
+ reason: 'Movie recording is not implemented on this platform yet',
24
+ available: false,
25
+ cameras: [],
26
+ profiles: [],
27
+ audio: false,
28
+ focusPointOfInterest: false,
29
+ exposurePointOfInterest: false,
30
+ orientations: [],
31
+ durationLimit: 'bestEffort',
32
+ elapsedTime: 'estimated',
33
+ output: {
34
+ mimeType: '',
35
+ container: '',
36
+ storage: 'appPrivateFile',
37
+ destinationFileUrl: false,
38
+ },
39
+ }),
40
+ previewReady: () => false,
41
+ attachPreview: () => {
42
+ throw unsupported('attachPreview')
43
+ },
44
+ startCapture: (_request, sink) => {
45
+ sink.settled({
46
+ kind: 'failed',
47
+ stage: 'preparation',
48
+ issue: unsupported('startRecording'),
49
+ })
50
+ },
51
+ stopCapture: () => {},
52
+ elapsedMs: () => 0,
53
+ openOutput: async () => {
54
+ throw unsupported('openOutput')
55
+ },
56
+ release: async () => {},
57
+ setObserver: () => {},
58
+ }
59
+ }