unified-video-framework 1.4.414 → 1.4.415
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 +1 -1
- package/packages/web/dist/drm/DRMManager.js +1 -1
- package/packages/web/dist/drm/providers/BunnyNetProvider.js +1 -1
- package/packages/web/dist/drm/providers/GenericProvider.js +3 -3
- package/packages/web/dist/drm/systems/FairPlayDRM.js +1 -1
- package/packages/web/dist/drm/systems/PlayReadyDRM.js +1 -1
- package/packages/web/dist/drm/systems/WidevineDRM.js +1 -1
- package/packages/web/dist/drm/types/DRMTypes.js +1 -1
- package/packages/web/dist/drm/utils/BrowserDetector.js +1 -1
- package/scripts/fix-imports.js +54 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unified-video-framework",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.415",
|
|
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",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DRMType as DRMTypeEnum } from "
|
|
1
|
+
import { DRMType as DRMTypeEnum } from "../../../core/dist/index.js";
|
|
2
2
|
import { DRMErrorCode } from "./types/DRMTypes.js";
|
|
3
3
|
import { BrowserDetector } from "./utils/BrowserDetector.js";
|
|
4
4
|
import { BunnyNetProvider } from "./providers/BunnyNetProvider.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DRMType as DRMTypeEnum } from "
|
|
1
|
+
import { DRMType as DRMTypeEnum } from "../../../../core/dist/index.js";
|
|
2
2
|
import { BUNNY_NET_ENDPOINTS } from "../types/BunnyNetTypes.js";
|
|
3
3
|
export class BunnyNetProvider {
|
|
4
4
|
static createDRMConfig(config) {
|
|
@@ -8,7 +8,7 @@ export class GenericProvider {
|
|
|
8
8
|
customData: config.customData,
|
|
9
9
|
provider: 'generic',
|
|
10
10
|
};
|
|
11
|
-
const DRMTypeEnum = require(
|
|
11
|
+
const DRMTypeEnum = require("../../../../core/dist").DRMType;
|
|
12
12
|
switch (config.drmType) {
|
|
13
13
|
case DRMTypeEnum.FAIRPLAY:
|
|
14
14
|
if (config.certificateUrl) {
|
|
@@ -45,7 +45,7 @@ export class GenericProvider {
|
|
|
45
45
|
error: 'License URL is required',
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
const DRMTypeEnum = require(
|
|
48
|
+
const DRMTypeEnum = require("../../../../core/dist").DRMType;
|
|
49
49
|
if (config.type === DRMTypeEnum.FAIRPLAY) {
|
|
50
50
|
const certificateUrl = config.certificateUrl || config.fairplayOptions?.certificateUrl;
|
|
51
51
|
if (!certificateUrl) {
|
|
@@ -78,7 +78,7 @@ export class GenericProvider {
|
|
|
78
78
|
return { valid: true };
|
|
79
79
|
}
|
|
80
80
|
static createMultiDRMConfig(config) {
|
|
81
|
-
const DRMTypeEnum = require(
|
|
81
|
+
const DRMTypeEnum = require("../../../../core/dist").DRMType;
|
|
82
82
|
const drmConfig = {
|
|
83
83
|
type: DRMTypeEnum.WIDEVINE,
|
|
84
84
|
licenseUrl: config.widevine.licenseUrl,
|
|
@@ -2,7 +2,7 @@ import { BaseDRM } from "./BaseDRM.js";
|
|
|
2
2
|
import { KEY_SYSTEMS, DRMErrorCode } from "../types/DRMTypes.js";
|
|
3
3
|
import { CertificateManager } from "../utils/CertificateManager.js";
|
|
4
4
|
import { DRMErrorHandler } from "../utils/DRMErrorHandler.js";
|
|
5
|
-
import { DRMType as DRMTypeEnum } from "
|
|
5
|
+
import { DRMType as DRMTypeEnum } from "../../../../core/dist/index.js";
|
|
6
6
|
export class FairPlayDRM extends BaseDRM {
|
|
7
7
|
constructor(videoElement, config, debug = false) {
|
|
8
8
|
super(videoElement, config, debug);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseDRM } from "./BaseDRM.js";
|
|
2
2
|
import { KEY_SYSTEMS, DRMErrorCode } from "../types/DRMTypes.js";
|
|
3
3
|
import { DRMErrorHandler } from "../utils/DRMErrorHandler.js";
|
|
4
|
-
import { DRMType as DRMTypeEnum } from "
|
|
4
|
+
import { DRMType as DRMTypeEnum } from "../../../../core/dist/index.js";
|
|
5
5
|
export class PlayReadyDRM extends BaseDRM {
|
|
6
6
|
async initialize() {
|
|
7
7
|
this.log('Initializing PlayReady DRM...');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseDRM } from "./BaseDRM.js";
|
|
2
2
|
import { KEY_SYSTEMS, DRMErrorCode } from "../types/DRMTypes.js";
|
|
3
3
|
import { DRMErrorHandler } from "../utils/DRMErrorHandler.js";
|
|
4
|
-
import { DRMType as DRMTypeEnum } from "
|
|
4
|
+
import { DRMType as DRMTypeEnum } from "../../../../core/dist/index.js";
|
|
5
5
|
export class WidevineDRM extends BaseDRM {
|
|
6
6
|
async initialize() {
|
|
7
7
|
this.log('Initializing Widevine DRM...');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KEY_SYSTEMS } from "../types/DRMTypes.js";
|
|
2
|
-
import { DRMType as DRMTypeEnum } from "
|
|
2
|
+
import { DRMType as DRMTypeEnum } from "../../../../core/dist/index.js";
|
|
3
3
|
export class BrowserDetector {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.capabilities = null;
|
package/scripts/fix-imports.js
CHANGED
|
@@ -10,24 +10,61 @@ const path = require('path');
|
|
|
10
10
|
|
|
11
11
|
function fixImports(filePath) {
|
|
12
12
|
let content = fs.readFileSync(filePath, 'utf8');
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
// Replace @unified-video/core imports with relative paths
|
|
15
15
|
if (filePath.includes(path.join('packages', 'web', 'dist'))) {
|
|
16
|
+
// Calculate the correct relative path depth based on file location
|
|
17
|
+
const distPath = path.join('packages', 'web', 'dist');
|
|
18
|
+
const distIndex = filePath.indexOf(distPath);
|
|
19
|
+
const relativePath = filePath.substring(distIndex + distPath.length + 1);
|
|
20
|
+
const depth = relativePath.split(path.sep).length;
|
|
21
|
+
const upLevels = '../'.repeat(depth + 1); // +1 to get out of web/, then to packages/
|
|
22
|
+
const coreImportPath = `${upLevels}core/dist/index.js`;
|
|
23
|
+
const coreRequirePath = `${upLevels}core/dist`;
|
|
24
|
+
|
|
16
25
|
// Fix CommonJS require statements
|
|
17
26
|
content = content.replace(
|
|
18
27
|
/require\(["']@unified-video\/core["']\)/g,
|
|
19
|
-
|
|
28
|
+
`require("${coreRequirePath}")`
|
|
20
29
|
);
|
|
21
30
|
// Fix ES module import statements
|
|
22
31
|
content = content.replace(
|
|
23
32
|
/from\s+["']@unified-video\/core["']/g,
|
|
24
|
-
|
|
33
|
+
`from "${coreImportPath}"`
|
|
25
34
|
);
|
|
26
35
|
content = content.replace(
|
|
27
36
|
/import\s+["']@unified-video\/core["']/g,
|
|
28
|
-
|
|
37
|
+
`import "${coreImportPath}"`
|
|
29
38
|
);
|
|
30
|
-
|
|
39
|
+
|
|
40
|
+
// Fix any leftover old-style imports from core/src
|
|
41
|
+
content = content.replace(
|
|
42
|
+
/require\(['"]\.\.\/\.\.\/\.\.\/core\/src\/interfaces['"]\)/g,
|
|
43
|
+
`require("${coreRequirePath}")`
|
|
44
|
+
);
|
|
45
|
+
content = content.replace(
|
|
46
|
+
/from\s+['"]\.\.\/\.\.\/\.\.\/core\/src\/interfaces['"]/g,
|
|
47
|
+
`from "${coreImportPath}"`
|
|
48
|
+
);
|
|
49
|
+
content = content.replace(
|
|
50
|
+
/from\s+['"]\.\.\/\.\.\/core\/src\/interfaces['"]/g,
|
|
51
|
+
`from "${coreImportPath}"`
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
// Fix incorrect relative paths to core/dist (already converted by TypeScript)
|
|
55
|
+
content = content.replace(
|
|
56
|
+
/from\s+['"](\.\.\/)+core\/dist\/index\.js['"]/g,
|
|
57
|
+
`from "${coreImportPath}"`
|
|
58
|
+
);
|
|
59
|
+
content = content.replace(
|
|
60
|
+
/import\s+['"](\.\.\/)+core\/dist\/index\.js['"]/g,
|
|
61
|
+
`import "${coreImportPath}"`
|
|
62
|
+
);
|
|
63
|
+
content = content.replace(
|
|
64
|
+
/require\(['"](\.\.\/)+core\/dist['"]\)/g,
|
|
65
|
+
`require("${coreRequirePath}")`
|
|
66
|
+
);
|
|
67
|
+
|
|
31
68
|
// Fix relative imports within the same package to include .js extension
|
|
32
69
|
content = content.replace(
|
|
33
70
|
/from\s+["']\.\/([^"']+)(?<!\.js)["']/g,
|
|
@@ -43,19 +80,28 @@ function fixImports(filePath) {
|
|
|
43
80
|
}
|
|
44
81
|
);
|
|
45
82
|
} else if (filePath.includes(path.join('packages', 'react-native', 'dist'))) {
|
|
83
|
+
// Calculate the correct relative path depth based on file location
|
|
84
|
+
const distPath = path.join('packages', 'react-native', 'dist');
|
|
85
|
+
const distIndex = filePath.indexOf(distPath);
|
|
86
|
+
const relativePath = filePath.substring(distIndex + distPath.length + 1);
|
|
87
|
+
const depth = relativePath.split(path.sep).length;
|
|
88
|
+
const upLevels = '../'.repeat(depth + 1); // +1 to get out of react-native/, then to packages/
|
|
89
|
+
const coreImportPath = `${upLevels}core/dist/index.js`;
|
|
90
|
+
const coreRequirePath = `${upLevels}core/dist`;
|
|
91
|
+
|
|
46
92
|
// Fix CommonJS require statements
|
|
47
93
|
content = content.replace(
|
|
48
94
|
/require\(["']@unified-video\/core["']\)/g,
|
|
49
|
-
|
|
95
|
+
`require("${coreRequirePath}")`
|
|
50
96
|
);
|
|
51
97
|
// Fix ES module import statements
|
|
52
98
|
content = content.replace(
|
|
53
99
|
/from\s+["']@unified-video\/core["']/g,
|
|
54
|
-
|
|
100
|
+
`from "${coreImportPath}"`
|
|
55
101
|
);
|
|
56
102
|
content = content.replace(
|
|
57
103
|
/import\s+["']@unified-video\/core["']/g,
|
|
58
|
-
|
|
104
|
+
`import "${coreImportPath}"`
|
|
59
105
|
);
|
|
60
106
|
|
|
61
107
|
// Fix relative imports within the same package to include .js extension
|