@zappar/zappar-cv 2.1.1 → 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/README.md +2 -2
- package/lib/cameramodel.js +2 -1
- package/lib/drawcamera.js +2 -1
- package/lib/profile.d.ts +1 -0
- package/lib/profile.js +3 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/zappar-cv.wasm +0 -0
- package/package.json +1 -1
- package/umd/56.zappar-cv.js +1 -1
- package/umd/{5749b2c77a081c5836b0.wasm → b75f4e73dc5cea0bcb3e.wasm} +0 -0
- package/umd/zappar-cv.js +1 -1
- package/umd/zappar-cv.worker.js +1 -1
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.
|
|
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.
|
|
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)
|
package/lib/cameramodel.js
CHANGED
|
@@ -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
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
|
+
export declare const VERSION = "2.1.3-beta.0";
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "2.1.
|
|
1
|
+
export const VERSION = "2.1.3-beta.0";
|
package/lib/zappar-cv.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED