@flighthq/texture 0.3.0-next.1162.e90e518 → 0.3.0-next.1248.f867198
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/package.json +4 -4
- package/src/videoTexture.test.ts +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/texture",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.1248.f867198",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/flighthq/flight.git",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@flighthq/entity": "0.3.0-next.
|
|
40
|
-
"@flighthq/geometry": "0.3.0-next.
|
|
41
|
-
"@flighthq/types": "0.3.0-next.
|
|
39
|
+
"@flighthq/entity": "0.3.0-next.1248.f867198",
|
|
40
|
+
"@flighthq/geometry": "0.3.0-next.1248.f867198",
|
|
41
|
+
"@flighthq/types": "0.3.0-next.1248.f867198"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"typescript": "^5.3.0"
|
package/src/videoTexture.test.ts
CHANGED
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
function makeVideoResource(readyState = 4, videoWidth = 320, videoHeight = 240): VideoResource {
|
|
21
21
|
return {
|
|
22
22
|
element: { readyState, videoWidth, videoHeight } as unknown as HTMLVideoElement,
|
|
23
|
+
objectUrl: null,
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -80,7 +81,7 @@ describe('getVideoTextureHeight', () => {
|
|
|
80
81
|
it('returns the element videoHeight when a frame is decoded, else -1', () => {
|
|
81
82
|
expect(getVideoTextureHeight(createVideoTexture(makeVideoResource(4, 320, 240)))).toBe(240);
|
|
82
83
|
expect(getVideoTextureHeight(createVideoTexture(makeVideoResource(0, 0, 0)))).toBe(-1);
|
|
83
|
-
expect(getVideoTextureHeight(createVideoTexture({ element: null }))).toBe(-1);
|
|
84
|
+
expect(getVideoTextureHeight(createVideoTexture({ element: null, objectUrl: null }))).toBe(-1);
|
|
84
85
|
});
|
|
85
86
|
});
|
|
86
87
|
|
|
@@ -123,7 +124,7 @@ describe('getVideoTextureWidth', () => {
|
|
|
123
124
|
it('returns the element videoWidth when a frame is decoded, else -1', () => {
|
|
124
125
|
expect(getVideoTextureWidth(createVideoTexture(makeVideoResource(4, 320, 240)))).toBe(320);
|
|
125
126
|
expect(getVideoTextureWidth(createVideoTexture(makeVideoResource(0, 0, 0)))).toBe(-1);
|
|
126
|
-
expect(getVideoTextureWidth(createVideoTexture({ element: null }))).toBe(-1);
|
|
127
|
+
expect(getVideoTextureWidth(createVideoTexture({ element: null, objectUrl: null }))).toBe(-1);
|
|
127
128
|
});
|
|
128
129
|
});
|
|
129
130
|
|
|
@@ -132,7 +133,7 @@ describe('isVideoTextureFrameReady', () => {
|
|
|
132
133
|
expect(isVideoTextureFrameReady(createVideoTexture(makeVideoResource(4, 320, 240)))).toBe(true);
|
|
133
134
|
expect(isVideoTextureFrameReady(createVideoTexture(makeVideoResource(1, 320, 240)))).toBe(false);
|
|
134
135
|
expect(isVideoTextureFrameReady(createVideoTexture(makeVideoResource(4, 0, 0)))).toBe(false);
|
|
135
|
-
expect(isVideoTextureFrameReady(createVideoTexture({ element: null }))).toBe(false);
|
|
136
|
+
expect(isVideoTextureFrameReady(createVideoTexture({ element: null, objectUrl: null }))).toBe(false);
|
|
136
137
|
});
|
|
137
138
|
});
|
|
138
139
|
|