@flighthq/video 0.2.1-next.841.373388f → 0.3.0-next.1032.e2b99fc
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/dist/contract.d.ts +4 -0
- package/dist/contract.d.ts.map +1 -0
- package/dist/contract.js +4 -0
- package/dist/contract.js.map +1 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/videoFormat.d.ts +1 -1
- package/dist/videoFormat.d.ts.map +1 -1
- package/dist/videoResource.d.ts +1 -1
- package/dist/videoResource.d.ts.map +1 -1
- package/dist/videoResource.js +6 -3
- package/dist/videoResource.js.map +1 -1
- package/dist/videoResourceFrom.d.ts +1 -1
- package/dist/videoResourceFrom.d.ts.map +1 -1
- package/package.json +6 -2
- package/src/videoResourceFrom.test.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/contract.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './videoResource';
|
|
3
|
-
export * from './videoResourceFrom';
|
|
1
|
+
export { canPlayVideoType, createVideoResource, createVideoResourceFromMediaStream, detectVideoMimeType, disposeVideoResource, getVideoResourceDuration, getVideoResourceHeight, getVideoResourceWidth, hasVideoResourceElement, inferVideoMimeType, isVideoResourceEmpty, isVideoResourceReady, loadVideoResourceFromBlob, loadVideoResourceFromUrl, loadVideoResourceFromUrls, selectVideoResourceUrl, } from './contract';
|
|
4
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,kCAAkC,EAClC,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export * from './videoResource';
|
|
3
|
-
export * from './videoResourceFrom';
|
|
1
|
+
export { canPlayVideoType, createVideoResource, createVideoResourceFromMediaStream, detectVideoMimeType, disposeVideoResource, getVideoResourceDuration, getVideoResourceHeight, getVideoResourceWidth, hasVideoResourceElement, inferVideoMimeType, isVideoResourceEmpty, isVideoResourceReady, loadVideoResourceFromBlob, loadVideoResourceFromUrl, loadVideoResourceFromUrls, selectVideoResourceUrl, } from './contract';
|
|
4
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,kCAAkC,EAClC,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,YAAY,CAAC"}
|
package/dist/videoFormat.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VideoResourceUrl } from '@flighthq/types';
|
|
1
|
+
import type { VideoResourceUrl } from '@flighthq/types/contract';
|
|
2
2
|
export declare function canPlayVideoType(mimeType: string): boolean;
|
|
3
3
|
export declare function detectVideoMimeType(data: ArrayBuffer | Uint8Array): string | null;
|
|
4
4
|
export declare function inferVideoMimeType(url: string): string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoFormat.d.ts","sourceRoot":"","sources":["../src/videoFormat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"videoFormat.d.ts","sourceRoot":"","sources":["../src/videoFormat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAKjE,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAG1D;AAKD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,CAcjF;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAwB7D;AAKD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,GAAG,gBAAgB,GAAG,IAAI,CAKrG"}
|
package/dist/videoResource.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VideoResource } from '@flighthq/types';
|
|
1
|
+
import type { VideoResource } from '@flighthq/types/contract';
|
|
2
2
|
export declare function createVideoResource(element?: HTMLVideoElement): VideoResource;
|
|
3
3
|
export declare function disposeVideoResource(resource: VideoResource): void;
|
|
4
4
|
export declare function getVideoResourceDuration(resource: Readonly<VideoResource>): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoResource.d.ts","sourceRoot":"","sources":["../src/videoResource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"videoResource.d.ts","sourceRoot":"","sources":["../src/videoResource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAK9D,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,aAAa,CAE7E;AAKD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAOlE;AAID,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,MAAM,CAGlF;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,MAAM,CAGhF;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,MAAM,CAG/E;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,OAAO,CAElF;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,OAAO,CAG/E;AAID,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,OAAO,CAG/E"}
|
package/dist/videoResource.js
CHANGED
|
@@ -18,13 +18,16 @@ export function disposeVideoResource(resource) {
|
|
|
18
18
|
// Duration in seconds of the loaded media, or 0 when no element is attached. May be NaN before
|
|
19
19
|
// metadata has loaded and Infinity for open-ended live streams — both come straight from the element.
|
|
20
20
|
export function getVideoResourceDuration(resource) {
|
|
21
|
-
|
|
21
|
+
const element = resource.element;
|
|
22
|
+
return element !== null ? element.duration : 0;
|
|
22
23
|
}
|
|
23
24
|
export function getVideoResourceHeight(resource) {
|
|
24
|
-
|
|
25
|
+
const element = resource.element;
|
|
26
|
+
return element !== null ? element.videoHeight : 0;
|
|
25
27
|
}
|
|
26
28
|
export function getVideoResourceWidth(resource) {
|
|
27
|
-
|
|
29
|
+
const element = resource.element;
|
|
30
|
+
return element !== null ? element.videoWidth : 0;
|
|
28
31
|
}
|
|
29
32
|
export function hasVideoResourceElement(resource) {
|
|
30
33
|
return resource.element !== null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoResource.js","sourceRoot":"","sources":["../src/videoResource.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,mGAAmG;AACnG,iGAAiG;AACjG,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC5D,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,CAAC;AACtC,CAAC;AAED,iGAAiG;AACjG,qGAAqG;AACrG,6FAA6F;AAC7F,MAAM,UAAU,oBAAoB,CAAC,QAAuB;IAC1D,MAAM,OAAO,GAAG,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"videoResource.js","sourceRoot":"","sources":["../src/videoResource.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,mGAAmG;AACnG,iGAAiG;AACjG,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC5D,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,CAAC;AACtC,CAAC;AAED,iGAAiG;AACjG,qGAAqG;AACrG,6FAA6F;AAC7F,MAAM,UAAU,oBAAoB,CAAC,QAAuB;IAC1D,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAkC,CAAC;IAC5D,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,C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B,CAAC;AACrE,CAAC;AAED,4FAA4F;AAC5F,MAAM,iBAAiB,GAAG,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VideoResource, VideoResourceLoadOptions, VideoResourceUrl } from '@flighthq/types';
|
|
1
|
+
import type { VideoResource, VideoResourceLoadOptions, VideoResourceUrl } from '@flighthq/types/contract';
|
|
2
2
|
export declare function createVideoResourceFromMediaStream(stream: MediaStream): VideoResource;
|
|
3
3
|
export declare function loadVideoResourceFromBlob(blob: Blob, options?: Readonly<VideoResourceLoadOptions>, signal?: AbortSignal): Promise<VideoResource>;
|
|
4
4
|
export declare function loadVideoResourceFromUrl(url: string, options?: Readonly<VideoResourceLoadOptions>, signal?: AbortSignal): Promise<VideoResource>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoResourceFrom.d.ts","sourceRoot":"","sources":["../src/videoResourceFrom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"videoResourceFrom.d.ts","sourceRoot":"","sources":["../src/videoResourceFrom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAO1G,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,CAIrF;AAID,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,CAAC,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAC5C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,CAAC,CAOxB;AAED,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAC5C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,CAAC,CAuCxB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,EACrC,OAAO,CAAC,EAAE,QAAQ,CAAC,wBAAwB,CAAC,EAC5C,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,CAAC,CAIxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/video",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-next.1032.e2b99fc",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/flighthq/flight.git",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
".": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./contract": {
|
|
18
|
+
"types": "./dist/contract.d.ts",
|
|
19
|
+
"default": "./dist/contract.js"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"files": [
|
|
@@ -32,7 +36,7 @@
|
|
|
32
36
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
33
37
|
},
|
|
34
38
|
"dependencies": {
|
|
35
|
-
"@flighthq/types": "0.
|
|
39
|
+
"@flighthq/types": "0.3.0-next.1032.e2b99fc"
|
|
36
40
|
},
|
|
37
41
|
"devDependencies": {
|
|
38
42
|
"typescript": "^5.3.0"
|
|
@@ -31,7 +31,7 @@ describe('createVideoResourceFromMediaStream', () => {
|
|
|
31
31
|
const stream = {} as MediaStream;
|
|
32
32
|
const resource = createVideoResourceFromMediaStream(stream);
|
|
33
33
|
expect(resource.element).not.toBeNull();
|
|
34
|
-
expect(resource.element
|
|
34
|
+
expect((resource.element as HTMLVideoElement).srcObject).toBe(stream);
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
|