unified-video-framework 1.3.2 → 1.3.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unified-video-framework",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Cross-platform video player framework supporting iOS, Android, Web, Smart TVs (Samsung/LG), Roku, and more",
5
5
  "main": "packages/core/dist/index.js",
6
6
  "types": "packages/core/dist/index.d.ts",
@@ -32,6 +32,7 @@
32
32
  "packages/*/dist/**/*",
33
33
  "packages/*/src/**/*",
34
34
  "packages/*/package.json",
35
+ "scripts/fix-imports.js",
35
36
  "README.md",
36
37
  "LICENSE",
37
38
  "INSTALLATION.md"
@@ -44,7 +45,7 @@
44
45
  ],
45
46
  "scripts": {
46
47
  "bootstrap": "lerna bootstrap --legacy-peer-deps",
47
- "build": "npm run build:core && npm run build:web && npm run build:rental-api",
48
+ "build": "npm run build:core && npm run build:web && npm run build:react-native && npm run fix-imports",
48
49
  "build:core": "cd packages/core && npm run build",
49
50
  "build:web": "cd packages/web && npm run build",
50
51
  "build:rental-api": "cd apps/rental-api && npm run build",
@@ -52,17 +53,19 @@
52
53
  "dev:rental-api": "cd apps/rental-api && npm run dev",
53
54
  "build:react-native": "cd packages/react-native && npm run build",
54
55
  "build:enact": "cd packages/enact && npm run build",
55
- "build:all": "lerna run build --stream",
56
+ "build:all": "lerna run build --stream && npm run fix-imports",
56
57
  "clean": "lerna clean",
57
58
  "test": "jest",
58
59
  "test:coverage": "jest --coverage",
59
60
  "test:watch": "jest --watch",
60
61
  "lint": "eslint . --ext .ts,.tsx,.js,.jsx",
61
62
  "type-check": "tsc --noEmit",
62
- "prepublishOnly": "npm run build",
63
+ "prepublishOnly": "npm run build:publish",
63
64
  "dev": "lerna run dev --parallel",
64
65
  "serve:demo": "node server.js",
65
- "docs": "typedoc --out docs packages/core/src"
66
+ "docs": "typedoc --out docs packages/core/src",
67
+ "fix-imports": "node scripts/fix-imports.js",
68
+ "build:publish": "npm run build:core && npm run build:web && npm run fix-imports"
66
69
  },
67
70
  "devDependencies": {
68
71
  "@types/node": "^18.0.0",
@@ -1,16 +1,7 @@
1
- import React from 'react';
2
- import { ViewStyle } from 'react-native';
3
1
  import Video from 'react-native-video';
4
- import { IVideoPlayer, PlayerConfig, PlayerError } from '@unified-video/core';
5
- interface ReactNativePlayerProps {
6
- style?: ViewStyle;
7
- config?: PlayerConfig;
8
- onReady?: () => void;
9
- onError?: (error: PlayerError) => void;
10
- }
2
+ import { IVideoPlayer } from '@unified-video/core';
11
3
  export interface ReactNativePlayerRef extends IVideoPlayer {
12
4
  getVideoRef: () => Video | null;
13
5
  }
14
- export declare const ReactNativePlayer: React.ForwardRefExoticComponent<ReactNativePlayerProps & React.RefAttributes<ReactNativePlayerRef>>;
15
- export {};
6
+ export declare const ReactNativePlayer: any;
16
7
  //# sourceMappingURL=ReactNativePlayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReactNativePlayer.d.ts","sourceRoot":"","sources":["../src/ReactNativePlayer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoF,MAAM,OAAO,CAAC;AACzG,OAAO,EAA8B,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAUN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EAEZ,YAAY,EAIZ,WAAW,EAEZ,MAAM,qBAAqB,CAAC;AAG7B,UAAU,sBAAsB;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,WAAW,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,iBAAiB,qGAgX7B,CAAC"}
1
+ {"version":3,"file":"ReactNativePlayer.d.ts","sourceRoot":"","sources":["../src/ReactNativePlayer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAUN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,YAAY,EAQb,MAAM,qBAAqB,CAAC;AAU7B,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,WAAW,EAAE,MAAM,KAAK,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,iBAAiB,KAgX7B,CAAC"}
@@ -24,7 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.WebPlayer = void 0;
27
- const core_1 = require("@unified-video/core");
27
+ const core_1 = require("../../core/dist");
28
28
  class WebPlayer extends core_1.BasePlayer {
29
29
  constructor() {
30
30
  super(...arguments);
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.VERSION = exports.WebPlayerView = exports.WebPlayer = void 0;
18
- __exportStar(require("@unified-video/core"), exports);
18
+ __exportStar(require("../../core/dist"), exports);
19
19
  var WebPlayer_1 = require("./WebPlayer");
20
20
  Object.defineProperty(exports, "WebPlayer", { enumerable: true, get: function () { return WebPlayer_1.WebPlayer; } });
21
21
  var WebPlayerView_1 = require("./react/WebPlayerView");
@@ -16,7 +16,7 @@
16
16
  "lint": "eslint src --ext .ts,.tsx,.js"
17
17
  },
18
18
  "dependencies": {
19
- "@unified-video/core": "^1.0.0"
19
+ "@unified-video/core": "file:../core"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "dashjs": "^4.0.0",
@@ -0,0 +1,59 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ /**
7
+ * This script fixes the import statements in the compiled JavaScript files
8
+ * to use relative paths instead of package names for internal dependencies.
9
+ */
10
+
11
+ function fixImports(filePath) {
12
+ let content = fs.readFileSync(filePath, 'utf8');
13
+
14
+ // Replace @unified-video/core imports with relative paths
15
+ if (filePath.includes(path.join('packages', 'web', 'dist'))) {
16
+ content = content.replace(
17
+ /require\(["']@unified-video\/core["']\)/g,
18
+ 'require("../../core/dist")'
19
+ );
20
+ } else if (filePath.includes(path.join('packages', 'react-native', 'dist'))) {
21
+ content = content.replace(
22
+ /require\(["']@unified-video\/core["']\)/g,
23
+ 'require("../../core/dist")'
24
+ );
25
+ }
26
+
27
+ fs.writeFileSync(filePath, content, 'utf8');
28
+ }
29
+
30
+ function processDirectory(dir) {
31
+ const files = fs.readdirSync(dir);
32
+
33
+ files.forEach(file => {
34
+ const filePath = path.join(dir, file);
35
+ const stat = fs.statSync(filePath);
36
+
37
+ if (stat.isDirectory()) {
38
+ processDirectory(filePath);
39
+ } else if (file.endsWith('.js')) {
40
+ console.log(`Fixing imports in: ${filePath}`);
41
+ fixImports(filePath);
42
+ }
43
+ });
44
+ }
45
+
46
+ // Fix imports in web and react-native packages
47
+ const packagesDir = path.join(__dirname, '..', 'packages');
48
+
49
+ console.log('Fixing import statements in compiled files...');
50
+
51
+ if (fs.existsSync(path.join(packagesDir, 'web', 'dist'))) {
52
+ processDirectory(path.join(packagesDir, 'web', 'dist'));
53
+ }
54
+
55
+ if (fs.existsSync(path.join(packagesDir, 'react-native', 'dist'))) {
56
+ processDirectory(path.join(packagesDir, 'react-native', 'dist'));
57
+ }
58
+
59
+ console.log('Import fixes complete!');
@@ -1,84 +0,0 @@
1
- # UnifiedVideoPlayer (iOS SDK)
2
-
3
- A unified iOS video player SDK with:
4
- - HLS playback (AVPlayer)
5
- - FairPlay DRM (SPC/CKC)
6
- - Subtitles/audio track selection (AVMediaSelection)
7
- - Picture-in-Picture (AVPictureInPictureController)
8
- - AirPlay (AVRoutePickerView)
9
- - Remote Command Center + Now Playing (lock screen controls)
10
- - Background audio (AVAudioSession)
11
-
12
- ## Installation
13
-
14
- ### CocoaPods
15
- 1) Ensure this SDK is in a public Git repository. Update the podspec `s.source` to point at that repo and tag.
16
- 2) In your Podfile:
17
- ```ruby
18
- platform :ios, '13.0'
19
- use_frameworks!
20
-
21
- target 'YourApp' do
22
- pod 'UnifiedVideoPlayer', :git => 'https://github.com/yourcompany/unified-video-ios.git', :tag => '1.0.0'
23
- end
24
- ```
25
- 3) Run:
26
- ```bash
27
- pod install
28
- ```
29
-
30
- ### Swift Package Manager
31
- Add the package at the repository URL or use Add Local Package pointing to `packages/ios`.
32
-
33
- ## Quick Start
34
- ```swift
35
- import UnifiedVideoPlayer
36
-
37
- let containerView = UIView(frame: .zero)
38
- let player = UnifiedVideoPlayer()
39
- let config = PlayerConfiguration()
40
- config.autoPlay = true
41
-
42
- player.initialize(container: containerView, configuration: config)
43
-
44
- let source = MediaSource(url: "https://example.com/stream.m3u8")
45
- source.metadata = ["title": "Demo Stream"]
46
- player.onReady = { print("ready") }
47
- player.onQualityChange = { br in print("bitrate: \(br)") }
48
-
49
- player.load(source: source)
50
- ```
51
-
52
- ### FairPlay DRM
53
- ```swift
54
- let drm = DRMConfiguration(type: "fairplay", licenseUrl: "https://license.example.com/fps")
55
- drm.certificateUrl = "https://license.example.com/cert"
56
- drm.headers = ["X-Tenant-ID": "default"]
57
-
58
- let source = MediaSource(url: "https://cdn.example.com/protected/playlist.m3u8")
59
- source.drm = drm
60
- player.load(source: source)
61
- ```
62
-
63
- ### Tracks
64
- ```swift
65
- let audios = player.audioTracks() // [String]
66
- let subs = player.subtitleTracks() // [String]
67
- player.selectAudioTrack(index: 0)
68
- player.selectSubtitleTrack(index: -1) // off
69
- ```
70
-
71
- ### PiP & AirPlay
72
- ```swift
73
- player.startPictureInPicture()
74
- player.stopPictureInPicture()
75
- let airPlay = player.makeAirPlayPickerView()
76
- ```
77
-
78
- ## Capabilities
79
- - Enable Background Modes > Audio
80
- - For DRM endpoints, configure ATS exceptions if necessary.
81
-
82
- ## License
83
- MIT
84
-
@@ -1,24 +0,0 @@
1
- import { PaywallConfig } from '@unified-video/core';
2
- export type PaywallControllerOptions = {
3
- getOverlayContainer: () => HTMLElement | null;
4
- onResume: () => void;
5
- onShow?: () => void;
6
- onClose?: () => void;
7
- };
8
- export declare class PaywallController {
9
- private config;
10
- private opts;
11
- private overlayEl;
12
- private gatewayStepEl;
13
- private popup;
14
- constructor(config: PaywallConfig | null, opts: PaywallControllerOptions);
15
- updateConfig(config: PaywallConfig | null): void;
16
- openOverlay(): void;
17
- closeOverlay(): void;
18
- private ensureOverlay;
19
- private showGateways;
20
- private openGateway;
21
- private startPolling;
22
- private onMessage;
23
- }
24
- //# sourceMappingURL=PaywallController.d.ts.map