@guardvideo/player-sdk 1.0.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.
@@ -0,0 +1,7 @@
1
+ export { GuardVideoPlayer as GuardVideoPlayerCore } from './core/player';
2
+ export * from './core/types';
3
+ export { GuardVideoPlayerComponent as GuardVideoPlayer } from './react/GuardVideoPlayer';
4
+ export { useGuardVideoPlayer } from './react/hooks';
5
+ export type { GuardVideoPlayerProps, GuardVideoPlayerRef } from './react/GuardVideoPlayer';
6
+ export type { UseGuardVideoPlayerOptions, UseGuardVideoPlayerReturn } from './react/hooks';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACzE,cAAc,cAAc,CAAC;AAG7B,OAAO,EAAE,yBAAyB,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,YAAY,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { PlayerConfig, PlayerError, PlayerState, PlayerInstance } from '../core/types';
3
+ export interface GuardVideoPlayerProps extends Omit<PlayerConfig, 'onReady' | 'onError' | 'onQualityChange' | 'onStateChange'> {
4
+ videoId: string;
5
+ width?: string | number;
6
+ height?: string | number;
7
+ onReady?: () => void;
8
+ onError?: (error: PlayerError) => void;
9
+ onQualityChange?: (quality: string) => void;
10
+ onStateChange?: (state: PlayerState) => void;
11
+ onTimeUpdate?: (currentTime: number) => void;
12
+ onEnded?: () => void;
13
+ }
14
+ export interface GuardVideoPlayerRef extends PlayerInstance {
15
+ getVideoElement: () => HTMLVideoElement | null;
16
+ }
17
+ export declare const GuardVideoPlayerComponent: React.ForwardRefExoticComponent<GuardVideoPlayerProps & React.RefAttributes<GuardVideoPlayerRef>>;
18
+ //# sourceMappingURL=GuardVideoPlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GuardVideoPlayer.d.ts","sourceRoot":"","sources":["../../src/react/GuardVideoPlayer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAuE,MAAM,OAAO,CAAC;AAE5F,OAAO,EACL,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACf,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,GAAG,iBAAiB,GAAG,eAAe,CAAC;IAI5H,OAAO,EAAE,MAAM,CAAC;IAMhB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAMxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAKzB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAKrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAKvC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAK5C,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IAK7C,YAAY,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAK7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,eAAe,EAAE,MAAM,gBAAgB,GAAG,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,yBAAyB,mGAsKrC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { GuardVideoPlayer } from '../core/player';
2
+ import { PlayerConfig, PlayerState, PlayerError, QualityLevel } from '../core/types';
3
+ export interface UseGuardVideoPlayerOptions extends PlayerConfig {
4
+ videoId: string;
5
+ }
6
+ export interface UseGuardVideoPlayerReturn {
7
+ videoRef: React.RefObject<HTMLVideoElement>;
8
+ player: GuardVideoPlayer | null;
9
+ state: PlayerState;
10
+ error: PlayerError | null;
11
+ currentTime: number;
12
+ duration: number;
13
+ volume: number;
14
+ currentQuality: QualityLevel | null;
15
+ qualityLevels: QualityLevel[];
16
+ isReady: boolean;
17
+ isPlaying: boolean;
18
+ play: () => Promise<void>;
19
+ pause: () => void;
20
+ seek: (time: number) => void;
21
+ setVolume: (volume: number) => void;
22
+ setQuality: (levelIndex: number) => void;
23
+ }
24
+ export declare function useGuardVideoPlayer(options: UseGuardVideoPlayerOptions): UseGuardVideoPlayerReturn;
25
+ //# sourceMappingURL=hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAErF,MAAM,WAAW,0BAA2B,SAAQ,YAAY;IAC9D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,yBAAyB,CA0G3B"}
@@ -0,0 +1,9 @@
1
+ import { GuardVideoPlayer as CorePlayer } from '../core/player';
2
+ import { PlayerConfig, PlayerState, PlayerError } from '../core/types';
3
+ export declare class GuardVideoPlayer extends CorePlayer {
4
+ static create(containerId: string, videoId: string, config: PlayerConfig): GuardVideoPlayer;
5
+ static createFromElement(videoElement: HTMLVideoElement | string, videoId: string, config: PlayerConfig): GuardVideoPlayer;
6
+ }
7
+ export { PlayerState };
8
+ export type { PlayerError };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vanilla/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGvE,qBAAa,gBAAiB,SAAQ,UAAU;IAkB9C,MAAM,CAAC,MAAM,CACX,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,GACnB,gBAAgB;IA+BnB,MAAM,CAAC,iBAAiB,CACtB,YAAY,EAAE,gBAAgB,GAAG,MAAM,EACvC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,YAAY,GACnB,gBAAgB;CAWpB;AAGD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,WAAW,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@guardvideo/player-sdk",
3
+ "version": "1.0.0",
4
+ "description": "GuardVideo Player SDK - Secure HLS video player with embed token authentication for React, Next.js, and vanilla JavaScript",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "build": "rollup -c",
15
+ "dev": "rollup -c -w",
16
+ "prepare": "npm run build",
17
+ "prepublishOnly": "npm run build",
18
+ "test": "echo \"Error: no test specified\" && exit 1"
19
+ },
20
+ "keywords": [
21
+ "video",
22
+ "player",
23
+ "hls",
24
+ "streaming",
25
+ "react",
26
+ "nextjs",
27
+ "typescript",
28
+ "adaptive-bitrate",
29
+ "embed",
30
+ "secure-video"
31
+ ],
32
+ "author": "GuardVideo",
33
+ "license": "MIT",
34
+ "peerDependencies": {
35
+ "react": "^18.0.0 || ^19.0.0",
36
+ "react-dom": "^18.0.0 || ^19.0.0"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "react": {
40
+ "optional": true
41
+ },
42
+ "react-dom": {
43
+ "optional": true
44
+ }
45
+ },
46
+ "dependencies": {
47
+ "hls.js": "^1.5.0"
48
+ },
49
+ "devDependencies": {
50
+ "@rollup/plugin-commonjs": "^25.0.7",
51
+ "@rollup/plugin-node-resolve": "^15.2.3",
52
+ "@rollup/plugin-typescript": "^11.1.6",
53
+ "@types/react": "^18.2.0",
54
+ "@types/react-dom": "^18.2.0",
55
+ "rollup": "^4.9.0",
56
+ "rollup-plugin-peer-deps-external": "^2.2.4",
57
+ "tslib": "^2.6.2",
58
+ "typescript": "^5.3.0"
59
+ }
60
+ }