@zappar/zappar-cv 2.1.1-beta.2 → 2.1.3-beta.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.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,5 @@
1
1
  # Changelog
2
2
 
3
- # [2.1.0] - 2023-05-04
4
-
5
- ### Added
6
- - Spanish, Portuguese and German translations for permissions screen
7
-
8
3
  ## [2.0.2] - 2023-05-04
9
4
 
10
5
  ### Fixed
package/README.md CHANGED
@@ -18,8 +18,8 @@ npm i @zappar/zappar-cv
18
18
 
19
19
  You can use our CDN from within your HTML:
20
20
  ```
21
- <script src="https://libs.zappar.com/zappar-cv/2.1.1-beta.2/zappar-cv.js"></script>
21
+ <script src="https://libs.zappar.com/zappar-cv/2.1.3-beta.0/zappar-cv.js"></script>
22
22
  ```
23
23
 
24
24
  Or you can download and host our standalone JavaScript bundle:
25
- [https://libs.zappar.com/zappar-cv/2.1.1-beta.2/zappar-cv.zip](https://libs.zappar.com/zappar-cv/2.1.1-beta.2/zappar-cv.zip)
25
+ [https://libs.zappar.com/zappar-cv/2.1.3-beta.0/zappar-cv.zip](https://libs.zappar.com/zappar-cv/2.1.3-beta.0/zappar-cv.zip)
@@ -1,4 +1,5 @@
1
1
  import { mat4, vec3 } from "gl-matrix";
2
+ import { profile } from "./profile";
2
3
  export function projectionMatrix(params, screenWidth, screenHeight, near = 0.01, far = 100.0) {
3
4
  let cam_x = params[2] * 2;
4
5
  let cam_y = params[3] * 2;
@@ -41,7 +42,7 @@ export function projectionMatrix(params, screenWidth, screenHeight, near = 0.01,
41
42
  return projection;
42
43
  }
43
44
  export function cameraRotationForScreenOrientation(isUserFacing) {
44
- if (window.screen.orientation) {
45
+ if (window.screen.orientation && !profile.forceWindowOrientation) {
45
46
  switch (window.screen.orientation.type) {
46
47
  case "portrait-primary":
47
48
  return isUserFacing ? 90 : 270;
package/lib/drawcamera.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { profile } from "./profile";
1
2
  import { compileShader, linkProgram } from "./shader";
2
3
  import { mat4, vec3 } from "gl-matrix";
3
4
  let identity = mat4.create();
@@ -123,7 +124,7 @@ void main()
123
124
  gl_FragColor = texture2DProj(skinSampler, skinTexVarying);
124
125
  }`;
125
126
  function cameraRotationForScreenOrientation() {
126
- if (window.screen.orientation) {
127
+ if (window.screen.orientation && !profile.forceWindowOrientation) {
127
128
  switch (window.screen.orientation.type) {
128
129
  case "portrait-primary":
129
130
  return 270;
package/lib/profile.d.ts CHANGED
@@ -16,4 +16,5 @@ export declare let profile: {
16
16
  preferMediaStreamTrackProcessorCamera: boolean;
17
17
  preferImageBitmapCamera: boolean;
18
18
  ios164CameraSelection: boolean;
19
+ forceWindowOrientation: boolean;
19
20
  };
package/lib/profile.js CHANGED
@@ -17,7 +17,8 @@ export let profile = {
17
17
  videoElementInDOM: false,
18
18
  preferMediaStreamTrackProcessorCamera: false,
19
19
  preferImageBitmapCamera: false,
20
- ios164CameraSelection: false
20
+ ios164CameraSelection: false,
21
+ forceWindowOrientation: false,
21
22
  };
22
23
  if (typeof window !== "undefined") {
23
24
  window["zeeProfile"] = profile;
@@ -46,6 +47,7 @@ if (engine === "webkit" && os === "ios") {
46
47
  iDevice(version);
47
48
  }
48
49
  function iDevice(version) {
50
+ profile.forceWindowOrientation = true;
49
51
  let versionParts = version.split(".");
50
52
  if (versionParts.length >= 2) {
51
53
  const majorVersion = parseInt(versionParts[0]);
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "2.1.1-beta.2";
1
+ export declare const VERSION = "2.1.3-beta.0";
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "2.1.1-beta.2";
1
+ export const VERSION = "2.1.3-beta.0";
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zappar/zappar-cv",
3
- "version": "2.1.1-beta.2",
3
+ "version": "2.1.3-beta.0",
4
4
  "description": "Zappar's core computer vision library, supporting image, face and world tracking.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",